diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr34768-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr34768-1.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34768-1.c b/gcc/testsuite/gcc.c-torture/execute/pr34768-1.c new file mode 100644 index 000000000..eb16adbf1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr34768-1.c @@ -0,0 +1,26 @@ +int x; + +void __attribute__((noinline)) foo (void) +{ + x = -x; +} +void __attribute__((const,noinline)) bar (void) +{ +} + +int __attribute__((noinline)) +test (int c) +{ + int tmp = x; + (c ? foo : bar) (); + return tmp + x; +} + +extern void abort (void); +int main() +{ + x = 1; + if (test (1) != 0) + abort (); + return 0; +} |