diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr17133.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr17133.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr17133.c b/gcc/testsuite/gcc.c-torture/execute/pr17133.c new file mode 100644 index 000000000..63352c07a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr17133.c @@ -0,0 +1,27 @@ +extern void abort (void); + +int foo = 0; +void *bar = 0; +unsigned int baz = 100; + +void *pure_alloc () +{ + void *res; + + while (1) + { + res = (void *) ((((unsigned int) (foo + bar))) & ~1); + foo += 2; + if (foo < baz) + return res; + foo = 0; + } +} + +int main () +{ + pure_alloc (); + if (!foo) + abort (); + return 0; +} |