From bdd21abf9f08b2fd4c7c2b16aea026445b8917c7 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 23 Sep 2000 11:47:05 +0000 Subject: * gcc.dg/cpp/20000510-1.S: Rename assembler.S. Add test that we continue to preprocess after an unknown directive. * gcc.dg/cpp/tr-str.c: Run-time test for traditional stringification. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@36577 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.dg/cpp/20000510-1.S | 20 -------------------- gcc/testsuite/gcc.dg/cpp/assembler.S | 25 +++++++++++++++++++++++++ gcc/testsuite/gcc.dg/cpp/tr-str.c | 15 ++++++++++++++- 3 files changed, 39 insertions(+), 21 deletions(-) delete mode 100644 gcc/testsuite/gcc.dg/cpp/20000510-1.S create mode 100644 gcc/testsuite/gcc.dg/cpp/assembler.S diff --git a/gcc/testsuite/gcc.dg/cpp/20000510-1.S b/gcc/testsuite/gcc.dg/cpp/20000510-1.S deleted file mode 100644 index 7d6508b3af5..00000000000 --- a/gcc/testsuite/gcc.dg/cpp/20000510-1.S +++ /dev/null @@ -1,20 +0,0 @@ -/* Regression test - in assembly language, # may have some significance - other than 'stringize macro argument' and therefore must be preserved - in the output, and should not be warned about. */ -/* { dg-do preprocess } */ - -#define foo() mov r0, #5 /* { dg-bogus "not followed" "spurious warning" } */ - -entry: - foo() - -/* - { dg-final { if ![file exists 20000510-1.i] { return } } } - { dg-final { set tmp [grep 20000510-1.i # line] } } - { dg-final { if {[string length $tmp] > 0} \{ } } - { dg-final { pass "20000510-1.S: # preservation" } } - { dg-final { \} else \{ } } - { dg-final { fail "20000510-1.S: # preservation" } } - { dg-final { \} } } -*/ - diff --git a/gcc/testsuite/gcc.dg/cpp/assembler.S b/gcc/testsuite/gcc.dg/cpp/assembler.S new file mode 100644 index 00000000000..729162a5120 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/assembler.S @@ -0,0 +1,25 @@ +/* Regression test - in assembly language, # may have some significance + other than 'stringize macro argument' and therefore must be preserved + in the output, and should not be warned about. */ + +/* { dg-do preprocess } */ + +#define foo() mov r0, #5 /* { dg-bogus "not followed" "spurious warning" } */ + +entry: + foo() + +/* Check we don't EOF on an unknown directive. */ +#unknown directive +#error a later diagnostic /* { dg-error "diagnostic" } */ + +/* + { dg-final { if ![file exists 20000510-1.i] { return } } } + { dg-final { set tmp [grep 20000510-1.i # line] } } + { dg-final { if {[string length $tmp] > 0} \{ } } + { dg-final { pass "20000510-1.S: # preservation" } } + { dg-final { \} else \{ } } + { dg-final { fail "20000510-1.S: # preservation" } } + { dg-final { \} } } +*/ + diff --git a/gcc/testsuite/gcc.dg/cpp/tr-str.c b/gcc/testsuite/gcc.dg/cpp/tr-str.c index 3a568ce0eab..bc749ba1035 100644 --- a/gcc/testsuite/gcc.dg/cpp/tr-str.c +++ b/gcc/testsuite/gcc.dg/cpp/tr-str.c @@ -1,4 +1,17 @@ /* Test whether traditional stringify works. */ -/* { dg-do preprocess } */ +/* { dg-do run } */ /* { dg-options "-traditional" } */ #define foo(a, b) c="a"; d="b"; + +extern void abort (); + +int main () +{ + char *c, *d; + + foo (p, q); + if (c[0] != 'p' || d[0] != 'q') + abort (); + + exit (0); +} -- cgit v1.2.3