From a658a86e1dd161613607372a4d3d9fbfbfd0057a Mon Sep 17 00:00:00 2001 From: No Author Date: Sat, 13 Mar 2004 03:03:38 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'gcc-3_3-branch'. From-SVN: r79428 --- .../gcc.c-torture/execute/20040307-1.c | 25 +++++++++++++++++++ .../gcc.c-torture/execute/20040309-1.c | 24 ++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/20040307-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20040309-1.c diff --git a/gcc/testsuite/gcc.c-torture/execute/20040307-1.c b/gcc/testsuite/gcc.c-torture/execute/20040307-1.c new file mode 100644 index 000000000000..8ab8008bb994 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040307-1.c @@ -0,0 +1,25 @@ +int main() +{ + int b = 0; + + struct { + unsigned int bit0:1; + unsigned int bit1:1; + unsigned int bit2:1; + unsigned int bit3:1; + unsigned int bit4:1; + unsigned int bit5:1; + unsigned int bit6:1; + unsigned int bit7:1; + } sdata = {0x01}; + + while ( sdata.bit0-- > 0 ) { + b++ ; + if ( b > 100 ) break; + } + + if (b != 1) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/20040309-1.c b/gcc/testsuite/gcc.c-torture/execute/20040309-1.c new file mode 100644 index 000000000000..49fa79560c60 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040309-1.c @@ -0,0 +1,24 @@ +extern void abort (); + +int foo(unsigned short x) +{ + unsigned short y; + y = x > 32767 ? x - 32768 : 0; + return y; +} + +int main() +{ + if (foo (0) != 0) + abort (); + if (foo (32767) != 0) + abort (); + if (foo (32768) != 0) + abort (); + if (foo (32769) != 1) + abort (); + if (foo (65535) != 32767) + abort (); + return 0; +} + -- 2.47.2