diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr117811.c | 27 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr119133.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr119417.c | 24 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr119532.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr119599-1.c | 27 |
5 files changed, 93 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr117811.c b/gcc/testsuite/gcc.dg/torture/pr117811.c new file mode 100644 index 0000000..13d7e13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr117811.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ + +#include <string.h> + +typedef int v4 __attribute__((vector_size (4 * sizeof (int)))); + +void __attribute__((noclone,noinline)) do_shift (v4 *vec, int shift) +{ + v4 t = *vec; + + if (shift > 0) + { + t = t >> shift; + } + + *vec = t; +} + +int main () +{ + v4 vec = {0x1000000, 0x2000, 0x300, 0x40}; + v4 vec2 = {0x100000, 0x200, 0x30, 0x4}; + do_shift (&vec, 4); + if (memcmp (&vec, &vec2, sizeof (v4)) != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr119133.c b/gcc/testsuite/gcc.dg/torture/pr119133.c index 5369bec..f0c8f73 100644 --- a/gcc/testsuite/gcc.dg/torture/pr119133.c +++ b/gcc/testsuite/gcc.dg/torture/pr119133.c @@ -1,5 +1,6 @@ /* { dg-additional-options "-fno-tree-ter" } */ /* { dg-require-effective-target float16 } */ +/* { dg-add-options float16 } */ int foo(_Float16 f, int i) diff --git a/gcc/testsuite/gcc.dg/torture/pr119417.c b/gcc/testsuite/gcc.dg/torture/pr119417.c new file mode 100644 index 0000000..d0b5378 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119417.c @@ -0,0 +1,24 @@ +/* PR tree-optimization/119417 */ +/* { dg-do run { target int32 } } */ + +__attribute__((noipa)) void +foo (unsigned long long x) +{ + if (x != 0) + __builtin_abort (); +} + +unsigned v = 0x10000; + +int +main () +{ + unsigned long long a = 0; + while (1) + { + a = a + ((v & 0xFFFF) * 2); + foo (a); + if (v) + break; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr119532.c b/gcc/testsuite/gcc.dg/torture/pr119532.c new file mode 100644 index 0000000..bba2e45 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119532.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fixed_point } */ + +extern _Fract sinuhk_deg (unsigned short _Accum); + +_Fract cosuhk_deg (unsigned short _Accum deg) +{ + unsigned short _Accum _90_deg = 90uhk; + __asm ("" : "+r" (_90_deg)); + + return deg <= _90_deg + ? sinuhk_deg (_90_deg - deg) + : -sinuhk_deg (deg - _90_deg); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr119599-1.c b/gcc/testsuite/gcc.dg/torture/pr119599-1.c new file mode 100644 index 0000000..4fbd228 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119599-1.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-einline" } */ + +/* PR ipa/119599 */ +/* inlining a noreturn function which returns + can cause an ICE when dealing finding an unreachable block. + We should get a __builtin_unreachable after the inliing. */ + + +void baz (void); + +static inline __attribute__((always_inline, noreturn)) void +bar (void) +{ + static volatile int t = 0; + if (t == 0) + baz (); +} /* { dg-warning "function does return" } */ + +void +foo (void) +{ + bar (); +} + +/* After inlining, we should have call to __builtin_unreachable now. */ +/* { dg-final { scan-tree-dump "__builtin_unreachable " "einline" } } */ |