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
This commit is contained in:
Ian Lance Taylor 2008-07-10 01:41:06 +00:00 committed by Ian Lance Taylor
parent e32717fc89
commit a1361ef205
8 changed files with 79 additions and 0 deletions

View File

@ -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

View File

@ -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 }

View File

@ -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." }

View File

@ -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." }

View File

@ -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." } */

View File

@ -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." } */

View File

@ -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." } */

View File

@ -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." } */