]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sat, 13 Mar 2004 03:03:38 +0000 (03:03 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sat, 13 Mar 2004 03:03:38 +0000 (03:03 +0000)
'gcc-3_3-branch'.

From-SVN: r79428

gcc/testsuite/gcc.c-torture/execute/20040307-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20040309-1.c [new file with mode: 0644]

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 (file)
index 0000000..8ab8008
--- /dev/null
@@ -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 (file)
index 0000000..49fa795
--- /dev/null
@@ -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;
+}
+