diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-04 08:58:49 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-04 08:58:49 +0000 |
commit | b1c48e44d8fdb58a54f31f7e9ba21d5708ba401a (patch) | |
tree | 42bff8c688a570512da9d5c2f7cb5168e8cdfd20 | |
parent | 936a2e9997c17980d64de4f3b8df8523d1cec71d (diff) | |
download | gcc-b1c48e44d8fdb58a54f31f7e9ba21d5708ba401a.tar.gz |
* gcc.dg/typeof-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56792 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/typeof-2.c | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c4900bdf74f..58bf6195f2f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -2,6 +2,8 @@ * g++.dg/other/cxa-atexit1.C: New test. + * gcc.dg/typeof-2.c: New test. + 2002-09-03 Neil Booth <neil@daikokuya.co.uk> * gcc.dg/cpp/_Pragma4.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 index 00000000000..34d67b20fdc --- /dev/null +++ b/gcc/testsuite/gcc.dg/typeof-2.c @@ -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" } } |