aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-02-28 10:49:42 +0000
committerJakub Jelinek <jakub@redhat.com>2008-02-28 10:49:42 +0000
commit25a164d401975fb130aea968accabaaa2e9bb5ec (patch)
tree1f3a664b54843c6b162ba160f43b4705d2a33918 /gcc/testsuite/gcc.c-torture
parent36fa6bc4063ff0cc41ec68def26d7fa82cb5d1e7 (diff)
svn merge -r132546:132742 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch/
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_3-branch@132743 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr34971.c22
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr35390.c13
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34971.c b/gcc/testsuite/gcc.c-torture/execute/pr34971.c
new file mode 100644
index 00000000000..3299aee22c9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr34971.c
@@ -0,0 +1,22 @@
+struct foo
+{
+ unsigned long long b:40;
+} x;
+
+extern void abort (void);
+
+void test1(unsigned long long res)
+{
+ /* Build a rotate expression on a 40 bit argument. */
+ if ((x.b<<8) + (x.b>>32) != res)
+ abort ();
+}
+
+int main()
+{
+ x.b = 0x0100000001;
+ test1(0x0000000101);
+ x.b = 0x0100000000;
+ test1(0x0000000001);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35390.c b/gcc/testsuite/gcc.c-torture/execute/pr35390.c
new file mode 100644
index 00000000000..7103a9b5414
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr35390.c
@@ -0,0 +1,13 @@
+extern void abort (void);
+
+unsigned int foo (int n)
+{
+ return ~((unsigned int)~n);
+}
+
+int main()
+{
+ if (foo(0) != 0)
+ abort ();
+ return 0;
+}