diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/bitint-76.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/bitint-77.c | 26 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr118476-1.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr119599-1.c | 27 |
4 files changed, 86 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/bitint-76.c b/gcc/testsuite/gcc.dg/torture/bitint-76.c new file mode 100644 index 0000000..df47857 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/bitint-76.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/119707 */ +/* { dg-do run { target bitint } } */ + +#if __BITINT_MAXWIDTH__ >= 256 +__attribute__((noipa)) unsigned _BitInt(256) +foo (unsigned _BitInt(256) x, _BitInt(129) y) +{ + return x + (unsigned _BitInt(255)) y; +} +#endif + +int +main () +{ +#if __BITINT_MAXWIDTH__ >= 256 + if (foo (0, -1) != 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffuwb) + __builtin_abort (); +#endif +} diff --git a/gcc/testsuite/gcc.dg/torture/bitint-77.c b/gcc/testsuite/gcc.dg/torture/bitint-77.c new file mode 100644 index 0000000..3e2523f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/bitint-77.c @@ -0,0 +1,26 @@ +/* PR tree-optimization/119722 */ +/* { dg-do run { target bitint } } */ +/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-copy-prop -fno-tree-fre" } */ + +#if __BITINT_MAXWIDTH__ >= 33300 +unsigned _BitInt(33300) g; + +unsigned +foo (long c) +{ + unsigned _BitInt(33300) b + = __builtin_stdc_rotate_left ((unsigned _BitInt(13)) 8, c); + return ((unsigned _BitInt(50)) (g >> 50) + + ({ unsigned _BitInt(300) unused; b; })); +} +#endif + +int +main () +{ +#if __BITINT_MAXWIDTH__ >= 33300 + unsigned x = foo (0); + if (x != 8) + __builtin_abort (); +#endif +} diff --git a/gcc/testsuite/gcc.dg/torture/pr118476-1.c b/gcc/testsuite/gcc.dg/torture/pr118476-1.c new file mode 100644 index 0000000..33509403 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr118476-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +/* PR tree-optimization/118476 */ + +typedef unsigned long long poly64x1 __attribute__((__vector_size__(1*sizeof(long long)))); + +poly64x1 vext_p64(poly64x1 a, poly64x1 b, const int n) +{ + poly64x1 r = a; + unsigned src = (unsigned)n; + long long t = b[0]; + r[0] = (src < 1) ? a[src] : t; + return r; +} 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" } } */ |