]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc.dg/typeof-2.c: New test.
authorJakub Jelinek <jakub@redhat.com>
Wed, 4 Sep 2002 08:57:31 +0000 (10:57 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 4 Sep 2002 08:57:31 +0000 (10:57 +0200)
From-SVN: r56791

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/typeof-2.c [new file with mode: 0644]

index 36a5ca380a87624725c8c0605ea88678625453ed..715beb25a11031157db8bfda2969060c89eb32b0 100644 (file)
@@ -2,6 +2,8 @@
 
        * g++.dg/other/cxa-atexit1.C: New test.
 
+       * gcc.dg/typeof-2.c: New test.
+
 2002-09-01  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/typeof-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/typeof-2.c b/gcc/testsuite/gcc.dg/typeof-2.c
new file mode 100644 (file)
index 0000000..34d67b2
--- /dev/null
@@ -0,0 +1,29 @@
+/* Test typeof with __asm redirection. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int foo1 (int x) __asm ("baz1");
+int bar1 (int x) { return x; }
+extern __typeof (bar1) foo1 __attribute ((weak, alias ("bar1")));
+
+extern int foo2 (int x) __attribute__ ((const));
+extern __typeof (foo2) foo2 __asm ("baz2");
+int bar2 (int x)
+{
+  return foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x);
+}
+
+extern int foo3 (int x);
+extern __typeof (foo3) foo3 __asm ("baz3");
+int bar3 (int x)
+{
+  return foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x);
+}
+
+// { dg-final { scan-assembler-not "foo1" } }
+// { dg-final { scan-assembler "baz1" } }
+// { dg-final { scan-assembler-not "foo2" } }
+// { dg-final { scan-assembler "baz2" } }
+// { dg-final { scan-assembler-not "baz2.*baz2.*baz2.*baz2.*baz2.*baz2" } }
+// { dg-final { scan-assembler-not "foo3" } }
+// { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }