diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr37931.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr37931.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37931.c b/gcc/testsuite/gcc.c-torture/execute/pr37931.c new file mode 100644 index 000000000..0077a21ba --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr37931.c @@ -0,0 +1,23 @@ +/* PR middle-end/37931 */ + +extern void abort (void); + +int +foo (int a, unsigned int b) +{ + return (a | 1) & (b | 1); +} + +int +main (void) +{ + if (foo (6, 0xc6) != 7) + abort (); + if (foo (0x80, 0xc1) != 0x81) + abort (); + if (foo (4, 4) != 5) + abort (); + if (foo (5, 4) != 5) + abort (); + return 0; +} |