diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20050131-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20050131-1.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050131-1.c b/gcc/testsuite/gcc.c-torture/execute/20050131-1.c new file mode 100644 index 000000000..9fae91181 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20050131-1.c @@ -0,0 +1,18 @@ +/* Verify that we do not lose side effects on a MOD expression. */ + +#include <stdlib.h> +#include <stdio.h> + +int +foo (int a) +{ + int x = 0 % a++; + return a; +} + +main() +{ + if (foo (9) != 10) + abort (); + exit (0); +} |