]> git.pld-linux.org Git - packages/gcc.git/blame - gcc32-typeof-asm.patch
06b1320a380cc9d5159b2d5ab39b8d9e
[packages/gcc.git] / gcc32-typeof-asm.patch
CommitLineData
5384b728 12002-08-08 Jakub Jelinek <jakub@redhat.com>
2
3 * g++.dg/ext/typeof2.C: New test.
4 * gcc.dg/typeof-1.c: New test.
5 * gcc.dg/typeof-2.c: New test.
6
7--- gcc/testsuite/g++.dg/ext/typeof2.C.jj 2002-08-08 14:24:56.000000000 +0200
8+++ gcc/testsuite/g++.dg/ext/typeof2.C 2002-08-08 14:24:39.000000000 +0200
9@@ -0,0 +1,29 @@
10+// Test typeof with __asm redirection
11+// { dg-do compile }
12+// { dg-options "-O2" }
13+
14+extern "C" {
15+ extern int foo1;
16+ extern int foo1 __asm ("bar1");
17+ int foo1 = 1;
18+
19+ extern int foo2 (int);
20+ extern int foo2 (int) __asm ("bar2");
21+ int foo2 (int x)
22+ {
23+ return x;
24+ }
25+
26+ extern int foo3;
27+ extern __typeof (foo3) foo3 __asm ("bar3");
28+ int foo3 = 1;
29+
30+ extern int foo4 (int);
31+ extern __typeof (foo4) foo4 __asm ("bar4");
32+ int foo4 (int x)
33+ {
34+ return x;
35+ }
36+}
37+
38+// { dg-final { scan-assembler-not "foo" } }
39--- gcc/testsuite/gcc.dg/typeof-1.c.jj 2002-08-08 14:26:18.000000000 +0200
40+++ gcc/testsuite/gcc.dg/typeof-1.c 2002-08-08 14:26:06.000000000 +0200
41@@ -0,0 +1,27 @@
42+/* Test typeof with __asm redirection. */
43+/* { dg-do compile } */
44+/* { dg-options "-O2" } */
45+
46+extern int foo1;
47+extern int foo1 __asm ("bar1");
48+int foo1 = 1;
49+
50+extern int foo2 (int);
51+extern int foo2 (int) __asm ("bar2");
52+int foo2 (int x)
53+{
54+ return x;
55+}
56+
57+extern int foo3;
58+extern __typeof (foo3) foo3 __asm ("bar3");
59+int foo3 = 1;
60+
61+extern int foo4 (int);
62+extern __typeof (foo4) foo4 __asm ("bar4");
63+int foo4 (int x)
64+{
65+ return x;
66+}
67+
68+// { dg-final { scan-assembler-not "foo" } }
69--- gcc/testsuite/gcc.dg/typeof-2.c.jj 2002-08-08 20:42:33.000000000 +0200
70+++ gcc/testsuite/gcc.dg/typeof-2.c 2002-08-08 20:47:53.000000000 +0200
71@@ -0,0 +1,29 @@
72+/* Test typeof with __asm redirection. */
73+/* { dg-do compile } */
74+/* { dg-options "-O2" } */
75+
76+extern int foo1 (int x) __asm ("baz1");
77+int bar1 (int x) { return x; }
78+extern __typeof (bar1) foo1 __attribute ((weak, alias ("bar1")));
79+
80+extern int foo2 (int x) __attribute__ ((const));
81+extern __typeof (foo2) foo2 __asm ("baz2");
82+int bar2 (int x)
83+{
84+ return foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x);
85+}
86+
87+extern int foo3 (int x);
88+extern __typeof (foo3) foo3 __asm ("baz3");
89+int bar3 (int x)
90+{
91+ return foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x);
92+}
93+
94+// { dg-final { scan-assembler-not "foo1" } }
95+// { dg-final { scan-assembler "baz1" } }
96+// { dg-final { scan-assembler-not "foo2" } }
97+// { dg-final { scan-assembler "baz2" } }
98+// { dg-final { scan-assembler-not "baz2.*baz2.*baz2.*baz2.*baz2.*baz2" } }
99+// { dg-final { scan-assembler-not "foo3" } }
100+// { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }
This page took 0.048948 seconds and 4 git commands to generate.