]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fixes for test case pr117546.c
authorDimitar Dimitrov <dimitar@dinux.eu>
Sat, 18 Jan 2025 18:19:43 +0000 (20:19 +0200)
committerDimitar Dimitrov <dimitar@dinux.eu>
Sun, 19 Jan 2025 07:52:21 +0000 (09:52 +0200)
This test fails on AVR.

Debugging the test on x86 host, I noticed that u in function s sometimes
has value 16128.  The "t <= 3 * u" expression in the same function
results in signed integer overflow for targets with sizeof(int)=2.

Fix by requiring int32 effective target.

Also add return statement for the main function.

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr117546.c: Require effective target int32.
(main): Add return statement.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/testsuite/gcc.dg/torture/pr117546.c

index 21e2aef18b9a5aa39847f6db8c2b6ad9502610c3..b60f877a9063f80c805ac43b732f3f4a7a7b2c5a 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target int32 } } */
 
 typedef struct {
   int a;
@@ -81,4 +81,6 @@ int main() {
   l.glyf.coords[4] = (e){2, 206};
   l.glyf.coords[6] = (e){0, 308, 5};
   w(&l);
+
+  return 0;
 }