diff options
author | Ian Lance Taylor <iant@google.com> | 2008-07-10 01:41:06 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2008-07-10 01:41:06 +0000 |
commit | a1361ef205258875edb527aa8eb48f8924a822b5 (patch) | |
tree | 4d595d7e802be1437284b339e41e8501f93a2a8d /gcc | |
parent | e32717fc8929c80c03c13fbd584437d93605acff (diff) | |
download | gcc-a1361ef205258875edb527aa8eb48f8924a822b5.zip gcc-a1361ef205258875edb527aa8eb48f8924a822b5.tar.gz gcc-a1361ef205258875edb527aa8eb48f8924a822b5.tar.bz2 |
no-asm-1.c: New test.
* gcc.dg/no-asm-1.c: New test.
* gcc.dg/no-asm-2.c: New test.
* gcc.dg/no-asm-3.c: New test.
* gcc.dg/no-asm-4.c: New test.
* g++.dg/ext/no-asm-1.C: New test.
* g++.dg/ext/no-asm-2.C: New test.
* g++.dg/ext/no-gnu-keywords-1.C: New test.
From-SVN: r137684
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/no-asm-1.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/no-asm-2.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/no-gnu-keywords-1.C | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/no-asm-1.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/no-asm-2.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/no-asm-3.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/no-asm-4.c | 11 |
8 files changed, 79 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ddae4e..7518595 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2008-07-09 Ian Lance Taylor <iant@google.com> + + * gcc.dg/no-asm-1.c: New test. + * gcc.dg/no-asm-2.c: New test. + * gcc.dg/no-asm-3.c: New test. + * gcc.dg/no-asm-4.c: New test. + * g++.dg/ext/no-asm-1.C: New test. + * g++.dg/ext/no-asm-2.C: New test. + * g++.dg/ext/no-gnu-keywords-1.C: New test. + 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/36760 diff --git a/gcc/testsuite/g++.dg/ext/no-asm-1.C b/gcc/testsuite/g++.dg/ext/no-asm-1.C new file mode 100644 index 0000000..6c4c204 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/no-asm-1.C @@ -0,0 +1,10 @@ +// { dg-do compile } +// { dg-options "" } + +// Verify that asm and the GNU extension typeof are recognized as +// keywords. + +int asm; // { dg-error "before .asm." } +int typeof; // { dg-error "expected" } +// { dg-error "multiple types" "" { target *-*-* } 8 } +// { dg-error "declaration" "" { target *-*-* } 8 } diff --git a/gcc/testsuite/g++.dg/ext/no-asm-2.C b/gcc/testsuite/g++.dg/ext/no-asm-2.C new file mode 100644 index 0000000..fa614d8 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/no-asm-2.C @@ -0,0 +1,10 @@ +// { dg-do compile } +// { dg-options "-fno-asm" } + +// Verify that the keyword asm and the GNU extension typeof are not +// recognized as keywords when using -fno-asm. Having -fno-asm affect +// a standard C++ keyword seems strange, but that is existing +// behaviour. If that behaviour changes, this test should change. + +int asm; // { dg-bogus "before .asm." } +int typeof; // { dg-bogus "before .typeof." } diff --git a/gcc/testsuite/g++.dg/ext/no-gnu-keywords-1.C b/gcc/testsuite/g++.dg/ext/no-gnu-keywords-1.C new file mode 100644 index 0000000..8dbbd5f --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/no-gnu-keywords-1.C @@ -0,0 +1,9 @@ +// { dg-do compile } +// { dg-options "-fno-gnu-keywords" } + +// Verify that the keyword asm is recognized and that the GNU +// extension typeof is not recognized as a keyword when using +// -fno-gnu-keywords. + +int asm; // { dg-error "before .asm." } +int typeof; // { dg-bogus "before .typeof." } diff --git a/gcc/testsuite/gcc.dg/no-asm-1.c b/gcc/testsuite/gcc.dg/no-asm-1.c new file mode 100644 index 0000000..fdcf054 --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-asm-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu89" } */ + +/* Verify that these GNU extensions are recognized as keywords in + GNU89 mode. */ + +int asm; /* { dg-error "before .asm." } */ +int inline; /* { dg-warning "empty declaration" } */ +/* { dg-error "empty declaration" "" { target *-*-* } 8 } */ +int typeof; /* { dg-error "before .typeof." } */ diff --git a/gcc/testsuite/gcc.dg/no-asm-2.c b/gcc/testsuite/gcc.dg/no-asm-2.c new file mode 100644 index 0000000..3cd4114 --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-asm-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu89 -fno-asm" } */ + +/* Verify that these GNU extensions are not recognized as keywords + when using -fno-asm in GNU89 mode. */ + +int asm; /* { dg-bogus "before .asm." } */ +int inline; /* { dg-bogus "empty declaration" } */ +int typeof; /* { dg-bogus "before .typeof." } */ diff --git a/gcc/testsuite/gcc.dg/no-asm-3.c b/gcc/testsuite/gcc.dg/no-asm-3.c new file mode 100644 index 0000000..9c806e4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-asm-3.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +/* Verify that these GNU extensions are recognized as keywords in + GNU99 mode. */ + +int asm; /* { dg-error "before .asm." } */ +int inline; /* { dg-warning "empty declaration" } */ +/* { dg-error "empty declaration" "" { target *-*-* } 8 } */ +int typeof; /* { dg-error "before .typeof." } */ diff --git a/gcc/testsuite/gcc.dg/no-asm-4.c b/gcc/testsuite/gcc.dg/no-asm-4.c new file mode 100644 index 0000000..c4c1687 --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-asm-4.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -fno-asm" } */ + +/* Verify that the GNU extensions asm and typeof are not recognized as + keywords when using -fno-asm in GNU89 mode, but that inline (which + is a keyword in C99 but not C89) is recognized. */ + +int asm; /* { dg-bogus "before .asm." } */ +int inline; /* { dg-warning "empty declaration" } */ +/* { dg-error "empty declaration" "" { target *-*-* } 9 } */ +int typeof; /* { dg-bogus "before .typeof." } */ |