From 18c3a4ac0fb738d8a29d262215dfa7efca2bea78 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 11 Dec 1998 00:14:59 +0000 Subject: [PATCH] * gcc.c-torture/compile/981211-1.c: New test. From-SVN: r24256 --- gcc/testsuite/ChangeLog | 4 ++ .../gcc.c-torture/compile/981211-1.c | 43 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/981211-1.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4449b5f1682..42defe3d5cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +Fri Dec 11 01:12:45 1998 Zack Weinberg + + * gcc.c-torture/compile/981211-1.c: New test. + 1998-12-09 Alexandre Oliva * gcc.dg/ultrasp1.c: empty dg-options, avoid `long long' warnings diff --git a/gcc/testsuite/gcc.c-torture/compile/981211-1.c b/gcc/testsuite/gcc.c-torture/compile/981211-1.c new file mode 100644 index 00000000000..92c9cfb7013 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/981211-1.c @@ -0,0 +1,43 @@ +/* Basic tests of the #assert preprocessor extension. */ + +#define fail int fail + +#assert abc (def) +#assert abc (ghi) +#assert abc (jkl) +#assert space ( s p a c e ) + +/* Basic: */ +#if !#abc (def) || !#abc (ghi) || !#abc (jkl) +fail +#endif + +/* any answer for #abc */ +#if !#abc +fail +#endif + +/* internal whitespace is collapsed, + external whitespace is deleted */ +#if !#space (s p a c e) || !#space ( s p a c e ) || #space (space) +fail +#endif + +/* removing assertions */ +#unassert abc (jkl) +#if !#abc || !#abc (def) || !#abc (ghi) || #abc (jkl) +fail +#endif + +#unassert abc +#if #abc || #abc (def) || #abc (ghi) || #abc (jkl) +fail +#endif + +int gobble + +/* make sure it can succeed too. + also check space before open paren isn't significant */ +#if #space(s p a c e) +; +#endif -- 2.30.2