From d845dc520b111af7fff19324ff64b46ff846010b Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Tue, 27 Jun 2000 22:26:11 +0000 Subject: cpp: New directory. * gcc.dg/cpp: New directory. * gcc.dg/cpp/cpp.exp: New driver. * gcc.dg/cpp/20000627-1.c: New test. * gcc.c-torture/special/special.exp: Remove entry for 921210-1.c. * gcc.c-torture/special/921210-1.c: Move to gcc.dg/cpp/19921210-1.c and rewrite as a compilation test. * gcc.dg: Move many files into the cpp subdirectory, possibly renaming or editing them as well. Old name New name 990119-1.c cpp/19990119-1.c 990228-1.c cpp/19990228-1.c 990407-1.c cpp/19990407-1.c 990409-1.c cpp/19990409-1.c 990413-1.c cpp/19990413-1.c 990703-1.c cpp/19990703-1.c 20000127-1.c cpp/20000127-1.c 20000129-1.c cpp/20000129-1.c 20000207-1.c cpp/20000207-1.c 20000207-2.c cpp/20000207-2.c 20000209-1.c cpp/20000209-1.c 20000209-2.c cpp/20000209-2.c 20000301-1.c cpp/20000301-1.c 20000419-1.c cpp/20000419-1.c 20000510-1.S cpp/20000510-1.S 20000519-1.c cpp/20000519-1.c 20000529-1.c cpp/20000529-1.c 20000625-1.c cpp/20000625-1.c 20000625-2.c cpp/20000625-2.c cpp-as1.c cpp/assert1.c cpp-as2.c cpp/assert2.c cxx-comments-1.c cpp/cxxcom1.c cxx-comments-2.c cpp/cxxcom2.c endif-label.c cpp/endif.c cpp-hash1.c cpp/hash1.c cpp-hash2.c cpp/hash2.c cpp-if1.c cpp/if-1.c cpp-if2.c cpp/if-2.c cpp-if3.c cpp/if-3.c cpp-if4.c cpp/if-4.c cpp-if5.c cpp/if-5.c cpp-cond.c cpp/if-cexp.c cpp-missingop.c cpp/if-mop.c cpp-missingparen.c cpp/if-mpar.c cpp-opprec.c cpp/if-oppr.c cpp-ifparen.c cpp/if-paren.c cpp-shortcircuit.c cpp/if-sc.c cpp-shift.c cpp/if-shift.c cpp-unary.c cpp/if-unary.c cpp-li1.c cpp/line1.c cpp-li2.c cpp/line2.c lineno.c cpp/line3.c lineno-2.c cpp/line4.c cpp-mi.c cpp/mi1.c cpp-mic.h cpp/mi1c.h cpp-micc.h cpp/mi1cc.h cpp-mind.h cpp/mi1nd.h cpp-mindp.h cpp/mi1ndp.h cpp-mix.h cpp/mi1x.h cpp-mi2.c cpp/mi2.c cpp-mi2a.h cpp/mi2a.h cpp-mi2b.h cpp/mi2b.h cpp-mi2c.h cpp/mi2c.h cpp-mi3.c cpp/mi3.c cpp-mi3.def cpp/mi3.def poison-1.c cpp/poison.c pr-impl.c cpp/prag-imp.c cpp-redef-2.c cpp/redef1.c cpp-redef.c cpp/redef2.c strpaste.c cpp/strp1.c strpaste-2.c cpp/strp2.c cpp-tradpaste.c cpp/tr-paste.c cpp-tradstringify.c cpp/tr-str.c cpp-tradwarn1.c cpp/tr-warn1.c cpp-tradwarn2.c cpp/tr-warn2.c trigraphs.c cpp/trigraphs.c cpp-unc1.c cpp/unc1.c cpp-unc2.c cpp/unc2.c cpp-unc3.c cpp/unc3.c cpp-unc.c cpp/unc4.c undef.c cpp/undef1.c undef-2.c cpp/undef2.c cpp-wi1.c cpp/widestr1.c From-SVN: r34747 --- gcc/testsuite/ChangeLog | 86 +++++++++++++++ gcc/testsuite/gcc.c-torture/special/921210-1.c | 4 - gcc/testsuite/gcc.c-torture/special/special.exp | 11 -- gcc/testsuite/gcc.dg/20000127-1.c | 139 ------------------------ gcc/testsuite/gcc.dg/20000129-1.c | 15 --- gcc/testsuite/gcc.dg/20000207-1.c | 16 --- gcc/testsuite/gcc.dg/20000207-2.c | 16 --- gcc/testsuite/gcc.dg/20000209-1.c | 34 ------ gcc/testsuite/gcc.dg/20000209-2.c | 19 ---- gcc/testsuite/gcc.dg/20000301-1.c | 3 - gcc/testsuite/gcc.dg/20000419-1.c | 15 --- gcc/testsuite/gcc.dg/20000510-1.S | 20 ---- gcc/testsuite/gcc.dg/20000519-1.c | 10 -- gcc/testsuite/gcc.dg/20000529-1.c | 14 --- gcc/testsuite/gcc.dg/20000625-1.c | 18 --- gcc/testsuite/gcc.dg/20000625-2.c | 27 ----- gcc/testsuite/gcc.dg/990119-1.c | 17 --- gcc/testsuite/gcc.dg/990228-1.c | 29 ----- gcc/testsuite/gcc.dg/990407-1.c | 19 ---- gcc/testsuite/gcc.dg/990409-1.c | 20 ---- gcc/testsuite/gcc.dg/990413-1.c | 13 --- gcc/testsuite/gcc.dg/990703-1.c | 24 ---- gcc/testsuite/gcc.dg/cpp-as1.c | 46 -------- gcc/testsuite/gcc.dg/cpp-as2.c | 24 ---- gcc/testsuite/gcc.dg/cpp-cond.c | 13 --- gcc/testsuite/gcc.dg/cpp-hash1.c | 9 -- gcc/testsuite/gcc.dg/cpp-hash2.c | 15 --- gcc/testsuite/gcc.dg/cpp-if1.c | 34 ------ gcc/testsuite/gcc.dg/cpp-if2.c | 19 ---- gcc/testsuite/gcc.dg/cpp-if3.c | 25 ----- gcc/testsuite/gcc.dg/cpp-if4.c | 8 -- gcc/testsuite/gcc.dg/cpp-if5.c | 12 -- gcc/testsuite/gcc.dg/cpp-ifparen.c | 31 ------ gcc/testsuite/gcc.dg/cpp-li1.c | 18 --- gcc/testsuite/gcc.dg/cpp-li2.c | 13 --- gcc/testsuite/gcc.dg/cpp-mi.c | 37 ------- gcc/testsuite/gcc.dg/cpp-mi2.c | 12 -- gcc/testsuite/gcc.dg/cpp-mi2a.h | 5 - gcc/testsuite/gcc.dg/cpp-mi2b.h | 6 - gcc/testsuite/gcc.dg/cpp-mi2c.h | 15 --- gcc/testsuite/gcc.dg/cpp-mi3.c | 17 --- gcc/testsuite/gcc.dg/cpp-mi3.def | 10 -- gcc/testsuite/gcc.dg/cpp-mic.h | 10 -- gcc/testsuite/gcc.dg/cpp-micc.h | 10 -- gcc/testsuite/gcc.dg/cpp-mind.h | 8 -- gcc/testsuite/gcc.dg/cpp-mindp.h | 7 -- gcc/testsuite/gcc.dg/cpp-missingop.c | 23 ---- gcc/testsuite/gcc.dg/cpp-missingparen.c | 21 ---- gcc/testsuite/gcc.dg/cpp-mix.h | 9 -- gcc/testsuite/gcc.dg/cpp-opprec.c | 97 ----------------- gcc/testsuite/gcc.dg/cpp-redef-2.c | 30 ----- gcc/testsuite/gcc.dg/cpp-redef.c | 19 ---- gcc/testsuite/gcc.dg/cpp-shift.c | 22 ---- gcc/testsuite/gcc.dg/cpp-shortcircuit.c | 26 ----- gcc/testsuite/gcc.dg/cpp-tradpaste.c | 17 --- gcc/testsuite/gcc.dg/cpp-tradstringify.c | 4 - gcc/testsuite/gcc.dg/cpp-tradwarn1.c | 30 ----- gcc/testsuite/gcc.dg/cpp-tradwarn2.c | 14 --- gcc/testsuite/gcc.dg/cpp-unary.c | 32 ------ gcc/testsuite/gcc.dg/cpp-unc.c | 40 ------- gcc/testsuite/gcc.dg/cpp-unc1.c | 13 --- gcc/testsuite/gcc.dg/cpp-unc2.c | 11 -- gcc/testsuite/gcc.dg/cpp-unc3.c | 4 - gcc/testsuite/gcc.dg/cpp-wi1.c | 9 -- gcc/testsuite/gcc.dg/cpp/19921210-1.c | 13 +++ gcc/testsuite/gcc.dg/cpp/19990119-1.c | 9 ++ gcc/testsuite/gcc.dg/cpp/19990228-1.c | 29 +++++ gcc/testsuite/gcc.dg/cpp/19990407-1.c | 19 ++++ gcc/testsuite/gcc.dg/cpp/19990409-1.c | 6 + gcc/testsuite/gcc.dg/cpp/19990413-1.c | 13 +++ gcc/testsuite/gcc.dg/cpp/19990703-1.c | 24 ++++ gcc/testsuite/gcc.dg/cpp/20000127-1.c | 139 ++++++++++++++++++++++++ gcc/testsuite/gcc.dg/cpp/20000129-1.c | 15 +++ gcc/testsuite/gcc.dg/cpp/20000207-1.c | 16 +++ gcc/testsuite/gcc.dg/cpp/20000207-2.c | 16 +++ gcc/testsuite/gcc.dg/cpp/20000209-1.c | 34 ++++++ gcc/testsuite/gcc.dg/cpp/20000209-2.c | 19 ++++ gcc/testsuite/gcc.dg/cpp/20000301-1.c | 3 + gcc/testsuite/gcc.dg/cpp/20000419-1.c | 15 +++ gcc/testsuite/gcc.dg/cpp/20000510-1.S | 20 ++++ gcc/testsuite/gcc.dg/cpp/20000519-1.c | 10 ++ gcc/testsuite/gcc.dg/cpp/20000529-1.c | 14 +++ gcc/testsuite/gcc.dg/cpp/20000625-1.c | 16 +++ gcc/testsuite/gcc.dg/cpp/20000625-2.c | 27 +++++ gcc/testsuite/gcc.dg/cpp/20000627-1.c | 10 ++ gcc/testsuite/gcc.dg/cpp/assert1.c | 46 ++++++++ gcc/testsuite/gcc.dg/cpp/assert2.c | 24 ++++ gcc/testsuite/gcc.dg/cpp/cpp.exp | 70 ++++++++++++ gcc/testsuite/gcc.dg/cpp/cxxcom1.c | 20 ++++ gcc/testsuite/gcc.dg/cpp/cxxcom2.c | 20 ++++ gcc/testsuite/gcc.dg/cpp/endif.c | 15 +++ gcc/testsuite/gcc.dg/cpp/hash1.c | 9 ++ gcc/testsuite/gcc.dg/cpp/hash2.c | 15 +++ gcc/testsuite/gcc.dg/cpp/if-1.c | 34 ++++++ gcc/testsuite/gcc.dg/cpp/if-2.c | 19 ++++ gcc/testsuite/gcc.dg/cpp/if-3.c | 25 +++++ gcc/testsuite/gcc.dg/cpp/if-4.c | 8 ++ gcc/testsuite/gcc.dg/cpp/if-5.c | 12 ++ gcc/testsuite/gcc.dg/cpp/if-cexp.c | 13 +++ gcc/testsuite/gcc.dg/cpp/if-mop.c | 23 ++++ gcc/testsuite/gcc.dg/cpp/if-mpar.c | 21 ++++ gcc/testsuite/gcc.dg/cpp/if-oppr.c | 97 +++++++++++++++++ gcc/testsuite/gcc.dg/cpp/if-paren.c | 31 ++++++ gcc/testsuite/gcc.dg/cpp/if-sc.c | 26 +++++ gcc/testsuite/gcc.dg/cpp/if-shift.c | 22 ++++ gcc/testsuite/gcc.dg/cpp/if-unary.c | 32 ++++++ gcc/testsuite/gcc.dg/cpp/line1.c | 18 +++ gcc/testsuite/gcc.dg/cpp/line2.c | 13 +++ gcc/testsuite/gcc.dg/cpp/line3.c | 28 +++++ gcc/testsuite/gcc.dg/cpp/line4.c | 19 ++++ gcc/testsuite/gcc.dg/cpp/mi1.c | 37 +++++++ gcc/testsuite/gcc.dg/cpp/mi1c.h | 10 ++ gcc/testsuite/gcc.dg/cpp/mi1cc.h | 10 ++ gcc/testsuite/gcc.dg/cpp/mi1nd.h | 8 ++ gcc/testsuite/gcc.dg/cpp/mi1ndp.h | 7 ++ gcc/testsuite/gcc.dg/cpp/mi1x.h | 9 ++ gcc/testsuite/gcc.dg/cpp/mi2.c | 12 ++ gcc/testsuite/gcc.dg/cpp/mi2a.h | 5 + gcc/testsuite/gcc.dg/cpp/mi2b.h | 6 + gcc/testsuite/gcc.dg/cpp/mi2c.h | 15 +++ gcc/testsuite/gcc.dg/cpp/mi3.c | 17 +++ gcc/testsuite/gcc.dg/cpp/mi3.def | 10 ++ gcc/testsuite/gcc.dg/cpp/poison.c | 25 +++++ gcc/testsuite/gcc.dg/cpp/prag-imp.c | 7 ++ gcc/testsuite/gcc.dg/cpp/redef1.c | 19 ++++ gcc/testsuite/gcc.dg/cpp/redef2.c | 30 +++++ gcc/testsuite/gcc.dg/cpp/strp1.c | 35 ++++++ gcc/testsuite/gcc.dg/cpp/strp2.c | 23 ++++ gcc/testsuite/gcc.dg/cpp/tr-paste.c | 17 +++ gcc/testsuite/gcc.dg/cpp/tr-str.c | 4 + gcc/testsuite/gcc.dg/cpp/tr-warn1.c | 30 +++++ gcc/testsuite/gcc.dg/cpp/tr-warn2.c | 14 +++ gcc/testsuite/gcc.dg/cpp/trigraphs.c | 30 +++++ gcc/testsuite/gcc.dg/cpp/unc1.c | 13 +++ gcc/testsuite/gcc.dg/cpp/unc2.c | 11 ++ gcc/testsuite/gcc.dg/cpp/unc3.c | 4 + gcc/testsuite/gcc.dg/cpp/unc4.c | 40 +++++++ gcc/testsuite/gcc.dg/cpp/undef1.c | 14 +++ gcc/testsuite/gcc.dg/cpp/undef2.c | 23 ++++ gcc/testsuite/gcc.dg/cpp/widestr1.c | 9 ++ gcc/testsuite/gcc.dg/cxx-comments-1.c | 20 ---- gcc/testsuite/gcc.dg/cxx-comments-2.c | 20 ---- gcc/testsuite/gcc.dg/endif-label.c | 15 --- gcc/testsuite/gcc.dg/lineno-2.c | 26 ----- gcc/testsuite/gcc.dg/lineno.c | 28 ----- gcc/testsuite/gcc.dg/poison-1.c | 25 ----- gcc/testsuite/gcc.dg/pr-impl.c | 7 -- gcc/testsuite/gcc.dg/strpaste-2.c | 23 ---- gcc/testsuite/gcc.dg/strpaste.c | 35 ------ gcc/testsuite/gcc.dg/trigraphs.c | 30 ----- gcc/testsuite/gcc.dg/undef-2.c | 23 ---- gcc/testsuite/gcc.dg/undef.c | 14 --- 152 files changed, 1707 insertions(+), 1574 deletions(-) delete mode 100644 gcc/testsuite/gcc.c-torture/special/921210-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000127-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000129-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000207-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000207-2.c delete mode 100644 gcc/testsuite/gcc.dg/20000209-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000209-2.c delete mode 100644 gcc/testsuite/gcc.dg/20000301-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000419-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000510-1.S delete mode 100644 gcc/testsuite/gcc.dg/20000519-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000529-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000625-1.c delete mode 100644 gcc/testsuite/gcc.dg/20000625-2.c delete mode 100644 gcc/testsuite/gcc.dg/990119-1.c delete mode 100644 gcc/testsuite/gcc.dg/990228-1.c delete mode 100644 gcc/testsuite/gcc.dg/990407-1.c delete mode 100644 gcc/testsuite/gcc.dg/990409-1.c delete mode 100644 gcc/testsuite/gcc.dg/990413-1.c delete mode 100644 gcc/testsuite/gcc.dg/990703-1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-as1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-as2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-cond.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-hash1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-hash2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-if1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-if2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-if3.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-if4.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-if5.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-ifparen.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-li1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-li2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi2a.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi2b.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi2c.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi3.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-mi3.def delete mode 100644 gcc/testsuite/gcc.dg/cpp-mic.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-micc.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-mind.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-mindp.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-missingop.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-missingparen.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-mix.h delete mode 100644 gcc/testsuite/gcc.dg/cpp-opprec.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-redef-2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-redef.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-shift.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-shortcircuit.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-tradpaste.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-tradstringify.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-tradwarn1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-tradwarn2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-unary.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-unc.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-unc1.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-unc2.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-unc3.c delete mode 100644 gcc/testsuite/gcc.dg/cpp-wi1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19921210-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19990119-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19990228-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19990407-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19990409-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19990413-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/19990703-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000127-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000129-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000207-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000207-2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000209-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000209-2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000301-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000419-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000510-1.S create mode 100644 gcc/testsuite/gcc.dg/cpp/20000519-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000529-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000625-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000625-2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/20000627-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/assert1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/assert2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/cpp.exp create mode 100644 gcc/testsuite/gcc.dg/cpp/cxxcom1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/cxxcom2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/endif.c create mode 100644 gcc/testsuite/gcc.dg/cpp/hash1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/hash2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-3.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-4.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-5.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-cexp.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-mop.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-mpar.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-oppr.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-paren.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-sc.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-shift.c create mode 100644 gcc/testsuite/gcc.dg/cpp/if-unary.c create mode 100644 gcc/testsuite/gcc.dg/cpp/line1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/line2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/line3.c create mode 100644 gcc/testsuite/gcc.dg/cpp/line4.c create mode 100644 gcc/testsuite/gcc.dg/cpp/mi1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/mi1c.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi1cc.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi1nd.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi1ndp.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi1x.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/mi2a.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi2b.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi2c.h create mode 100644 gcc/testsuite/gcc.dg/cpp/mi3.c create mode 100644 gcc/testsuite/gcc.dg/cpp/mi3.def create mode 100644 gcc/testsuite/gcc.dg/cpp/poison.c create mode 100644 gcc/testsuite/gcc.dg/cpp/prag-imp.c create mode 100644 gcc/testsuite/gcc.dg/cpp/redef1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/redef2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/strp1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/strp2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/tr-paste.c create mode 100644 gcc/testsuite/gcc.dg/cpp/tr-str.c create mode 100644 gcc/testsuite/gcc.dg/cpp/tr-warn1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/tr-warn2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/trigraphs.c create mode 100644 gcc/testsuite/gcc.dg/cpp/unc1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/unc2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/unc3.c create mode 100644 gcc/testsuite/gcc.dg/cpp/unc4.c create mode 100644 gcc/testsuite/gcc.dg/cpp/undef1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/undef2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/widestr1.c delete mode 100644 gcc/testsuite/gcc.dg/cxx-comments-1.c delete mode 100644 gcc/testsuite/gcc.dg/cxx-comments-2.c delete mode 100644 gcc/testsuite/gcc.dg/endif-label.c delete mode 100644 gcc/testsuite/gcc.dg/lineno-2.c delete mode 100644 gcc/testsuite/gcc.dg/lineno.c delete mode 100644 gcc/testsuite/gcc.dg/poison-1.c delete mode 100644 gcc/testsuite/gcc.dg/pr-impl.c delete mode 100644 gcc/testsuite/gcc.dg/strpaste-2.c delete mode 100644 gcc/testsuite/gcc.dg/strpaste.c delete mode 100644 gcc/testsuite/gcc.dg/trigraphs.c delete mode 100644 gcc/testsuite/gcc.dg/undef-2.c delete mode 100644 gcc/testsuite/gcc.dg/undef.c (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 91b90d8..31acb8c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,89 @@ +2000-06-27 Zack Weinberg + + * gcc.dg/cpp: New directory. + * gcc.dg/cpp/cpp.exp: New driver. + * gcc.dg/cpp/20000627-1.c: New test. + * gcc.c-torture/special/special.exp: Remove entry for 921210-1.c. + * gcc.c-torture/special/921210-1.c: Move to gcc.dg/cpp/19921210-1.c + and rewrite as a compilation test. + + * gcc.dg: Move many files into the cpp subdirectory, possibly + renaming or editing them as well. + Old name New name + 990119-1.c cpp/19990119-1.c + 990228-1.c cpp/19990228-1.c + 990407-1.c cpp/19990407-1.c + 990409-1.c cpp/19990409-1.c + 990413-1.c cpp/19990413-1.c + 990703-1.c cpp/19990703-1.c + 20000127-1.c cpp/20000127-1.c + 20000129-1.c cpp/20000129-1.c + 20000207-1.c cpp/20000207-1.c + 20000207-2.c cpp/20000207-2.c + 20000209-1.c cpp/20000209-1.c + 20000209-2.c cpp/20000209-2.c + 20000301-1.c cpp/20000301-1.c + 20000419-1.c cpp/20000419-1.c + 20000510-1.S cpp/20000510-1.S + 20000519-1.c cpp/20000519-1.c + 20000529-1.c cpp/20000529-1.c + 20000625-1.c cpp/20000625-1.c + 20000625-2.c cpp/20000625-2.c + cpp-as1.c cpp/assert1.c + cpp-as2.c cpp/assert2.c + cxx-comments-1.c cpp/cxxcom1.c + cxx-comments-2.c cpp/cxxcom2.c + endif-label.c cpp/endif.c + cpp-hash1.c cpp/hash1.c + cpp-hash2.c cpp/hash2.c + cpp-if1.c cpp/if-1.c + cpp-if2.c cpp/if-2.c + cpp-if3.c cpp/if-3.c + cpp-if4.c cpp/if-4.c + cpp-if5.c cpp/if-5.c + cpp-cond.c cpp/if-cexp.c + cpp-missingop.c cpp/if-mop.c + cpp-missingparen.c cpp/if-mpar.c + cpp-opprec.c cpp/if-oppr.c + cpp-ifparen.c cpp/if-paren.c + cpp-shortcircuit.c cpp/if-sc.c + cpp-shift.c cpp/if-shift.c + cpp-unary.c cpp/if-unary.c + cpp-li1.c cpp/line1.c + cpp-li2.c cpp/line2.c + lineno.c cpp/line3.c + lineno-2.c cpp/line4.c + cpp-mi.c cpp/mi1.c + cpp-mic.h cpp/mi1c.h + cpp-micc.h cpp/mi1cc.h + cpp-mind.h cpp/mi1nd.h + cpp-mindp.h cpp/mi1ndp.h + cpp-mix.h cpp/mi1x.h + cpp-mi2.c cpp/mi2.c + cpp-mi2a.h cpp/mi2a.h + cpp-mi2b.h cpp/mi2b.h + cpp-mi2c.h cpp/mi2c.h + cpp-mi3.c cpp/mi3.c + cpp-mi3.def cpp/mi3.def + poison-1.c cpp/poison.c + pr-impl.c cpp/prag-imp.c + cpp-redef-2.c cpp/redef1.c + cpp-redef.c cpp/redef2.c + strpaste.c cpp/strp1.c + strpaste-2.c cpp/strp2.c + cpp-tradpaste.c cpp/tr-paste.c + cpp-tradstringify.c cpp/tr-str.c + cpp-tradwarn1.c cpp/tr-warn1.c + cpp-tradwarn2.c cpp/tr-warn2.c + trigraphs.c cpp/trigraphs.c + cpp-unc1.c cpp/unc1.c + cpp-unc2.c cpp/unc2.c + cpp-unc3.c cpp/unc3.c + cpp-unc.c cpp/unc4.c + undef.c cpp/undef1.c + undef-2.c cpp/undef2.c + cpp-wi1.c cpp/widestr1.c + 2000-06-27 Mark Mitchell * lib/g++.exp (g++_include_flags): Tweak. diff --git a/gcc/testsuite/gcc.c-torture/special/921210-1.c b/gcc/testsuite/gcc.c-torture/special/921210-1.c deleted file mode 100644 index bbbf39a..0000000 --- a/gcc/testsuite/gcc.c-torture/special/921210-1.c +++ /dev/null @@ -1,4 +0,0 @@ -#define a1(y) (y+1) -#define a2(y) a1(y)+1 -#define f a->f -a2(f) diff --git a/gcc/testsuite/gcc.c-torture/special/special.exp b/gcc/testsuite/gcc.c-torture/special/special.exp index 8415b22..cc5b812 100644 --- a/gcc/testsuite/gcc.c-torture/special/special.exp +++ b/gcc/testsuite/gcc.c-torture/special/special.exp @@ -50,17 +50,6 @@ if { [istarget rs6000-*-aix*] dg-runtest $srcdir/$subdir/981006-1.c "-Wuninitialized -O2 $extra_flags" "" dg-finish -# 921210-1 -set lines [gcc_target_compile $srcdir/$subdir/921210-1.c "" preprocess ""] -set lines [prune [split [prune_warnings [prune_gcc_output $lines]] "\n"] ""] -set line [lindex $lines [expr [llength $lines]-1]] -regsub -all " " $line "" clean -if [expr [string compare $clean "(a->f+1)+1"]==0] then { - pass "921210-1.c" -} else { - fail "921210-1.c" -} - # 920521-1 c-torture 920521-1.c "-S" diff --git a/gcc/testsuite/gcc.dg/20000127-1.c b/gcc/testsuite/gcc.dg/20000127-1.c deleted file mode 100644 index 467ad2c..0000000 --- a/gcc/testsuite/gcc.dg/20000127-1.c +++ /dev/null @@ -1,139 +0,0 @@ -/* { dg-do compile } */ - -/* Test for core dump in the preprocessor. Originally exposed by - XEmacs, but this has been synthesized from scratch. */ - -#define foo(bar) bar - -int x = -foo( - /* - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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..0000000 --- a/gcc/testsuite/gcc.dg/20000129-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Regression test for trigraph warnings. Under certain conditions we - got the line numbers wrong. - Originally exposed by XEmacs and reported by Martin Buchholz - ; this test case is synthetic. */ - -/* { dg-do preprocess } */ -/* { dg-options -Wall } */ - -#define some_macro \ - blah \ - blah \ - blah \ - blah - -??> /* { dg-warning "trigraph ..." "trigraph encountered" } */ diff --git a/gcc/testsuite/gcc.dg/20000207-1.c b/gcc/testsuite/gcc.dg/20000207-1.c deleted file mode 100644 index 931cc0d..0000000 --- a/gcc/testsuite/gcc.dg/20000207-1.c +++ /dev/null @@ -1,16 +0,0 @@ -/* { dg-do preprocess } */ - -/* Test for proper handling of unary minus in #if. */ - -#if !(-1) -#error Error /* { dg-bogus "Error" "case !(-1)" } */ -#endif - -#if !-1 -#error Error /* { dg-bogus "Error" "case !-1" } */ -#endif - -#if -1 -#else -#error Error /* { dg-bogus "Error" "case -1" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/20000207-2.c b/gcc/testsuite/gcc.dg/20000207-2.c deleted file mode 100644 index fbdf39e..0000000 --- a/gcc/testsuite/gcc.dg/20000207-2.c +++ /dev/null @@ -1,16 +0,0 @@ -/* { dg-do preprocess } */ - -/* Test for proper handling of unary plus in #if. */ - -#if !(+1) -#error Error /* { dg-bogus "Error" "case !(+1)" } */ -#endif - -#if !+1 -#error Error /* { dg-bogus "Error" "case !+1" } */ -#endif - -#if +1 -#else -#error Error /* { dg-bogus "Error" "case +1" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/20000209-1.c b/gcc/testsuite/gcc.dg/20000209-1.c deleted file mode 100644 index fe71058..0000000 --- a/gcc/testsuite/gcc.dg/20000209-1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do preprocess } */ - -/* Tests for line numbering around function-like macro calls. - Bug found by Mark Mitchell. */ - -#define f(x) x -#define g f - -f (3); -#error here /* { dg-error "here" "case 0" } */ - -f - (3); -#error here /* { dg-error "here" "case 1" } */ - -(f - )(3); -#error here /* { dg-error "here" "case 2" } */ - -g - (3); -#error here /* { dg-error "here" "case 3" } */ - -(g - )(3); -#error here /* { dg-error "here" "case 4" } */ - -f /* some - text */ (3); -#error here /* { dg-error "here" "case 5" } */ - -(g /* some - text */ )(3); -#error here /* { dg-error "here" "case 6" } */ diff --git a/gcc/testsuite/gcc.dg/20000209-2.c b/gcc/testsuite/gcc.dg/20000209-2.c deleted file mode 100644 index 6a9198f..0000000 --- a/gcc/testsuite/gcc.dg/20000209-2.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-Wall" } */ -/* Distilled from glibc sources. Tests preprocessor corner cases. - Since it uses rest args, we must turn off -pedantic-errors. */ - -#define NO_PAREN(rest...) rest -#define DEFINE_CATEGORY(category, items) \ -const int _nl_value_type_##category[] = { NO_PAREN items } - -DEFINE_CATEGORY -( - LC_COLLATE, - ( - 1, - 2, - 3, - )); - -DEFINE_CATEGORY(LC_CTYPE, (1, 2, 3)); diff --git a/gcc/testsuite/gcc.dg/20000301-1.c b/gcc/testsuite/gcc.dg/20000301-1.c deleted file mode 100644 index 85645b0..0000000 --- a/gcc/testsuite/gcc.dg/20000301-1.c +++ /dev/null @@ -1,3 +0,0 @@ -/* { dg-do preprocess } */ -/* Test for crash with indented empty definitions. */ - #define _LIBC_LIMITS_H_ /* nothing */ diff --git a/gcc/testsuite/gcc.dg/20000419-1.c b/gcc/testsuite/gcc.dg/20000419-1.c deleted file mode 100644 index c4400ee..0000000 --- a/gcc/testsuite/gcc.dg/20000419-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Test for erroneous deletion of the entire macro expansion when pruning - \r escapes. Problem noted by DJ Delorie ; test case - distilled from GNU libc header files. */ -/* { dg-do preprocess } */ - -#define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) -#define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) -#define __ASMNAME2(prefix, cname) __STRING (prefix) cname -#define __STRING(x) #x - -__REDIRECT (a, b, c) -__ASMNAME2 (__USER_LABEL_PREFIX__, harumph) - -/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 11 } */ -/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 12 } */ diff --git a/gcc/testsuite/gcc.dg/20000510-1.S b/gcc/testsuite/gcc.dg/20000510-1.S deleted file mode 100644 index 7d6508b..0000000 --- a/gcc/testsuite/gcc.dg/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/20000519-1.c b/gcc/testsuite/gcc.dg/20000519-1.c deleted file mode 100644 index 82ab3a2..0000000 --- a/gcc/testsuite/gcc.dg/20000519-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* Regression test for preprocessor crash. - Reported by Mathias Froehlich . */ -/* { dg-do preprocess } */ -#define foo - -#define __CAT__(a,b,c,d) a##b##c##d -#define CAT(a,b,c,d) __CAT__(a,b,c,d) - -#define bar CAT(,foo,bar,) -bar diff --git a/gcc/testsuite/gcc.dg/20000529-1.c b/gcc/testsuite/gcc.dg/20000529-1.c deleted file mode 100644 index 6343a81..0000000 --- a/gcc/testsuite/gcc.dg/20000529-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Regression test for bug with macro expansion on #if lines - - exposed by glibc. */ -/* { dg-do compile } */ - -# define SHLIB_COMPAT(lib, introduced, obsoleted) \ - (!(ABI_##lib##_##obsoleted - 0) \ - || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))) - -#if 0 -bad -#elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) -int -#endif -x; diff --git a/gcc/testsuite/gcc.dg/20000625-1.c b/gcc/testsuite/gcc.dg/20000625-1.c deleted file mode 100644 index 717ffb0..0000000 --- a/gcc/testsuite/gcc.dg/20000625-1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Regression test for paste corner cases. Distilled from - syscall stub logic in glibc. */ - -/* { dg-do run } */ - -#include - -#define ENTRY(name) name##: -#define socket bind - -int -main(void) -{ - goto socket; - - ENTRY(socket) - return 0; -} diff --git a/gcc/testsuite/gcc.dg/20000625-2.c b/gcc/testsuite/gcc.dg/20000625-2.c deleted file mode 100644 index e983450..0000000 --- a/gcc/testsuite/gcc.dg/20000625-2.c +++ /dev/null @@ -1,27 +0,0 @@ -/* More paste corner cases from glibc. */ -/* { dg-do run } */ - -#define symbol_version(name, version) name##@##version - -#define str(x) xstr(x) -#define xstr(x) #x - -const char a[] = str(symbol_version(getrlimit, GLIBC_2.0)); -const char b[] = str(getrlimit@GLIBC_2.0); -const char c[] = "getrlimit@GLIBC_2.0"; - -#include -#include - -int -main(void) -{ - if(strcmp(a, b)) - abort(); - if(strcmp(b, c)) - abort(); - if(strcmp(c, a)) - abort(); - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990119-1.c b/gcc/testsuite/gcc.dg/990119-1.c deleted file mode 100644 index c9b75bd..0000000 --- a/gcc/testsuite/gcc.dg/990119-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* This checks for two things: - - an obscure corner case in the standard rules for __LINE__ - - regression of an associated bug in cpplib where the semicolon got lost */ -/* { dg-do run } */ - -int i = __LINE__\ -; - -extern void abort (void); - -int main (void) /* { dg-bogus "parse error" "semicolon eaten" } */ -{ - if (i != 6) - abort (); - else - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990228-1.c b/gcc/testsuite/gcc.dg/990228-1.c deleted file mode 100644 index 4b846ea..0000000 --- a/gcc/testsuite/gcc.dg/990228-1.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Regression test for cpp. The following input may cause core dumps - or # line markers in the middle of the line. */ -/* { dg-do preprocess } */ - -#define foo(string, arg) bar(2, string, arg) - -foo ("\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -", -NULL); - -/* - { dg-final { if ![file exists 990228-1.i] { return } } } - { dg-final { set tmp [grep 990228-1.i ".#"] } } - { dg-final { if { [string length $tmp] == 0 } \{ } } - { dg-final { pass "990228-1.c: linemarkers in middle of line" } } - { dg-final { \} else \{ } } - { dg-final { fail "990228-1.c: linemarkers in middle of line" } } - { dg-final { \} } } - */ diff --git a/gcc/testsuite/gcc.dg/990407-1.c b/gcc/testsuite/gcc.dg/990407-1.c deleted file mode 100644 index d6da8d6..0000000 --- a/gcc/testsuite/gcc.dg/990407-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Regression test for a cpplib macro-expansion bug where - `@' becomes `@@' when stringified. */ - -/* { dg-do run } */ - -#include -#include - -#define STR(x) #x - -char *a = STR(@foo), *b = "@foo"; - -int -main(void) -{ - if (strcmp (a, b)) - abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990409-1.c b/gcc/testsuite/gcc.dg/990409-1.c deleted file mode 100644 index c7bfa61..0000000 --- a/gcc/testsuite/gcc.dg/990409-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Test that __LINE__ works when embedded in a macro. */ -/* { dg-do run } */ - -extern void abort (void); - -#define XLINE __LINE__ - -void -bar(int x, int y) -{ - if (x != y) - abort(); -} - -int -main(void) -{ - bar(XLINE, __LINE__); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990413-1.c b/gcc/testsuite/gcc.dg/990413-1.c deleted file mode 100644 index 9abddb9..0000000 --- a/gcc/testsuite/gcc.dg/990413-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Verify that cpp doesn't screw up the line numbering when a macro argument - extends over multiple lines. */ -/* { dg-do compile } */ - -#define FOO(x) /* nothing */ - -void -func(void) -{ - FOO(i - = 4) - else; /* { dg-error "parse error" "error on this line" { target *-*-* } { 12 } } */ -} diff --git a/gcc/testsuite/gcc.dg/990703-1.c b/gcc/testsuite/gcc.dg/990703-1.c deleted file mode 100644 index 88dc9e6..0000000 --- a/gcc/testsuite/gcc.dg/990703-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* { dg-do run } */ - -/* Test of obscure case in token pasting in the preprocessor. - I can't think of any way to make this problem provoke a syntax error. - Based on a bug report by Manfred Hollstein. */ - -#include - -#define SP1(x, y) SP2(x, y) -#define SP2(x, y) SP3(x##y) -#define SP3(x) #x -#define MZ -0 - -int -main(void) -{ - char *x = SP1(0,MZ); - char *y = "0-0"; /* should be the expansion of SP1(0,MZ) */ - - if(strcmp(x, y)) - return 1; - else - return 0; -} diff --git a/gcc/testsuite/gcc.dg/cpp-as1.c b/gcc/testsuite/gcc.dg/cpp-as1.c deleted file mode 100644 index ff7cc62..0000000 --- a/gcc/testsuite/gcc.dg/cpp-as1.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Basic tests of the #assert preprocessor extension. */ -/* { dg-do compile } */ -/* { dg-options "" } */ - -#define def unused expansion -#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 diff --git a/gcc/testsuite/gcc.dg/cpp-as2.c b/gcc/testsuite/gcc.dg/cpp-as2.c deleted file mode 100644 index 26d3aad..0000000 --- a/gcc/testsuite/gcc.dg/cpp-as2.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Malformed assertion tests. */ -/* { dg-do preprocess } */ -/* { dg-options "-fno-show-column" } */ - -#assert /* { dg-error "without predicate" "assert w/o predicate" } */ -#assert % /* { dg-error "an identifier" "assert punctuation" } */ -#assert 12 /* { dg-error "an identifier" "assert number" } */ -#assert abc /* { dg-error "missing" "assert w/o answer" } */ - -#if # /* { dg-error "without predicate" "test w/o predicate" } */ -#endif - -#if #% /* { dg-error "an identifier" "test punctuation" } */ -#endif - -#if #12 /* { dg-error "an identifier" "test number" } */ -#endif - -#if #abc -#error /* { dg-bogus "error" "test w/o answer" } */ -#endif - -#if #abc[def] /* { dg-error "invalid char" "test with malformed answer" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-cond.c b/gcc/testsuite/gcc.dg/cpp-cond.c deleted file mode 100644 index e2af375..0000000 --- a/gcc/testsuite/gcc.dg/cpp-cond.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do preprocess } */ - -/* Test the ? : opearator, for precedence and both true and false. */ - -#if 1 ? 1 ? 2 : 0 : 0 -#error OK /* { dg-error "OK" "nested ? :" } */ -#endif - -#if ((0) ? (1) ? (2) : (3) : (4) ? (5): (6)) == 5 -#error OK /* { dg-error "OK" "nested ? : with parens" } */ -#endif - - diff --git a/gcc/testsuite/gcc.dg/cpp-hash1.c b/gcc/testsuite/gcc.dg/cpp-hash1.c deleted file mode 100644 index a4c4b35..0000000 --- a/gcc/testsuite/gcc.dg/cpp-hash1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Test for proper handling of # in object-like macros. - From Linux kernel. */ -/* { dg-do preprocess } */ - -#define FIXUP .section ".fixup",#alloc,#execinstr - -FIXUP - -/* { dg-bogus "not followed by" "object-like #" { target *-*-* } 3 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-hash2.c b/gcc/testsuite/gcc.dg/cpp-hash2.c deleted file mode 100644 index 4e177f4..0000000 --- a/gcc/testsuite/gcc.dg/cpp-hash2.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Test for erroneously thinking comments are token-pastes. - From XFree86 4.0. */ -/* { dg-do preprocess } */ -/* { dg-options "-traditional" } */ - -#ifndef foo -#define foo /**/ -#endif - -#ifndef foo -#define foo /* as nothing */ -#endif - -/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } 7 } */ -/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-if1.c b/gcc/testsuite/gcc.dg/cpp-if1.c deleted file mode 100644 index 9b7c8d3..0000000 --- a/gcc/testsuite/gcc.dg/cpp-if1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-pedantic-errors" } */ - -#if 0xa != 10 -#error 0xa != 10 /* { dg-bogus "#error" "normal conversion" } */ -#endif - -#if 077 != 63 -#error 077 != 63 /* { dg-bogus "#error" "normal conversion" } */ -#endif - -#if 12wrt /* { dg-error "nvalid number|missing white" "invalid number" } */ -#endif - -#if 0abc /* { dg-error "nvalid number|missing white" "invalid number" } */ -#endif - -#if 42abc /* { dg-error "nvalid number|missing white" "invalid number" } */ -#endif - -#if 1.2 /* { dg-error "loating point numbers" "floating point in #if" } */ -#endif - -#if 4uu /* { dg-error "too many 'u'" "too many suffixes" } */ -#endif - -#if 124123231lll /* { dg-error "too many 'l'" "too many suffixes" } */ -#endif - -#if 099 /* { dg-error "digits beyond the radix" "decimal in octal constant" } */ -#endif - -#if 0xfffffffffffffffff /* { dg-error "integer constant out of range" "range error" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-if2.c b/gcc/testsuite/gcc.dg/cpp-if2.c deleted file mode 100644 index 60e8ffd..0000000 --- a/gcc/testsuite/gcc.dg/cpp-if2.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options -pedantic-errors } */ - -#if 'a' != 'a' || '\001' != 1 || '\x12' != 0x12 -#error a,1,0x12 /* { dg-bogus "#error" "basic charconst recognition" } */ -#endif - -#if 'a' != L'a' || L'\xfeed' != 0xfeed -#error L'a',0xfeed /* { dg-bogus "#error" "wide charconst recognition" } */ -#endif - -#if 'abcd' /* { dg-warning "multi-character character constant" "multi-character charconst" } */ -#endif - -#if 'abcdefghi' /* { dg-error "character constant (is )?too long" "charconst too long" } */ -#endif - -#if '' /* { dg-error "empty character constant" "empty charconst" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-if3.c b/gcc/testsuite/gcc.dg/cpp-if3.c deleted file mode 100644 index c46f563..0000000 --- a/gcc/testsuite/gcc.dg/cpp-if3.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Test that the preprocessor is capable of 64-bit arithmetic. - (Must turn off -pedantic, since `LL' constants are only in C9x.) */ -/* { dg-do preprocess } */ -/* { dg-options "" } */ - -#define U_MAX 4294967295U -#define ULL_MAX 18446744073709551615ULL -#define LL_MAX 9223372036854775807LL -#define LL_MIN (-LL_MAX-1) - -/* Check simple truncation. */ -#if U_MAX == ULL_MAX || LL_MIN == 0 || LL_MAX == -1 -#error "simple truncation" /* { dg-bogus "trunc" "simple truncation" } */ -#endif - -/* Check left/right shifting with all bits set and with one bit set. */ -#if !(~0ULL >> 63) || !(~0ULL << 63) || !(~0LL >> 63) || !(~0LL << 63) || \ - !(LL_MIN >> 63) || !(1LL << 62) || !(ULL_MAX >> 63) || !(1ULL << 63) -#error "bit shift truncation" /* { dg-bogus "trunc" "bit shift truncation" } */ -#endif - -/* Check math expressions. */ -#if (2ULL * U_MAX < U_MAX) || (1ULL + U_MAX < U_MAX) -#error "math truncation" /* { dg-bogus "trunc" "math truncation" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-if4.c b/gcc/testsuite/gcc.dg/cpp-if4.c deleted file mode 100644 index 84764fb..0000000 --- a/gcc/testsuite/gcc.dg/cpp-if4.c +++ /dev/null @@ -1,8 +0,0 @@ -/* Regression test for proper error message. The token name isn't - NUL terminated, so we would print garbage after it. */ -/* { dg-do compile } */ - -#if 1 += 2 /* { dg-error "'\\+=' is not allowed" "+= in if" } */ -syntax_error -#endif -int foo; diff --git a/gcc/testsuite/gcc.dg/cpp-if5.c b/gcc/testsuite/gcc.dg/cpp-if5.c deleted file mode 100644 index 2eac73b..0000000 --- a/gcc/testsuite/gcc.dg/cpp-if5.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Regression test: #ifdef 0 should not crash. Problem noted by - Jakub Jelinek . */ -/* { dg-do preprocess } */ - -#ifdef 0 /* { dg-error "with invalid argument" } */ -#error not seen -#endif - -#ifndef 0 /* { dg-error "with invalid argument" } */ -#else -#error not seen -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-ifparen.c b/gcc/testsuite/gcc.dg/cpp-ifparen.c deleted file mode 100644 index af7a10c..0000000 --- a/gcc/testsuite/gcc.dg/cpp-ifparen.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* { dg-do preprocess } */ - -/* These now use "!=" rather than "<" to increase chance of failure. */ -#if 16 * (1) + 4 != 20 -#error /* { dg-bogus "error" "with paren" } */ -#endif - -#if 16 * 1 + 4 != 20 -#error /* { dg-bogus "error" "without paren" } */ -#endif - -#if () /* { dg-error "expression between" "empty paren" } */ -#endif - -#if (1) == 1 -#error /* { dg-error "error" "simple parens no. 1" } */ -#endif - -#if (2) -#error /* { dg-error "error" "simple parens no. 2" } */ -#endif - -#if 3 == (3) -#error /* { dg-error "error" "simple parens no. 3" } */ -#endif - -#if (((-1) + 8)) == ((+2) * ((3)) - -1) -#error /* { dg-error "error" "nested parentheses" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-li1.c b/gcc/testsuite/gcc.dg/cpp-li1.c deleted file mode 100644 index 7bc6561..0000000 --- a/gcc/testsuite/gcc.dg/cpp-li1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation. - - by Alexandre Oliva */ - -/* { dg-do preprocess } */ - -/* The line number below must be just a few lines greater than the - actual line number. */ -#line 10 "baz" -wibble - -/* - { dg-final { if \{ [grep cpp-li1.i baz] != "" \} \{ } } - { dg-final { pass "cpp-li1.i: #line directive optimization" } } - { dg-final { \} else \{ } } - { dg-final { fail "cpp-li1.i: #line directive optimization" } } - { dg-final { \} } } -*/ diff --git a/gcc/testsuite/gcc.dg/cpp-li2.c b/gcc/testsuite/gcc.dg/cpp-li2.c deleted file mode 100644 index 5ee0e04..0000000 --- a/gcc/testsuite/gcc.dg/cpp-li2.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation. - - by Alexandre Oliva */ - -/* { dg-do preprocess } */ - -#line 1 -#line 0 -#line 2 -#line 32768 - -/* { dg-error "out of range" "line # too low" { target *-*-* } 1 } */ -/* { dg-error "out of range" "line # too high" { target *-*-* } 2 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-mi.c b/gcc/testsuite/gcc.dg/cpp-mi.c deleted file mode 100644 index 0584a62..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Test "ignore redundant include" facility. - We must test with C and C++ comments outside the guard conditional; - also, we test guarding with #ifndef and #if !defined. - -H is used because cpp might confuse the issue by optimizing out - #line markers. This test only passes if each of the headers is - read exactly once. - - The disgusting regexp in the dg-error line, when stuck into - dg.exp's compiler-output regexp, matches the correct -H output and - only the correct -H output. It has to be all on one line because - otherwise it will not be interpreted all in one unit. */ - -/* { dg-do compile } - { dg-options "-H" } - { dg-error "mic\.h\n\[^\n\]*micc\.h\n\[^\n\]*mind\.h\n\[^\n\]*mindp\.h\n\[^\n\]*mix\.h" "redundant include check" { target *-*-* } 0 } */ - -#include "cpp-mic.h" -#include "cpp-mic.h" - -#include "cpp-micc.h" -#include "cpp-micc.h" - -#include "cpp-mind.h" -#include "cpp-mind.h" - -#include "cpp-mindp.h" -#include "cpp-mindp.h" - -#define CPP_MIX_H -#include "cpp-mix.h" -#include "cpp-mix.h" - -int -main (void) -{ - return a + b + c + d; -} diff --git a/gcc/testsuite/gcc.dg/cpp-mi2.c b/gcc/testsuite/gcc.dg/cpp-mi2.c deleted file mode 100644 index d5c814c..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi2.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Test for overly eager multiple include optimization. - Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. - Problem noted by Tom Tromey . */ -/* { dg-do compile } */ - -#include "cpp-mi2a.h" -#include "cpp-mi2b.h" - -int main (void) -{ - return x; -} diff --git a/gcc/testsuite/gcc.dg/cpp-mi2a.h b/gcc/testsuite/gcc.dg/cpp-mi2a.h deleted file mode 100644 index c86838c..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi2a.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Test for overly eager multiple include optimization. - Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. - Problem noted by Tom Tromey . */ - -#include "cpp-mi2c.h" diff --git a/gcc/testsuite/gcc.dg/cpp-mi2b.h b/gcc/testsuite/gcc.dg/cpp-mi2b.h deleted file mode 100644 index 8d1970c..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi2b.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Test for overly eager multiple include optimization. - Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. - Problem noted by Tom Tromey . */ - -#define need_x -#include "cpp-mi2c.h" diff --git a/gcc/testsuite/gcc.dg/cpp-mi2c.h b/gcc/testsuite/gcc.dg/cpp-mi2c.h deleted file mode 100644 index 521792b..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi2c.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Test for overly eager multiple include optimization. - Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. - Problem noted by Tom Tromey . */ -#ifdef need_x -#undef need_x -#ifndef have_x -#define have_x -extern int x; -#endif -#endif - -#ifndef t_h -#define t_h -extern int y; -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-mi3.c b/gcc/testsuite/gcc.dg/cpp-mi3.c deleted file mode 100644 index 6055684..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi3.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Another test case for over-eager multiple include optimization. - This one distilled from glibc's setlocale.c and categories.def. */ -/* { dg-do compile } */ - -#define X a -#include "cpp-mi3.def" -#undef X - -#define X b -#include "cpp-mi3.def" -#undef X - -int -main(void) -{ - return a + b; -} diff --git a/gcc/testsuite/gcc.dg/cpp-mi3.def b/gcc/testsuite/gcc.dg/cpp-mi3.def deleted file mode 100644 index 375d9c7..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mi3.def +++ /dev/null @@ -1,10 +0,0 @@ -/* Another test case for over-eager multiple include optimization. - This one distilled from glibc's setlocale.c and categories.def. - The #ifdef block doesn't cover the entire file, so it must not be - taken for a reinclude guard. */ - -#ifndef NO_POSTLOAD -#define NO_POSTLOAD NULL -#endif - -int X; diff --git a/gcc/testsuite/gcc.dg/cpp-mic.h b/gcc/testsuite/gcc.dg/cpp-mic.h deleted file mode 100644 index bae9d8b..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mic.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Redundant header include test with C comments at top. */ - -#ifndef CPP_MIC_H -#define CPP_MIC_H - -int a; - -#endif - -/* And at the end too! */ diff --git a/gcc/testsuite/gcc.dg/cpp-micc.h b/gcc/testsuite/gcc.dg/cpp-micc.h deleted file mode 100644 index 46a38cd..0000000 --- a/gcc/testsuite/gcc.dg/cpp-micc.h +++ /dev/null @@ -1,10 +0,0 @@ -// Redundant header include test with C comments at top. - -#ifndef CPP_MICC_H -#define CPP_MICC_H - -int b; - -#endif - -// And at the end too! diff --git a/gcc/testsuite/gcc.dg/cpp-mind.h b/gcc/testsuite/gcc.dg/cpp-mind.h deleted file mode 100644 index c14c1a3..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mind.h +++ /dev/null @@ -1,8 +0,0 @@ -/* Redundant include check with #if !defined. */ - -#if !defined CPP_MIND_H -#define CPP_MIND_H - -int c; - -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-mindp.h b/gcc/testsuite/gcc.dg/cpp-mindp.h deleted file mode 100644 index b84202c..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mindp.h +++ /dev/null @@ -1,7 +0,0 @@ -#if !defined ( CPP_MINDP_H) -#define CPP_MINDP_H - -/* Redundant include check with #if !defined and parentheses. */ -int d; - -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-missingop.c b/gcc/testsuite/gcc.dg/cpp-missingop.c deleted file mode 100644 index 66270da..0000000 --- a/gcc/testsuite/gcc.dg/cpp-missingop.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* { dg-do preprocess } */ - -/* Various illegal expressions with missing components. */ - -#if /* { dg-error "no expression" "empty #if" } */ -#endif - -#if ~ /* { dg-error "no right op" "no unary operand" } */ -#endif - -#if 3 + * 6 + 4 /* { dg-error "no left op" "no left operand" } */ -#endif - -#if 2 ~2 /* { dg-error "missing bin" "no binary operator" } */ -#endif - -#if 1 + 2 (3) /* { dg-error "missing bin" "immediate then open paren" } */ -#endif - -#if (2) 4 * 2 /* { dg-error "missing bin" "close paren then immediate" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-missingparen.c b/gcc/testsuite/gcc.dg/cpp-missingparen.c deleted file mode 100644 index b57b5d1..0000000 --- a/gcc/testsuite/gcc.dg/cpp-missingparen.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* Test various combinations of missing parentheses give the correct - missing parenthesis message. */ - -/* { dg-do preprocess } */ - -#if (1 /* { dg-error "missing '\\)'" "missing ')' no. 1" } */ -#endif - -#if 2 * (3 + 4 /* { dg-error "missing '\\)'" "missing ')' no. 2" } */ -#endif - -#if (2)) /* { dg-error "missing '\\('" "missing '(' no. 1" } */ -#endif - -#if ) /* { dg-error "missing '\\('" "missing '(' no. 2" } */ -#endif - -#if 4) /* { dg-error "missing '\\('" "missing '(' no. 3" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-mix.h b/gcc/testsuite/gcc.dg/cpp-mix.h deleted file mode 100644 index ce0e764..0000000 --- a/gcc/testsuite/gcc.dg/cpp-mix.h +++ /dev/null @@ -1,9 +0,0 @@ -/* This header is never to have its contents visible, but it should - still receive the optimization. */ - -#ifndef CPP_MIX_H -#define CPP_MIX_H - -#define main wibble - -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-opprec.c b/gcc/testsuite/gcc.dg/cpp-opprec.c deleted file mode 100644 index 3f06cd6..0000000 --- a/gcc/testsuite/gcc.dg/cpp-opprec.c +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* Test the full range of preprocessor operator precedence. Each - operator is tested with one of immediately higher precedence to - verify it is of strictly lower precedence. To avoid complications, - each test uses just those two operators. Occasionally this assumes - correct operation of if-then-else, so the first tests verify this. */ - -/* { dg-do preprocess } */ - -/* Ensure correct functioning of if-then-else. */ -#if 1 -#else -#error #else block evaluated for true conditional -#endif - -#if 0 -#error #if block evaluated for false conditional -#else -#endif - -/* , not higher than ?. This is not a syntax error if it is. */ -#if 1 ? 0, 1: 1 /* { dg-error "syntax" "? higher precedence than ," } */ -#error -#endif - -/* : strictly higher than ?. This would give a syntax error otherwise. */ -#if 0 ? 0 : 1 ? 1 : 1 -#endif - -/* || strictly higher than ?:. */ -#if 1 ? 0: 0 || 1 -#error operator ?: has higher precedence than operator || -#endif - -/* && strictly higher than ||. */ -#if 1 || 0 && 0 -#else -#error operator || has higher precedence than operator && -#endif - -/* | strictly higher than &&. */ -#if 0 && 0 | 1 -#error operator && has higher precedence than operator | -#endif - -/* ^ strictly higher than |. */ -#if 1 | 0 ^ 1 -#else -#error operator | has higher precedence than operator ^ -#endif - -/* & strictly higher than ^. */ -#if 1 ^ 0 & 0 -#else -#error operator ^ has higher precedence than operator & -#endif - -/* == (!=) strictly higher than &. */ -#if 0 & 0 == 0 -#error operator & has higher precedence than operator == -#endif - -/* < (>, <=, >=) strictly higher than == (!=). */ - -#if 0 == 0 < 0 -#else -#error operator == has higher precedence than operator < -#endif - -/* << (>>) strictly higher than < (>, <=, >=). */ -#if 1 < 1 << 1 -#else -#error operator < has higher precedence than operator << -#endif - -/* Binary + (-) strictly higher than << (>>). */ -#if 0 << 0 + 1 -#error operator << has higher precedence than binary + -#endif - -/* Binary * (/, %) strictly higher than binary + (-). */ -#if 1 + 0 * 0 -#else -#error binary + has higher precedence than binary * -#endif - -/* Unary operators (!, ~, -, +) strictly higher than binary * (/, %). - Equality is hard to detect because of right-associativity. */ -#if ~1 * 0 -#error binary * has higher precedence than operator ~ -#endif - -/* () > Unary. Unfortunately this requires an additional operator. */ -#if -(1 - 1) -#error unary - has higher precedence than operator () -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-redef-2.c b/gcc/testsuite/gcc.dg/cpp-redef-2.c deleted file mode 100644 index 0dacf07..0000000 --- a/gcc/testsuite/gcc.dg/cpp-redef-2.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Test for redefining macros with significant differences. */ - -/* { dg-do preprocess } - { dg-options "-ansi -pedantic -Wall -fno-show-column" } */ - -#define mac(a, b) (a) + (b) -#define mac(a, b) (a) * (b) -#define mac(a, b) (a) * (x) -#define mac(a, g) (a) * (x) - -#define ro(x) foo x bar -#define ro(x, b) foo x bar - -#define va(a...) a -#define va(...) __VA_ARGS__ - -/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 } - { dg-warning "redefined" "redef mac" { target *-*-* } 8 } - { dg-warning "redefined" "redef mac" { target *-*-* } 9 } - { dg-warning "redefined" "redef ro" { target *-*-* } 12 } - { dg-warning "redefined" "redef va" { target *-*-* } 15 } - - { dg-warning "previous" "prev def mac" { target *-*-* } 6 } - { dg-warning "previous" "prev def mac" { target *-*-* } 7 } - { dg-warning "previous" "prev def mac" { target *-*-* } 8 } - { dg-warning "previous" "prev def ro" { target *-*-* } 11 } - { dg-warning "previous" "prev def va" { target *-*-* } 14 } - - { dg-warning "varargs" "named varargs" { target *-*-* } 14 } - { dg-warning "varargs" "anon varargs" { target *-*-* } 15 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-redef.c b/gcc/testsuite/gcc.dg/cpp-redef.c deleted file mode 100644 index a5fe2ba..0000000 --- a/gcc/testsuite/gcc.dg/cpp-redef.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Test for redefining macros with insignificant (i.e. whitespace) - differences. */ - -/* { dg-do preprocess } */ - -#define foo bar -#define /* x */ foo /* x */ bar /* x */ - -#define quux(thud) a one and a thud and a two -#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two -#define quux(thud) a one and a thud and a two /* bah */ - -/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 7 } */ -/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 10 } */ -/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */ - -/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 6 } */ -/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 9 } */ -/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-shift.c b/gcc/testsuite/gcc.dg/cpp-shift.c deleted file mode 100644 index a55420a..0000000 --- a/gcc/testsuite/gcc.dg/cpp-shift.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* { dg-do preprocess } */ - -/* Test shift operators. */ - -#if 1 << 4 != 16 -#error /* { dg-bogus "error" "<< +ve shift" } */ -#endif - -#if 19 >> 2 != 4 -#error /* { dg-bogus "error" ">> +ve shift" } */ -#endif - -#if 17 << -2 != 17 >> 2 -#error /* { dg-bogus "error" "<< -ve shift" } */ -#endif - -#if 25 >> -2 != 25 << 2 -#error /* { dg-bogus "error" ">> -ve shift" } */ -#endif - diff --git a/gcc/testsuite/gcc.dg/cpp-shortcircuit.c b/gcc/testsuite/gcc.dg/cpp-shortcircuit.c deleted file mode 100644 index 1607669..0000000 --- a/gcc/testsuite/gcc.dg/cpp-shortcircuit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* { dg-do preprocess } */ - -/* Test that all operators correctly short circuit. */ - -#if (2 || 3 / 0) != 1 -#error /* { dg-bogus "error" "|| short circuit" } */ -#endif - -#if 0 && 3 / 0 -#error /* { dg-bogus "error" "&& short circuit" } */ -#endif - -#if 1 ? 0 : 3 / 0 -#error /* { dg-bogus "error" "? : right short circuit" } */ -#endif - -#if 0 ? 3 / 0 : 2 -#else -#error /* { dg-bogus "error" "? : left short circuit" } */ -#endif - -#if -1 ? 0 && 3 / 0 : 3 / 0 + 5 == 5 -#error /* { dg-bogus "error" "nested short circuiting" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-tradpaste.c b/gcc/testsuite/gcc.dg/cpp-tradpaste.c deleted file mode 100644 index ac8a47b..0000000 --- a/gcc/testsuite/gcc.dg/cpp-tradpaste.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Test for proper comment elimination semantics from cpplib's -traditional. - This should compile and link with compiled with `gcc -traditional-cpp'. - Test case by Jason R. Thorpe . */ - -/* { dg-do compile } */ -/* { dg-options "-traditional" } */ - -#define A(name) X/**/name - -#define B(name) \ -void A(Y/**/name)() { A(name)(); } - -void Xhello() { printf("hello world\n"); } - -B(hello) - -int main() { XYhello(); return (0); } diff --git a/gcc/testsuite/gcc.dg/cpp-tradstringify.c b/gcc/testsuite/gcc.dg/cpp-tradstringify.c deleted file mode 100644 index 3a568ce..0000000 --- a/gcc/testsuite/gcc.dg/cpp-tradstringify.c +++ /dev/null @@ -1,4 +0,0 @@ -/* Test whether traditional stringify works. */ -/* { dg-do preprocess } */ -/* { dg-options "-traditional" } */ -#define foo(a, b) c="a"; d="b"; diff --git a/gcc/testsuite/gcc.dg/cpp-tradwarn1.c b/gcc/testsuite/gcc.dg/cpp-tradwarn1.c deleted file mode 100644 index f96e1bc..0000000 --- a/gcc/testsuite/gcc.dg/cpp-tradwarn1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Test for warnings about nontraditional directives. */ -/* { dg-do preprocess } */ -/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */ - -/* Block 1: K+R directives should have the # indented. */ - -#define foo bar /* { dg-bogus "indented" "^#kandr" } */ -# define foo bar /* { dg-bogus "indented" "^# kandr" } */ - #define foo bar /* { dg-warning "indented" "^ #kandr" } */ - # define foo bar /* { dg-warning "indented" "^ # kandr" } */ - -/* Block 2: C89 directives should not have the # indented. */ - -#pragma whatever /* { dg-warning "indented" "^#c89" } */ -# pragma whatever /* { dg-warning "indented" "^# c89" } */ - #pragma whatever /* { dg-bogus "indented" "^ #c89" } */ - # pragma whatever /* { dg-bogus "indented" "^ # c89" } */ - -/* Block 3: Extensions should not have the # indented, - _and_ they should get a -pedantic warning. */ - -#assert foo(bar) /* { dg-warning "indented" "^#ext" } */ -# assert bar(baz) /* { dg-warning "indented" "^# ext" } */ - #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */ - # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */ - -/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 22 } */ -/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 23 } */ -/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 24 } */ -/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 25 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-tradwarn2.c b/gcc/testsuite/gcc.dg/cpp-tradwarn2.c deleted file mode 100644 index 303b0ff..0000000 --- a/gcc/testsuite/gcc.dg/cpp-tradwarn2.c +++ /dev/null @@ -1,14 +0,0 @@ -/* K+R rejects use of function-like macros in non-function context. - ANSI C explicitly permits this (the macro is not expanded). */ - -/* { dg-do compile } */ -/* { dg-options -Wtraditional } */ - -enum { SIGN_EXTEND = 23 }; - -#define SIGN_EXTEND(v) (((v) < 0) ? -1 : 0) - -int fun(void) -{ - return SIGN_EXTEND; /* { dg-warning "must be used with arguments" } */ -} diff --git a/gcc/testsuite/gcc.dg/cpp-unary.c b/gcc/testsuite/gcc.dg/cpp-unary.c deleted file mode 100644 index f5442af..0000000 --- a/gcc/testsuite/gcc.dg/cpp-unary.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ - -/* { dg-do preprocess } */ - -/* Test the various unary operators. */ - -#if 1 + + + 1 /* allow multiple unary sign operators :) */ -#endif - -#if 8 - +3 != +4 + +1 -#error /* { dg-bogus "error" "unary +" } */ -#endif - -#if -2 - -1 != -1 -#error /* { dg-bogus "error" "unary -" } */ -#endif - -#if ~0 != -1 -#error /* { dg-bogus "error" "unary ~" } */ -#endif - -#if !0 && (!1 == 0) && !!1 != 1 -#error /* { dg-bogus "error" "unary !" } */ -#endif - -#if ~~8 != 8 -#error /* { dg-bogus "error" "double unary ~" } */ -#endif - -#if 5 + +!-4 != 5 -#error /* { dg-bogus "error" "compound unary +, !, -" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-unc.c b/gcc/testsuite/gcc.dg/cpp-unc.c deleted file mode 100644 index ba5c221..0000000 --- a/gcc/testsuite/gcc.dg/cpp-unc.c +++ /dev/null @@ -1,40 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-fno-show-column" } */ - -/* Tests for un-terminated conditional diagnostics. - Copyright (c) 1999 Free Software Foundation. - Contributed by Zack Weinberg, who made it up all by himself. */ - -#endif /* { dg-error "#endif" "#endif without #if" } */ - -#else /* { dg-error "#else" "#else without #if" } */ -#endif /* { dg-error "#endif" "#endif after #else without #if" } */ - -#elif 0 /* { dg-error "#elif" "#elif without #if" } */ -#endif /* { dg-error "#endif" "#endif after #else without #if" } */ - -#if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */ -blah -#endif - -#if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */ -ignored -#endif - -/* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */ -#if 0 -#include "cpp-unc1.c" -#endif - -/* The ifdef below should not get an error just because there's a bad if - inside the included file. - The odd dg-error tag on the include matches the "In file included from" - message. */ -#define FOO -#ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */ -#include "cpp-unc1.c" /* { dg-error "" } */ -#endif - -/* dg.exp doesn't read the included files for tags, so we have to - do them explicitly here. */ -/* { dg-error "#if" "unc1.h: unterminated #if" { target *-*-* } 3 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-unc1.c b/gcc/testsuite/gcc.dg/cpp-unc1.c deleted file mode 100644 index 5059ae6..0000000 --- a/gcc/testsuite/gcc.dg/cpp-unc1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Tests for un-terminated conditionals: 1. */ - -#if 1 /* { dg-error "unterminated" "unterminated #if" } */ - -#ifdef notdef /* { dg-bogus "unterminated" "nested terminated #ifdef" } */ - -blah blah blah - -#endif - -more text - -/* oops! */ diff --git a/gcc/testsuite/gcc.dg/cpp-unc2.c b/gcc/testsuite/gcc.dg/cpp-unc2.c deleted file mode 100644 index d9e3959..0000000 --- a/gcc/testsuite/gcc.dg/cpp-unc2.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Tests for unterminated conditionals: 2. */ - -#ifdef __sparc__ /* { dg-error "unterminated" "unterminated if-elif-elif..." } */ -sparc -#elif defined __powerpc__ -ppc -#elif defined __i386__ -i386 -#elif defined __vax__ -vax - diff --git a/gcc/testsuite/gcc.dg/cpp-unc3.c b/gcc/testsuite/gcc.dg/cpp-unc3.c deleted file mode 100644 index 9a16bb3..0000000 --- a/gcc/testsuite/gcc.dg/cpp-unc3.c +++ /dev/null @@ -1,4 +0,0 @@ -/* Tests for unterminated conditionals: 3. */ - -#if 1 /* { dg-error "#else" "unterminated #else" } */ -#else diff --git a/gcc/testsuite/gcc.dg/cpp-wi1.c b/gcc/testsuite/gcc.dg/cpp-wi1.c deleted file mode 100644 index 837efad..0000000 --- a/gcc/testsuite/gcc.dg/cpp-wi1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation. - - by Alexandre Oliva */ - -/* { dg-do preprocess } */ - -#line 1 L"foo" /* { dg-error "not a string" "wide string in #line" } */ -#include L"stdio.h" /* { dg-error "expects" "wide string in #include" } */ -#pragma implementation L"test.h" /* { dg-error "malformed" "wide string in #pragma implementation" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/19921210-1.c b/gcc/testsuite/gcc.dg/cpp/19921210-1.c new file mode 100644 index 0000000..32d2a81 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19921210-1.c @@ -0,0 +1,13 @@ +/* Test for proper disabling of macros within their own expansions. */ +/* { dg-do compile } */ + +/* The following is a trick to evaluate a complex boolean expression + at compile time, inspired by autoconf 2.13's sizeof-detection. */ + +enum { a = 4, f = 3 }; + +#define a1(y) (y+2) +#define a2(y) a1(y)+1 +#define f a+f + +char array[(a2(f)) == 10 ? 1 : -1]; diff --git a/gcc/testsuite/gcc.dg/cpp/19990119-1.c b/gcc/testsuite/gcc.dg/cpp/19990119-1.c new file mode 100644 index 0000000..10a7baa --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19990119-1.c @@ -0,0 +1,9 @@ +/* This checks for two things: + - an obscure corner case in the standard rules for __LINE__ + - regression of an associated bug in cpplib where the semicolon got lost */ +/* { dg-do compile } */ + +enum { i = __LINE__\ +}; + +char array[i == 6 ? 1 : -1]; diff --git a/gcc/testsuite/gcc.dg/cpp/19990228-1.c b/gcc/testsuite/gcc.dg/cpp/19990228-1.c new file mode 100644 index 0000000..4b846ea --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19990228-1.c @@ -0,0 +1,29 @@ +/* Regression test for cpp. The following input may cause core dumps + or # line markers in the middle of the line. */ +/* { dg-do preprocess } */ + +#define foo(string, arg) bar(2, string, arg) + +foo ("\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +", +NULL); + +/* + { dg-final { if ![file exists 990228-1.i] { return } } } + { dg-final { set tmp [grep 990228-1.i ".#"] } } + { dg-final { if { [string length $tmp] == 0 } \{ } } + { dg-final { pass "990228-1.c: linemarkers in middle of line" } } + { dg-final { \} else \{ } } + { dg-final { fail "990228-1.c: linemarkers in middle of line" } } + { dg-final { \} } } + */ diff --git a/gcc/testsuite/gcc.dg/cpp/19990407-1.c b/gcc/testsuite/gcc.dg/cpp/19990407-1.c new file mode 100644 index 0000000..d6da8d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19990407-1.c @@ -0,0 +1,19 @@ +/* Regression test for a cpplib macro-expansion bug where + `@' becomes `@@' when stringified. */ + +/* { dg-do run } */ + +#include +#include + +#define STR(x) #x + +char *a = STR(@foo), *b = "@foo"; + +int +main(void) +{ + if (strcmp (a, b)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/19990409-1.c b/gcc/testsuite/gcc.dg/cpp/19990409-1.c new file mode 100644 index 0000000..d7f5e28 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19990409-1.c @@ -0,0 +1,6 @@ +/* Test that __LINE__ works when embedded in a macro. */ +/* { dg-do compile } */ + +#define XLINE __LINE__ + +char array[XLINE == __LINE__ ? 1 : -1]; diff --git a/gcc/testsuite/gcc.dg/cpp/19990413-1.c b/gcc/testsuite/gcc.dg/cpp/19990413-1.c new file mode 100644 index 0000000..9abddb9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19990413-1.c @@ -0,0 +1,13 @@ +/* Verify that cpp doesn't screw up the line numbering when a macro argument + extends over multiple lines. */ +/* { dg-do compile } */ + +#define FOO(x) /* nothing */ + +void +func(void) +{ + FOO(i + = 4) + else; /* { dg-error "parse error" "error on this line" { target *-*-* } { 12 } } */ +} diff --git a/gcc/testsuite/gcc.dg/cpp/19990703-1.c b/gcc/testsuite/gcc.dg/cpp/19990703-1.c new file mode 100644 index 0000000..88dc9e6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/19990703-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ + +/* Test of obscure case in token pasting in the preprocessor. + I can't think of any way to make this problem provoke a syntax error. + Based on a bug report by Manfred Hollstein. */ + +#include + +#define SP1(x, y) SP2(x, y) +#define SP2(x, y) SP3(x##y) +#define SP3(x) #x +#define MZ -0 + +int +main(void) +{ + char *x = SP1(0,MZ); + char *y = "0-0"; /* should be the expansion of SP1(0,MZ) */ + + if(strcmp(x, y)) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/20000127-1.c b/gcc/testsuite/gcc.dg/cpp/20000127-1.c new file mode 100644 index 0000000..467ad2c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000127-1.c @@ -0,0 +1,139 @@ +/* { dg-do compile } */ + +/* Test for core dump in the preprocessor. Originally exposed by + XEmacs, but this has been synthesized from scratch. */ + +#define foo(bar) bar + +int x = +foo( + /* + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + + */ + 2); diff --git a/gcc/testsuite/gcc.dg/cpp/20000129-1.c b/gcc/testsuite/gcc.dg/cpp/20000129-1.c new file mode 100644 index 0000000..878002b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000129-1.c @@ -0,0 +1,15 @@ +/* Regression test for trigraph warnings. Under certain conditions we + got the line numbers wrong. + Originally exposed by XEmacs and reported by Martin Buchholz + ; this test case is synthetic. */ + +/* { dg-do preprocess } */ +/* { dg-options -Wall } */ + +#define some_macro \ + blah \ + blah \ + blah \ + blah + +??> /* { dg-warning "trigraph ..." "trigraph encountered" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/20000207-1.c b/gcc/testsuite/gcc.dg/cpp/20000207-1.c new file mode 100644 index 0000000..931cc0d --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000207-1.c @@ -0,0 +1,16 @@ +/* { dg-do preprocess } */ + +/* Test for proper handling of unary minus in #if. */ + +#if !(-1) +#error Error /* { dg-bogus "Error" "case !(-1)" } */ +#endif + +#if !-1 +#error Error /* { dg-bogus "Error" "case !-1" } */ +#endif + +#if -1 +#else +#error Error /* { dg-bogus "Error" "case -1" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/20000207-2.c b/gcc/testsuite/gcc.dg/cpp/20000207-2.c new file mode 100644 index 0000000..fbdf39e --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000207-2.c @@ -0,0 +1,16 @@ +/* { dg-do preprocess } */ + +/* Test for proper handling of unary plus in #if. */ + +#if !(+1) +#error Error /* { dg-bogus "Error" "case !(+1)" } */ +#endif + +#if !+1 +#error Error /* { dg-bogus "Error" "case !+1" } */ +#endif + +#if +1 +#else +#error Error /* { dg-bogus "Error" "case +1" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/20000209-1.c b/gcc/testsuite/gcc.dg/cpp/20000209-1.c new file mode 100644 index 0000000..fe71058 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000209-1.c @@ -0,0 +1,34 @@ +/* { dg-do preprocess } */ + +/* Tests for line numbering around function-like macro calls. + Bug found by Mark Mitchell. */ + +#define f(x) x +#define g f + +f (3); +#error here /* { dg-error "here" "case 0" } */ + +f + (3); +#error here /* { dg-error "here" "case 1" } */ + +(f + )(3); +#error here /* { dg-error "here" "case 2" } */ + +g + (3); +#error here /* { dg-error "here" "case 3" } */ + +(g + )(3); +#error here /* { dg-error "here" "case 4" } */ + +f /* some + text */ (3); +#error here /* { dg-error "here" "case 5" } */ + +(g /* some + text */ )(3); +#error here /* { dg-error "here" "case 6" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/20000209-2.c b/gcc/testsuite/gcc.dg/cpp/20000209-2.c new file mode 100644 index 0000000..6a9198f --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000209-2.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-Wall" } */ +/* Distilled from glibc sources. Tests preprocessor corner cases. + Since it uses rest args, we must turn off -pedantic-errors. */ + +#define NO_PAREN(rest...) rest +#define DEFINE_CATEGORY(category, items) \ +const int _nl_value_type_##category[] = { NO_PAREN items } + +DEFINE_CATEGORY +( + LC_COLLATE, + ( + 1, + 2, + 3, + )); + +DEFINE_CATEGORY(LC_CTYPE, (1, 2, 3)); diff --git a/gcc/testsuite/gcc.dg/cpp/20000301-1.c b/gcc/testsuite/gcc.dg/cpp/20000301-1.c new file mode 100644 index 0000000..85645b0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000301-1.c @@ -0,0 +1,3 @@ +/* { dg-do preprocess } */ +/* Test for crash with indented empty definitions. */ + #define _LIBC_LIMITS_H_ /* nothing */ diff --git a/gcc/testsuite/gcc.dg/cpp/20000419-1.c b/gcc/testsuite/gcc.dg/cpp/20000419-1.c new file mode 100644 index 0000000..c4400ee --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000419-1.c @@ -0,0 +1,15 @@ +/* Test for erroneous deletion of the entire macro expansion when pruning + \r escapes. Problem noted by DJ Delorie ; test case + distilled from GNU libc header files. */ +/* { dg-do preprocess } */ + +#define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) +#define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +#define __ASMNAME2(prefix, cname) __STRING (prefix) cname +#define __STRING(x) #x + +__REDIRECT (a, b, c) +__ASMNAME2 (__USER_LABEL_PREFIX__, harumph) + +/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 11 } */ +/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 12 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/20000510-1.S b/gcc/testsuite/gcc.dg/cpp/20000510-1.S new file mode 100644 index 0000000..7d6508b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000510-1.S @@ -0,0 +1,20 @@ +/* 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/20000519-1.c b/gcc/testsuite/gcc.dg/cpp/20000519-1.c new file mode 100644 index 0000000..82ab3a2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000519-1.c @@ -0,0 +1,10 @@ +/* Regression test for preprocessor crash. + Reported by Mathias Froehlich . */ +/* { dg-do preprocess } */ +#define foo + +#define __CAT__(a,b,c,d) a##b##c##d +#define CAT(a,b,c,d) __CAT__(a,b,c,d) + +#define bar CAT(,foo,bar,) +bar diff --git a/gcc/testsuite/gcc.dg/cpp/20000529-1.c b/gcc/testsuite/gcc.dg/cpp/20000529-1.c new file mode 100644 index 0000000..6343a81 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000529-1.c @@ -0,0 +1,14 @@ +/* Regression test for bug with macro expansion on #if lines - + exposed by glibc. */ +/* { dg-do compile } */ + +# define SHLIB_COMPAT(lib, introduced, obsoleted) \ + (!(ABI_##lib##_##obsoleted - 0) \ + || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))) + +#if 0 +bad +#elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) +int +#endif +x; diff --git a/gcc/testsuite/gcc.dg/cpp/20000625-1.c b/gcc/testsuite/gcc.dg/cpp/20000625-1.c new file mode 100644 index 0000000..9193e39 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000625-1.c @@ -0,0 +1,16 @@ +/* Regression test for paste corner cases. Distilled from + syscall stub logic in glibc. */ + +/* { dg-do compile } */ + +#define ENTRY(name) name##: +#define socket bind + +int +main(void) +{ + goto socket; + + ENTRY(socket) + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/20000625-2.c b/gcc/testsuite/gcc.dg/cpp/20000625-2.c new file mode 100644 index 0000000..e983450 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000625-2.c @@ -0,0 +1,27 @@ +/* More paste corner cases from glibc. */ +/* { dg-do run } */ + +#define symbol_version(name, version) name##@##version + +#define str(x) xstr(x) +#define xstr(x) #x + +const char a[] = str(symbol_version(getrlimit, GLIBC_2.0)); +const char b[] = str(getrlimit@GLIBC_2.0); +const char c[] = "getrlimit@GLIBC_2.0"; + +#include +#include + +int +main(void) +{ + if(strcmp(a, b)) + abort(); + if(strcmp(b, c)) + abort(); + if(strcmp(c, a)) + abort(); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/20000627-1.c b/gcc/testsuite/gcc.dg/cpp/20000627-1.c new file mode 100644 index 0000000..dc01732 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/20000627-1.c @@ -0,0 +1,10 @@ +/* Test for spurious warnings with backslashes in perverse locations. + Bug exposed by Plumhall. */ +/* { dg-do compile } */ + +extern int bar; + +#def\ +ine foo bar + +int main(void) { return foo; } diff --git a/gcc/testsuite/gcc.dg/cpp/assert1.c b/gcc/testsuite/gcc.dg/cpp/assert1.c new file mode 100644 index 0000000..ff7cc62 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/assert1.c @@ -0,0 +1,46 @@ +/* Basic tests of the #assert preprocessor extension. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +#define def unused expansion +#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 diff --git a/gcc/testsuite/gcc.dg/cpp/assert2.c b/gcc/testsuite/gcc.dg/cpp/assert2.c new file mode 100644 index 0000000..26d3aad --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/assert2.c @@ -0,0 +1,24 @@ +/* Malformed assertion tests. */ +/* { dg-do preprocess } */ +/* { dg-options "-fno-show-column" } */ + +#assert /* { dg-error "without predicate" "assert w/o predicate" } */ +#assert % /* { dg-error "an identifier" "assert punctuation" } */ +#assert 12 /* { dg-error "an identifier" "assert number" } */ +#assert abc /* { dg-error "missing" "assert w/o answer" } */ + +#if # /* { dg-error "without predicate" "test w/o predicate" } */ +#endif + +#if #% /* { dg-error "an identifier" "test punctuation" } */ +#endif + +#if #12 /* { dg-error "an identifier" "test number" } */ +#endif + +#if #abc +#error /* { dg-bogus "error" "test w/o answer" } */ +#endif + +#if #abc[def] /* { dg-error "invalid char" "test with malformed answer" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp new file mode 100644 index 0000000..4d50b44 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp @@ -0,0 +1,70 @@ +# Copyright (C) 1997, 2000 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gcc@prep.ai.mit.edu + +# GCC testsuite that uses the `dg.exp' driver. + +# Load support procs. +load_lib gcc-dg.exp + +# Utility for scanning compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +proc scan-assembler { testcase pattern } { + global subdir + + set fd [open [file rootname $testcase].s r] + set text [read $fd] + close $fd + + if [regexp -- $pattern $text] { + pass "$subdir/$testcase scan-assembler" + } else { + fail "$subdir/$testcase scan-assembler" + } +} + +# Call pass if pattern is not present, otherwise fail. +proc scan-assembler-not { testcase pattern } { + global subdir + + set fd [open [file rootname $testcase].s r] + set text [read $fd] + close $fd + + if ![regexp -- $pattern $text] { + pass "$subdir/$testcase scan-assembler-not" + } else { + fail "$subdir/$testcase scan-assembler-not" + } +} + +# If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -ansi -pedantic-errors" +} + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.dg/cpp/cxxcom1.c b/gcc/testsuite/gcc.dg/cpp/cxxcom1.c new file mode 100644 index 0000000..c7c51d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/cxxcom1.c @@ -0,0 +1,20 @@ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic -std=gnu89" } */ + +/* You can't do this in your own code... */ +// C++ comment is not in C89 { dg-warning "style comment|reported only once" "good warning" } + +/* ...but we don't bitch about it more than once. */ +// C++ comment is not in C89 { dg-bogus "style comment" "bad warning" } + +/* + { dg-final { if ![file exists cxx-comments-1.i] { return } } } + { dg-final { set tmp [grep cxx-comments-1.i "is not in C89" line] } } + { dg-final { # send_user "$tmp\n" } } + { dg-final { if [regexp "is not in C89" $tmp] \{ } } + { dg-final { fail "cxx-comments-1: comment strip check" } } + { dg-final { \} else \{ } } + { dg-final { pass "cxx-comments-1: comment strip check" } } + { dg-final { \} } } +*/ + diff --git a/gcc/testsuite/gcc.dg/cpp/cxxcom2.c b/gcc/testsuite/gcc.dg/cpp/cxxcom2.c new file mode 100644 index 0000000..7d0fe09 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/cxxcom2.c @@ -0,0 +1,20 @@ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic -std=c89" } */ + +/* This is an extension and therefore gets a warning. */ +#line 5 "cxx-comments-2.c" 3 /* { dg-warning "garbage at end" "#line extension" } */ + +/* A system header may contain C++ comments irrespective of mode. */ +// C++ comment is not in C89 { dg-bogus "style comment" "bad warning" } + +/* + { dg-final { if ![file exists cxx-comments-2.i] { return } } } + { dg-final { set tmp [grep cxx-comments-2.i "is not in C89" line] } } + { dg-final { # send_user "$tmp\n" } } + { dg-final { if [regexp "is not in C89" $tmp] \{ } } + { dg-final { fail "cxx-comments-2: comment strip check" } } + { dg-final { \} else \{ } } + { dg-final { pass "cxx-comments-2: comment strip check" } } + { dg-final { \} } } +*/ + diff --git a/gcc/testsuite/gcc.dg/cpp/endif.c b/gcc/testsuite/gcc.dg/cpp/endif.c new file mode 100644 index 0000000..c12662c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/endif.c @@ -0,0 +1,15 @@ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic -Wall" } */ + +/* You can't get away with this in your own code... */ +#ifdef KERNEL +#define foo +#endif KERNEL /* { dg-warning "forbids text after" "good warning" } */ + +/* This will provoke a warning because the '3' is an extension. */ +#line 10 "endif-label.c" 3 /* { dg-warning "garbage at end" "#line extension" } */ + +/* ... but in a system header, it's acceptable. */ +#ifdef KERNEL +#define foo +#endif KERNEL /* { dg-bogus "forbids text after" "bad warning" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/hash1.c b/gcc/testsuite/gcc.dg/cpp/hash1.c new file mode 100644 index 0000000..a4c4b35 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/hash1.c @@ -0,0 +1,9 @@ +/* Test for proper handling of # in object-like macros. + From Linux kernel. */ +/* { dg-do preprocess } */ + +#define FIXUP .section ".fixup",#alloc,#execinstr + +FIXUP + +/* { dg-bogus "not followed by" "object-like #" { target *-*-* } 3 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/hash2.c b/gcc/testsuite/gcc.dg/cpp/hash2.c new file mode 100644 index 0000000..4e177f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/hash2.c @@ -0,0 +1,15 @@ +/* Test for erroneously thinking comments are token-pastes. + From XFree86 4.0. */ +/* { dg-do preprocess } */ +/* { dg-options "-traditional" } */ + +#ifndef foo +#define foo /**/ +#endif + +#ifndef foo +#define foo /* as nothing */ +#endif + +/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } 7 } */ +/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/if-1.c b/gcc/testsuite/gcc.dg/cpp/if-1.c new file mode 100644 index 0000000..9b7c8d3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-1.c @@ -0,0 +1,34 @@ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic-errors" } */ + +#if 0xa != 10 +#error 0xa != 10 /* { dg-bogus "#error" "normal conversion" } */ +#endif + +#if 077 != 63 +#error 077 != 63 /* { dg-bogus "#error" "normal conversion" } */ +#endif + +#if 12wrt /* { dg-error "nvalid number|missing white" "invalid number" } */ +#endif + +#if 0abc /* { dg-error "nvalid number|missing white" "invalid number" } */ +#endif + +#if 42abc /* { dg-error "nvalid number|missing white" "invalid number" } */ +#endif + +#if 1.2 /* { dg-error "loating point numbers" "floating point in #if" } */ +#endif + +#if 4uu /* { dg-error "too many 'u'" "too many suffixes" } */ +#endif + +#if 124123231lll /* { dg-error "too many 'l'" "too many suffixes" } */ +#endif + +#if 099 /* { dg-error "digits beyond the radix" "decimal in octal constant" } */ +#endif + +#if 0xfffffffffffffffff /* { dg-error "integer constant out of range" "range error" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-2.c b/gcc/testsuite/gcc.dg/cpp/if-2.c new file mode 100644 index 0000000..60e8ffd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-2.c @@ -0,0 +1,19 @@ +/* { dg-do preprocess } */ +/* { dg-options -pedantic-errors } */ + +#if 'a' != 'a' || '\001' != 1 || '\x12' != 0x12 +#error a,1,0x12 /* { dg-bogus "#error" "basic charconst recognition" } */ +#endif + +#if 'a' != L'a' || L'\xfeed' != 0xfeed +#error L'a',0xfeed /* { dg-bogus "#error" "wide charconst recognition" } */ +#endif + +#if 'abcd' /* { dg-warning "multi-character character constant" "multi-character charconst" } */ +#endif + +#if 'abcdefghi' /* { dg-error "character constant (is )?too long" "charconst too long" } */ +#endif + +#if '' /* { dg-error "empty character constant" "empty charconst" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-3.c b/gcc/testsuite/gcc.dg/cpp/if-3.c new file mode 100644 index 0000000..c46f563 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-3.c @@ -0,0 +1,25 @@ +/* Test that the preprocessor is capable of 64-bit arithmetic. + (Must turn off -pedantic, since `LL' constants are only in C9x.) */ +/* { dg-do preprocess } */ +/* { dg-options "" } */ + +#define U_MAX 4294967295U +#define ULL_MAX 18446744073709551615ULL +#define LL_MAX 9223372036854775807LL +#define LL_MIN (-LL_MAX-1) + +/* Check simple truncation. */ +#if U_MAX == ULL_MAX || LL_MIN == 0 || LL_MAX == -1 +#error "simple truncation" /* { dg-bogus "trunc" "simple truncation" } */ +#endif + +/* Check left/right shifting with all bits set and with one bit set. */ +#if !(~0ULL >> 63) || !(~0ULL << 63) || !(~0LL >> 63) || !(~0LL << 63) || \ + !(LL_MIN >> 63) || !(1LL << 62) || !(ULL_MAX >> 63) || !(1ULL << 63) +#error "bit shift truncation" /* { dg-bogus "trunc" "bit shift truncation" } */ +#endif + +/* Check math expressions. */ +#if (2ULL * U_MAX < U_MAX) || (1ULL + U_MAX < U_MAX) +#error "math truncation" /* { dg-bogus "trunc" "math truncation" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-4.c b/gcc/testsuite/gcc.dg/cpp/if-4.c new file mode 100644 index 0000000..84764fb --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-4.c @@ -0,0 +1,8 @@ +/* Regression test for proper error message. The token name isn't + NUL terminated, so we would print garbage after it. */ +/* { dg-do compile } */ + +#if 1 += 2 /* { dg-error "'\\+=' is not allowed" "+= in if" } */ +syntax_error +#endif +int foo; diff --git a/gcc/testsuite/gcc.dg/cpp/if-5.c b/gcc/testsuite/gcc.dg/cpp/if-5.c new file mode 100644 index 0000000..2eac73b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-5.c @@ -0,0 +1,12 @@ +/* Regression test: #ifdef 0 should not crash. Problem noted by + Jakub Jelinek . */ +/* { dg-do preprocess } */ + +#ifdef 0 /* { dg-error "with invalid argument" } */ +#error not seen +#endif + +#ifndef 0 /* { dg-error "with invalid argument" } */ +#else +#error not seen +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-cexp.c b/gcc/testsuite/gcc.dg/cpp/if-cexp.c new file mode 100644 index 0000000..e2af375 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-cexp.c @@ -0,0 +1,13 @@ +/* { dg-do preprocess } */ + +/* Test the ? : opearator, for precedence and both true and false. */ + +#if 1 ? 1 ? 2 : 0 : 0 +#error OK /* { dg-error "OK" "nested ? :" } */ +#endif + +#if ((0) ? (1) ? (2) : (3) : (4) ? (5): (6)) == 5 +#error OK /* { dg-error "OK" "nested ? : with parens" } */ +#endif + + diff --git a/gcc/testsuite/gcc.dg/cpp/if-mop.c b/gcc/testsuite/gcc.dg/cpp/if-mop.c new file mode 100644 index 0000000..66270da --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-mop.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* Various illegal expressions with missing components. */ + +#if /* { dg-error "no expression" "empty #if" } */ +#endif + +#if ~ /* { dg-error "no right op" "no unary operand" } */ +#endif + +#if 3 + * 6 + 4 /* { dg-error "no left op" "no left operand" } */ +#endif + +#if 2 ~2 /* { dg-error "missing bin" "no binary operator" } */ +#endif + +#if 1 + 2 (3) /* { dg-error "missing bin" "immediate then open paren" } */ +#endif + +#if (2) 4 * 2 /* { dg-error "missing bin" "close paren then immediate" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-mpar.c b/gcc/testsuite/gcc.dg/cpp/if-mpar.c new file mode 100644 index 0000000..b57b5d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-mpar.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* Test various combinations of missing parentheses give the correct + missing parenthesis message. */ + +/* { dg-do preprocess } */ + +#if (1 /* { dg-error "missing '\\)'" "missing ')' no. 1" } */ +#endif + +#if 2 * (3 + 4 /* { dg-error "missing '\\)'" "missing ')' no. 2" } */ +#endif + +#if (2)) /* { dg-error "missing '\\('" "missing '(' no. 1" } */ +#endif + +#if ) /* { dg-error "missing '\\('" "missing '(' no. 2" } */ +#endif + +#if 4) /* { dg-error "missing '\\('" "missing '(' no. 3" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-oppr.c b/gcc/testsuite/gcc.dg/cpp/if-oppr.c new file mode 100644 index 0000000..3f06cd6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-oppr.c @@ -0,0 +1,97 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* Test the full range of preprocessor operator precedence. Each + operator is tested with one of immediately higher precedence to + verify it is of strictly lower precedence. To avoid complications, + each test uses just those two operators. Occasionally this assumes + correct operation of if-then-else, so the first tests verify this. */ + +/* { dg-do preprocess } */ + +/* Ensure correct functioning of if-then-else. */ +#if 1 +#else +#error #else block evaluated for true conditional +#endif + +#if 0 +#error #if block evaluated for false conditional +#else +#endif + +/* , not higher than ?. This is not a syntax error if it is. */ +#if 1 ? 0, 1: 1 /* { dg-error "syntax" "? higher precedence than ," } */ +#error +#endif + +/* : strictly higher than ?. This would give a syntax error otherwise. */ +#if 0 ? 0 : 1 ? 1 : 1 +#endif + +/* || strictly higher than ?:. */ +#if 1 ? 0: 0 || 1 +#error operator ?: has higher precedence than operator || +#endif + +/* && strictly higher than ||. */ +#if 1 || 0 && 0 +#else +#error operator || has higher precedence than operator && +#endif + +/* | strictly higher than &&. */ +#if 0 && 0 | 1 +#error operator && has higher precedence than operator | +#endif + +/* ^ strictly higher than |. */ +#if 1 | 0 ^ 1 +#else +#error operator | has higher precedence than operator ^ +#endif + +/* & strictly higher than ^. */ +#if 1 ^ 0 & 0 +#else +#error operator ^ has higher precedence than operator & +#endif + +/* == (!=) strictly higher than &. */ +#if 0 & 0 == 0 +#error operator & has higher precedence than operator == +#endif + +/* < (>, <=, >=) strictly higher than == (!=). */ + +#if 0 == 0 < 0 +#else +#error operator == has higher precedence than operator < +#endif + +/* << (>>) strictly higher than < (>, <=, >=). */ +#if 1 < 1 << 1 +#else +#error operator < has higher precedence than operator << +#endif + +/* Binary + (-) strictly higher than << (>>). */ +#if 0 << 0 + 1 +#error operator << has higher precedence than binary + +#endif + +/* Binary * (/, %) strictly higher than binary + (-). */ +#if 1 + 0 * 0 +#else +#error binary + has higher precedence than binary * +#endif + +/* Unary operators (!, ~, -, +) strictly higher than binary * (/, %). + Equality is hard to detect because of right-associativity. */ +#if ~1 * 0 +#error binary * has higher precedence than operator ~ +#endif + +/* () > Unary. Unfortunately this requires an additional operator. */ +#if -(1 - 1) +#error unary - has higher precedence than operator () +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-paren.c b/gcc/testsuite/gcc.dg/cpp/if-paren.c new file mode 100644 index 0000000..af7a10c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-paren.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* These now use "!=" rather than "<" to increase chance of failure. */ +#if 16 * (1) + 4 != 20 +#error /* { dg-bogus "error" "with paren" } */ +#endif + +#if 16 * 1 + 4 != 20 +#error /* { dg-bogus "error" "without paren" } */ +#endif + +#if () /* { dg-error "expression between" "empty paren" } */ +#endif + +#if (1) == 1 +#error /* { dg-error "error" "simple parens no. 1" } */ +#endif + +#if (2) +#error /* { dg-error "error" "simple parens no. 2" } */ +#endif + +#if 3 == (3) +#error /* { dg-error "error" "simple parens no. 3" } */ +#endif + +#if (((-1) + 8)) == ((+2) * ((3)) - -1) +#error /* { dg-error "error" "nested parentheses" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-sc.c b/gcc/testsuite/gcc.dg/cpp/if-sc.c new file mode 100644 index 0000000..1607669 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-sc.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* Test that all operators correctly short circuit. */ + +#if (2 || 3 / 0) != 1 +#error /* { dg-bogus "error" "|| short circuit" } */ +#endif + +#if 0 && 3 / 0 +#error /* { dg-bogus "error" "&& short circuit" } */ +#endif + +#if 1 ? 0 : 3 / 0 +#error /* { dg-bogus "error" "? : right short circuit" } */ +#endif + +#if 0 ? 3 / 0 : 2 +#else +#error /* { dg-bogus "error" "? : left short circuit" } */ +#endif + +#if -1 ? 0 && 3 / 0 : 3 / 0 + 5 == 5 +#error /* { dg-bogus "error" "nested short circuiting" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-shift.c b/gcc/testsuite/gcc.dg/cpp/if-shift.c new file mode 100644 index 0000000..a55420a --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-shift.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* Test shift operators. */ + +#if 1 << 4 != 16 +#error /* { dg-bogus "error" "<< +ve shift" } */ +#endif + +#if 19 >> 2 != 4 +#error /* { dg-bogus "error" ">> +ve shift" } */ +#endif + +#if 17 << -2 != 17 >> 2 +#error /* { dg-bogus "error" "<< -ve shift" } */ +#endif + +#if 25 >> -2 != 25 << 2 +#error /* { dg-bogus "error" ">> -ve shift" } */ +#endif + diff --git a/gcc/testsuite/gcc.dg/cpp/if-unary.c b/gcc/testsuite/gcc.dg/cpp/if-unary.c new file mode 100644 index 0000000..f5442af --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-unary.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* Test the various unary operators. */ + +#if 1 + + + 1 /* allow multiple unary sign operators :) */ +#endif + +#if 8 - +3 != +4 + +1 +#error /* { dg-bogus "error" "unary +" } */ +#endif + +#if -2 - -1 != -1 +#error /* { dg-bogus "error" "unary -" } */ +#endif + +#if ~0 != -1 +#error /* { dg-bogus "error" "unary ~" } */ +#endif + +#if !0 && (!1 == 0) && !!1 != 1 +#error /* { dg-bogus "error" "unary !" } */ +#endif + +#if ~~8 != 8 +#error /* { dg-bogus "error" "double unary ~" } */ +#endif + +#if 5 + +!-4 != 5 +#error /* { dg-bogus "error" "compound unary +, !, -" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/line1.c b/gcc/testsuite/gcc.dg/cpp/line1.c new file mode 100644 index 0000000..376df9c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line1.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2000 Free Software Foundation. + + by Alexandre Oliva */ + +/* { dg-do preprocess } */ + +/* The line number below must be just a few lines greater than the + actual line number. */ +#line 10 "baz" +wibble + +/* + { dg-final { if \{ [grep line1.i baz] != "" \} \{ } } + { dg-final { pass "line1.i: #line directive optimization" } } + { dg-final { \} else \{ } } + { dg-final { fail "line1.i: #line directive optimization" } } + { dg-final { \} } } +*/ diff --git a/gcc/testsuite/gcc.dg/cpp/line2.c b/gcc/testsuite/gcc.dg/cpp/line2.c new file mode 100644 index 0000000..5ee0e04 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line2.c @@ -0,0 +1,13 @@ +/* Copyright (C) 2000 Free Software Foundation. + + by Alexandre Oliva */ + +/* { dg-do preprocess } */ + +#line 1 +#line 0 +#line 2 +#line 32768 + +/* { dg-error "out of range" "line # too low" { target *-*-* } 1 } */ +/* { dg-error "out of range" "line # too high" { target *-*-* } 2 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/line3.c b/gcc/testsuite/gcc.dg/cpp/line3.c new file mode 100644 index 0000000..dc5bf81 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line3.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-Wwrite-strings" } */ +/* The purpose of this test is to ensure that line numbers in diagnostics + are accurate after macros whose arguments contain newlines and are + substituted multiple times. The semicolons are on separate lines because + #line can only correct numbering on line boundaries. */ +#define one(x) x +#define two(x) x x +#define four(x) two(x) two(x) + +int +main(void) +{ + char *A; + + A = "text"; /* { dg-warning "discards qualifiers" "case zero" } */ + A = one("text" + "text") + ; /* { dg-warning "discards qualifiers" "case one" } */ + A = two("text" + "text") + ; /* { dg-warning "discards qualifiers" "case two" } */ + A = four("text" + "text") + ; /* { dg-warning "discards qualifiers" "case four" } */ + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/line4.c b/gcc/testsuite/gcc.dg/cpp/line4.c new file mode 100644 index 0000000..84dbf96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/line4.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +/* Test #line with and without macros for the line number. */ + +extern void abort (void); + +#define L 90 + +#line 44 +enum { i = __LINE__ }; + +#line L +enum { j = __LINE__ }; + +#line 16 /* N.B. the _next_ line is line 16. */ + +char array1[i == 44 ? 1 : -1]; +char array2[j == 90 ? 1 : -1]; +char array3[__LINE__ == 19 ? 1 : -1]; diff --git a/gcc/testsuite/gcc.dg/cpp/mi1.c b/gcc/testsuite/gcc.dg/cpp/mi1.c new file mode 100644 index 0000000..0e15c47 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi1.c @@ -0,0 +1,37 @@ +/* Test "ignore redundant include" facility. + We must test with C and C++ comments outside the guard conditional; + also, we test guarding with #ifndef and #if !defined. + -H is used because cpp mi1ght confuse the issue by optimizing out + #line markers. This test only passes if each of the headers is + read exactly once. + + The disgusting regexp in the dg-error line, when stuck into + dg.exp's compiler-output regexp, matches the correct -H output and + only the correct -H output. It has to be all on one line because + otherwise it will not be interpreted all in one unit. */ + +/* { dg-do compile } + { dg-options "-H" } + { dg-error "mi1c\.h\n\[^\n\]*mi1cc\.h\n\[^\n\]*mi1nd\.h\n\[^\n\]*mi1ndp\.h\n\[^\n\]*mi1x\.h" "redundant include check" { target *-*-* } 0 } */ + +#include "mi1c.h" +#include "mi1c.h" + +#include "mi1cc.h" +#include "mi1cc.h" + +#include "mi1nd.h" +#include "mi1nd.h" + +#include "mi1ndp.h" +#include "mi1ndp.h" + +#define MIX_H +#include "mi1x.h" +#include "mi1x.h" + +int +main (void) +{ + return a + b + c + d; +} diff --git a/gcc/testsuite/gcc.dg/cpp/mi1c.h b/gcc/testsuite/gcc.dg/cpp/mi1c.h new file mode 100644 index 0000000..bae9d8b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi1c.h @@ -0,0 +1,10 @@ +/* Redundant header include test with C comments at top. */ + +#ifndef CPP_MIC_H +#define CPP_MIC_H + +int a; + +#endif + +/* And at the end too! */ diff --git a/gcc/testsuite/gcc.dg/cpp/mi1cc.h b/gcc/testsuite/gcc.dg/cpp/mi1cc.h new file mode 100644 index 0000000..46a38cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi1cc.h @@ -0,0 +1,10 @@ +// Redundant header include test with C comments at top. + +#ifndef CPP_MICC_H +#define CPP_MICC_H + +int b; + +#endif + +// And at the end too! diff --git a/gcc/testsuite/gcc.dg/cpp/mi1nd.h b/gcc/testsuite/gcc.dg/cpp/mi1nd.h new file mode 100644 index 0000000..c14c1a3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi1nd.h @@ -0,0 +1,8 @@ +/* Redundant include check with #if !defined. */ + +#if !defined CPP_MIND_H +#define CPP_MIND_H + +int c; + +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/mi1ndp.h b/gcc/testsuite/gcc.dg/cpp/mi1ndp.h new file mode 100644 index 0000000..b84202c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi1ndp.h @@ -0,0 +1,7 @@ +#if !defined ( CPP_MINDP_H) +#define CPP_MINDP_H + +/* Redundant include check with #if !defined and parentheses. */ +int d; + +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/mi1x.h b/gcc/testsuite/gcc.dg/cpp/mi1x.h new file mode 100644 index 0000000..a317cf8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi1x.h @@ -0,0 +1,9 @@ +/* This header is never to have its contents visible, but it should + still receive the optimization. */ + +#ifndef MIX_H +#define MIX_H + +#define main wibble + +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/mi2.c b/gcc/testsuite/gcc.dg/cpp/mi2.c new file mode 100644 index 0000000..916d5a9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi2.c @@ -0,0 +1,12 @@ +/* Test for overly eager multiple include optimization. + Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. + Problem noted by Tom Tromey . */ +/* { dg-do compile } */ + +#include "mi2a.h" +#include "mi2b.h" + +int main (void) +{ + return x; +} diff --git a/gcc/testsuite/gcc.dg/cpp/mi2a.h b/gcc/testsuite/gcc.dg/cpp/mi2a.h new file mode 100644 index 0000000..e3f53b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi2a.h @@ -0,0 +1,5 @@ +/* Test for overly eager multiple include optimization. + Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. + Problem noted by Tom Tromey . */ + +#include "mi2c.h" diff --git a/gcc/testsuite/gcc.dg/cpp/mi2b.h b/gcc/testsuite/gcc.dg/cpp/mi2b.h new file mode 100644 index 0000000..1d9a8b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi2b.h @@ -0,0 +1,6 @@ +/* Test for overly eager multiple include optimization. + Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. + Problem noted by Tom Tromey . */ + +#define need_x +#include "mi2c.h" diff --git a/gcc/testsuite/gcc.dg/cpp/mi2c.h b/gcc/testsuite/gcc.dg/cpp/mi2c.h new file mode 100644 index 0000000..521792b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi2c.h @@ -0,0 +1,15 @@ +/* Test for overly eager multiple include optimization. + Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h. + Problem noted by Tom Tromey . */ +#ifdef need_x +#undef need_x +#ifndef have_x +#define have_x +extern int x; +#endif +#endif + +#ifndef t_h +#define t_h +extern int y; +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/mi3.c b/gcc/testsuite/gcc.dg/cpp/mi3.c new file mode 100644 index 0000000..533b509 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi3.c @@ -0,0 +1,17 @@ +/* Another test case for over-eager multiple include optimization. + This one distilled from glibc's setlocale.c and categories.def. */ +/* { dg-do compile } */ + +#define X a +#include "mi3.def" +#undef X + +#define X b +#include "mi3.def" +#undef X + +int +main(void) +{ + return a + b; +} diff --git a/gcc/testsuite/gcc.dg/cpp/mi3.def b/gcc/testsuite/gcc.dg/cpp/mi3.def new file mode 100644 index 0000000..375d9c7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mi3.def @@ -0,0 +1,10 @@ +/* Another test case for over-eager multiple include optimization. + This one distilled from glibc's setlocale.c and categories.def. + The #ifdef block doesn't cover the entire file, so it must not be + taken for a reinclude guard. */ + +#ifndef NO_POSTLOAD +#define NO_POSTLOAD NULL +#endif + +int X; diff --git a/gcc/testsuite/gcc.dg/cpp/poison.c b/gcc/testsuite/gcc.dg/cpp/poison.c new file mode 100644 index 0000000..79a910f --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/poison.c @@ -0,0 +1,25 @@ +/* { dg-do preprocess } + { dg-options "-fno-show-column" } */ + +#pragma poison foo +foo /* { dg-error "foo" "use of foo" } */ +#pragma poison foo2 foo3 +foo2 /* { dg-error "foo2" "use of foo2" } */ +foo3 /* { dg-error "foo3" "use of foo3" } */ +#pragma poison foo4 foo5 +foo4 /* { dg-error "foo4" "use of foo4" } */ +foo5 /* { dg-error "foo5" "use of foo5" } */ +#pragma poison +++ /* { dg-error "invalid" "poison non-identifier" } */ +#define foo6 123 +#pragma poison foo6 /* { dg-warning "foo6" "poison defined macro" } */ +#define foo6 345 /* { dg-error "foo6" "def of foo6" } */ +#define foo6 456 /* { dg-error "foo6" "redef of foo6" } */ +#ifdef foo6 /* { dg-error "foo6" "#ifdef foo6" } */ +#error hey! foo6 poisoned! +#endif +#if defined(foo6) /* { dg-error "foo6" "#if defined foo6" } */ +#error no, foo6 still poisoned! +#else +foo6 /* { dg-error "foo6" "use of foo6" } */ +#endif +#pragma poison diff --git a/gcc/testsuite/gcc.dg/cpp/prag-imp.c b/gcc/testsuite/gcc.dg/cpp/prag-imp.c new file mode 100644 index 0000000..6083679 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/prag-imp.c @@ -0,0 +1,7 @@ +/* Test warnings generated by #pragma implementation in the wrong place. */ +/* { dg-do preprocess } */ + +#pragma implementation "stdlib.h" /* { dg-bogus "appears after" "stdlib.h" } */ +#include +#include +#pragma implementation "stdio.h" /* { dg-warning "appears after" "stdio.h" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef1.c b/gcc/testsuite/gcc.dg/cpp/redef1.c new file mode 100644 index 0000000..a5fe2ba --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/redef1.c @@ -0,0 +1,19 @@ +/* Test for redefining macros with insignificant (i.e. whitespace) + differences. */ + +/* { dg-do preprocess } */ + +#define foo bar +#define /* x */ foo /* x */ bar /* x */ + +#define quux(thud) a one and a thud and a two +#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two +#define quux(thud) a one and a thud and a two /* bah */ + +/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 7 } */ +/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 10 } */ +/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */ + +/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 6 } */ +/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 9 } */ +/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc/testsuite/gcc.dg/cpp/redef2.c new file mode 100644 index 0000000..0dacf07 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/redef2.c @@ -0,0 +1,30 @@ +/* Test for redefining macros with significant differences. */ + +/* { dg-do preprocess } + { dg-options "-ansi -pedantic -Wall -fno-show-column" } */ + +#define mac(a, b) (a) + (b) +#define mac(a, b) (a) * (b) +#define mac(a, b) (a) * (x) +#define mac(a, g) (a) * (x) + +#define ro(x) foo x bar +#define ro(x, b) foo x bar + +#define va(a...) a +#define va(...) __VA_ARGS__ + +/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 } + { dg-warning "redefined" "redef mac" { target *-*-* } 8 } + { dg-warning "redefined" "redef mac" { target *-*-* } 9 } + { dg-warning "redefined" "redef ro" { target *-*-* } 12 } + { dg-warning "redefined" "redef va" { target *-*-* } 15 } + + { dg-warning "previous" "prev def mac" { target *-*-* } 6 } + { dg-warning "previous" "prev def mac" { target *-*-* } 7 } + { dg-warning "previous" "prev def mac" { target *-*-* } 8 } + { dg-warning "previous" "prev def ro" { target *-*-* } 11 } + { dg-warning "previous" "prev def va" { target *-*-* } 14 } + + { dg-warning "varargs" "named varargs" { target *-*-* } 14 } + { dg-warning "varargs" "anon varargs" { target *-*-* } 15 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/strp1.c b/gcc/testsuite/gcc.dg/cpp/strp1.c new file mode 100644 index 0000000..096d968 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/strp1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ + +/* Regression test for stringizing and token pasting. + We got internal escape markers in the strings. */ + +#include +#include + +#define S(x) _S(x) +#define _S(x) #x + +#define I 1 +static const char s1[] = S(I.1); +static const char t1[] = "1.1"; + +#define f h +#define h(a) a+f +static const char s2[] = S( f(1)(2) ); +static const char t2[] = "1+h(2)"; + +#undef I +#undef f +#undef h + +int +main(void) +{ + if (strcmp (s1, t1)) + abort (); + + if (strcmp (s2, t2)) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/strp2.c b/gcc/testsuite/gcc.dg/cpp/strp2.c new file mode 100644 index 0000000..d1fcd91 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/strp2.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ + +/* Test for odd corner cases in stringizing/pasting. + Taken more or less verbatim from C99 section 6.10.3.3. */ + +#include +#include + +#define hash_hash # ## # +#define mkstr(a) # a +#define in_between(a) mkstr(a) +#define join(c, d) in_between(c hash_hash d) + +const char p[] = join(x, y); +const char q[] = "x ## y"; + +int +main (void) +{ + if (strcmp (p, q)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cpp/tr-paste.c b/gcc/testsuite/gcc.dg/cpp/tr-paste.c new file mode 100644 index 0000000..ac8a47b --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/tr-paste.c @@ -0,0 +1,17 @@ +/* Test for proper comment elimination semantics from cpplib's -traditional. + This should compile and link with compiled with `gcc -traditional-cpp'. + Test case by Jason R. Thorpe . */ + +/* { dg-do compile } */ +/* { dg-options "-traditional" } */ + +#define A(name) X/**/name + +#define B(name) \ +void A(Y/**/name)() { A(name)(); } + +void Xhello() { printf("hello world\n"); } + +B(hello) + +int main() { XYhello(); return (0); } diff --git a/gcc/testsuite/gcc.dg/cpp/tr-str.c b/gcc/testsuite/gcc.dg/cpp/tr-str.c new file mode 100644 index 0000000..3a568ce --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/tr-str.c @@ -0,0 +1,4 @@ +/* Test whether traditional stringify works. */ +/* { dg-do preprocess } */ +/* { dg-options "-traditional" } */ +#define foo(a, b) c="a"; d="b"; diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn1.c b/gcc/testsuite/gcc.dg/cpp/tr-warn1.c new file mode 100644 index 0000000..f96e1bc --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/tr-warn1.c @@ -0,0 +1,30 @@ +/* Test for warnings about nontraditional directives. */ +/* { dg-do preprocess } */ +/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */ + +/* Block 1: K+R directives should have the # indented. */ + +#define foo bar /* { dg-bogus "indented" "^#kandr" } */ +# define foo bar /* { dg-bogus "indented" "^# kandr" } */ + #define foo bar /* { dg-warning "indented" "^ #kandr" } */ + # define foo bar /* { dg-warning "indented" "^ # kandr" } */ + +/* Block 2: C89 directives should not have the # indented. */ + +#pragma whatever /* { dg-warning "indented" "^#c89" } */ +# pragma whatever /* { dg-warning "indented" "^# c89" } */ + #pragma whatever /* { dg-bogus "indented" "^ #c89" } */ + # pragma whatever /* { dg-bogus "indented" "^ # c89" } */ + +/* Block 3: Extensions should not have the # indented, + _and_ they should get a -pedantic warning. */ + +#assert foo(bar) /* { dg-warning "indented" "^#ext" } */ +# assert bar(baz) /* { dg-warning "indented" "^# ext" } */ + #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */ + # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */ + +/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 22 } */ +/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 23 } */ +/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 24 } */ +/* { dg-warning "ISO C does not" "extension warning" { target *-*-* } 25 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/tr-warn2.c b/gcc/testsuite/gcc.dg/cpp/tr-warn2.c new file mode 100644 index 0000000..303b0ff --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/tr-warn2.c @@ -0,0 +1,14 @@ +/* K+R rejects use of function-like macros in non-function context. + ANSI C explicitly permits this (the macro is not expanded). */ + +/* { dg-do compile } */ +/* { dg-options -Wtraditional } */ + +enum { SIGN_EXTEND = 23 }; + +#define SIGN_EXTEND(v) (((v) < 0) ? -1 : 0) + +int fun(void) +{ + return SIGN_EXTEND; /* { dg-warning "must be used with arguments" } */ +} diff --git a/gcc/testsuite/gcc.dg/cpp/trigraphs.c b/gcc/testsuite/gcc.dg/cpp/trigraphs.c new file mode 100644 index 0000000..5f60b63 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/trigraphs.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-options "-ansi" } */ + +extern void abort (void); + +/* Basic tests for trigraph conversion. + All of them are here, but not in all possible contexts. *??/ +/ + +??=include + +??=define TWELVE 1??/ +2 + +static const char str??(??) = "0123456789??/n"; + +int +main(void) +??< + if (sizeof str != TWELVE) + abort (); + + if ((5 ??' 3) != 6) + abort (); + + if ((5 ??! 3) != 7) + abort (); + + return 0; +??> diff --git a/gcc/testsuite/gcc.dg/cpp/unc1.c b/gcc/testsuite/gcc.dg/cpp/unc1.c new file mode 100644 index 0000000..5059ae6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/unc1.c @@ -0,0 +1,13 @@ +/* Tests for un-terminated conditionals: 1. */ + +#if 1 /* { dg-error "unterminated" "unterminated #if" } */ + +#ifdef notdef /* { dg-bogus "unterminated" "nested terminated #ifdef" } */ + +blah blah blah + +#endif + +more text + +/* oops! */ diff --git a/gcc/testsuite/gcc.dg/cpp/unc2.c b/gcc/testsuite/gcc.dg/cpp/unc2.c new file mode 100644 index 0000000..d9e3959 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/unc2.c @@ -0,0 +1,11 @@ +/* Tests for unterminated conditionals: 2. */ + +#ifdef __sparc__ /* { dg-error "unterminated" "unterminated if-elif-elif..." } */ +sparc +#elif defined __powerpc__ +ppc +#elif defined __i386__ +i386 +#elif defined __vax__ +vax + diff --git a/gcc/testsuite/gcc.dg/cpp/unc3.c b/gcc/testsuite/gcc.dg/cpp/unc3.c new file mode 100644 index 0000000..9a16bb3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/unc3.c @@ -0,0 +1,4 @@ +/* Tests for unterminated conditionals: 3. */ + +#if 1 /* { dg-error "#else" "unterminated #else" } */ +#else diff --git a/gcc/testsuite/gcc.dg/cpp/unc4.c b/gcc/testsuite/gcc.dg/cpp/unc4.c new file mode 100644 index 0000000..c486281 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/unc4.c @@ -0,0 +1,40 @@ +/* { dg-do preprocess } */ +/* { dg-options "-fno-show-column" } */ + +/* Tests for un-terminated conditional diagnostics. + Copyright (c) 1999 Free Software Foundation. + Contributed by Zack Weinberg, who made it up all by himself. */ + +#endif /* { dg-error "#endif" "#endif without #if" } */ + +#else /* { dg-error "#else" "#else without #if" } */ +#endif /* { dg-error "#endif" "#endif after #else without #if" } */ + +#elif 0 /* { dg-error "#elif" "#elif without #if" } */ +#endif /* { dg-error "#endif" "#endif after #else without #if" } */ + +#if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */ +blah +#endif + +#if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */ +ignored +#endif + +/* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */ +#if 0 +#include "unc1.c" +#endif + +/* The ifdef below should not get an error just because there's a bad if + inside the included file. + The odd dg-error tag on the include matches the "In file included from" + message. */ +#define FOO +#ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */ +#include "unc1.c" /* { dg-error "" } */ +#endif + +/* dg.exp doesn't read the included files for tags, so we have to + do them explicitly here. */ +/* { dg-error "#if" "unc1.c: unterminated #if" { target *-*-* } 3 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/undef1.c b/gcc/testsuite/gcc.dg/cpp/undef1.c new file mode 100644 index 0000000..024efce --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/undef1.c @@ -0,0 +1,14 @@ +/* { dg-do preprocess } */ + +/* 6.9.3.11: ...If there are sequences of preprocessing tokens within + the list of arguments that would otherwise act as preprocessing + directives, the behavior is undefined. + + I choose to make this a hard error. It definitely should not cause + a core dump. */ + +#define foo(bar) bar + +foo( blah +#undef foo /* { dg-error "may not be used inside" "foo(#undef foo)" } */ + blah ) diff --git a/gcc/testsuite/gcc.dg/cpp/undef2.c b/gcc/testsuite/gcc.dg/cpp/undef2.c new file mode 100644 index 0000000..3ecfb6e --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/undef2.c @@ -0,0 +1,23 @@ +/* C99 6.10.8 para 4: None of [the predefined macro names] shall be the + subject of a #define or an #undef preprocessing directive. */ + +/* { dg-do preprocess } */ + +#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */ +#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */ +#undef __FILE__ /* { dg-warning "undefining" "__FILE__" } */ +#undef __LINE__ /* { dg-warning "undefining" "__LINE__" } */ +#undef __STDC__ /* { dg-warning "undefining" "__STDC__" } */ + +/* These should be protected from #undef, but aren't, because they + are set with normal #define commands - and on top of that, some + of them are library properties, outside our control. To consider: + warn about undefining/redefining any identifier beginning with + __STDC_ . + + __STDC_HOSTED__ + __STDC_VERSION__ + __STDC_IEC_559__ + __STDC_IEC_559_COMPLEX__ + __STDC_ISO_10646__ + */ diff --git a/gcc/testsuite/gcc.dg/cpp/widestr1.c b/gcc/testsuite/gcc.dg/cpp/widestr1.c new file mode 100644 index 0000000..837efad --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/widestr1.c @@ -0,0 +1,9 @@ +/* Copyright (C) 2000 Free Software Foundation. + + by Alexandre Oliva */ + +/* { dg-do preprocess } */ + +#line 1 L"foo" /* { dg-error "not a string" "wide string in #line" } */ +#include L"stdio.h" /* { dg-error "expects" "wide string in #include" } */ +#pragma implementation L"test.h" /* { dg-error "malformed" "wide string in #pragma implementation" } */ diff --git a/gcc/testsuite/gcc.dg/cxx-comments-1.c b/gcc/testsuite/gcc.dg/cxx-comments-1.c deleted file mode 100644 index c7c51d6..0000000 --- a/gcc/testsuite/gcc.dg/cxx-comments-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-pedantic -std=gnu89" } */ - -/* You can't do this in your own code... */ -// C++ comment is not in C89 { dg-warning "style comment|reported only once" "good warning" } - -/* ...but we don't bitch about it more than once. */ -// C++ comment is not in C89 { dg-bogus "style comment" "bad warning" } - -/* - { dg-final { if ![file exists cxx-comments-1.i] { return } } } - { dg-final { set tmp [grep cxx-comments-1.i "is not in C89" line] } } - { dg-final { # send_user "$tmp\n" } } - { dg-final { if [regexp "is not in C89" $tmp] \{ } } - { dg-final { fail "cxx-comments-1: comment strip check" } } - { dg-final { \} else \{ } } - { dg-final { pass "cxx-comments-1: comment strip check" } } - { dg-final { \} } } -*/ - diff --git a/gcc/testsuite/gcc.dg/cxx-comments-2.c b/gcc/testsuite/gcc.dg/cxx-comments-2.c deleted file mode 100644 index 7d0fe09..0000000 --- a/gcc/testsuite/gcc.dg/cxx-comments-2.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-pedantic -std=c89" } */ - -/* This is an extension and therefore gets a warning. */ -#line 5 "cxx-comments-2.c" 3 /* { dg-warning "garbage at end" "#line extension" } */ - -/* A system header may contain C++ comments irrespective of mode. */ -// C++ comment is not in C89 { dg-bogus "style comment" "bad warning" } - -/* - { dg-final { if ![file exists cxx-comments-2.i] { return } } } - { dg-final { set tmp [grep cxx-comments-2.i "is not in C89" line] } } - { dg-final { # send_user "$tmp\n" } } - { dg-final { if [regexp "is not in C89" $tmp] \{ } } - { dg-final { fail "cxx-comments-2: comment strip check" } } - { dg-final { \} else \{ } } - { dg-final { pass "cxx-comments-2: comment strip check" } } - { dg-final { \} } } -*/ - diff --git a/gcc/testsuite/gcc.dg/endif-label.c b/gcc/testsuite/gcc.dg/endif-label.c deleted file mode 100644 index c12662c..0000000 --- a/gcc/testsuite/gcc.dg/endif-label.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-pedantic -Wall" } */ - -/* You can't get away with this in your own code... */ -#ifdef KERNEL -#define foo -#endif KERNEL /* { dg-warning "forbids text after" "good warning" } */ - -/* This will provoke a warning because the '3' is an extension. */ -#line 10 "endif-label.c" 3 /* { dg-warning "garbage at end" "#line extension" } */ - -/* ... but in a system header, it's acceptable. */ -#ifdef KERNEL -#define foo -#endif KERNEL /* { dg-bogus "forbids text after" "bad warning" } */ diff --git a/gcc/testsuite/gcc.dg/lineno-2.c b/gcc/testsuite/gcc.dg/lineno-2.c deleted file mode 100644 index 77b940f..0000000 --- a/gcc/testsuite/gcc.dg/lineno-2.c +++ /dev/null @@ -1,26 +0,0 @@ -/* { dg-do run } */ - -/* Test #line with and without macros for the line number. */ - -extern void abort (void); - -#define L 90 - -#line 44 -int i = __LINE__; - -#line L -int j = __LINE__; - -#line 14 /* N.B. the _next_ line is line 14. */ - -int main(void) -{ - if (i != 44) - abort (); - if (j != 90) - abort (); - if (__LINE__ != 21) - abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/lineno.c b/gcc/testsuite/gcc.dg/lineno.c deleted file mode 100644 index dc5bf81..0000000 --- a/gcc/testsuite/gcc.dg/lineno.c +++ /dev/null @@ -1,28 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-Wwrite-strings" } */ -/* The purpose of this test is to ensure that line numbers in diagnostics - are accurate after macros whose arguments contain newlines and are - substituted multiple times. The semicolons are on separate lines because - #line can only correct numbering on line boundaries. */ -#define one(x) x -#define two(x) x x -#define four(x) two(x) two(x) - -int -main(void) -{ - char *A; - - A = "text"; /* { dg-warning "discards qualifiers" "case zero" } */ - A = one("text" - "text") - ; /* { dg-warning "discards qualifiers" "case one" } */ - A = two("text" - "text") - ; /* { dg-warning "discards qualifiers" "case two" } */ - A = four("text" - "text") - ; /* { dg-warning "discards qualifiers" "case four" } */ - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/poison-1.c b/gcc/testsuite/gcc.dg/poison-1.c deleted file mode 100644 index 79a910f..0000000 --- a/gcc/testsuite/gcc.dg/poison-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-do preprocess } - { dg-options "-fno-show-column" } */ - -#pragma poison foo -foo /* { dg-error "foo" "use of foo" } */ -#pragma poison foo2 foo3 -foo2 /* { dg-error "foo2" "use of foo2" } */ -foo3 /* { dg-error "foo3" "use of foo3" } */ -#pragma poison foo4 foo5 -foo4 /* { dg-error "foo4" "use of foo4" } */ -foo5 /* { dg-error "foo5" "use of foo5" } */ -#pragma poison +++ /* { dg-error "invalid" "poison non-identifier" } */ -#define foo6 123 -#pragma poison foo6 /* { dg-warning "foo6" "poison defined macro" } */ -#define foo6 345 /* { dg-error "foo6" "def of foo6" } */ -#define foo6 456 /* { dg-error "foo6" "redef of foo6" } */ -#ifdef foo6 /* { dg-error "foo6" "#ifdef foo6" } */ -#error hey! foo6 poisoned! -#endif -#if defined(foo6) /* { dg-error "foo6" "#if defined foo6" } */ -#error no, foo6 still poisoned! -#else -foo6 /* { dg-error "foo6" "use of foo6" } */ -#endif -#pragma poison diff --git a/gcc/testsuite/gcc.dg/pr-impl.c b/gcc/testsuite/gcc.dg/pr-impl.c deleted file mode 100644 index 6083679..0000000 --- a/gcc/testsuite/gcc.dg/pr-impl.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Test warnings generated by #pragma implementation in the wrong place. */ -/* { dg-do preprocess } */ - -#pragma implementation "stdlib.h" /* { dg-bogus "appears after" "stdlib.h" } */ -#include -#include -#pragma implementation "stdio.h" /* { dg-warning "appears after" "stdio.h" } */ diff --git a/gcc/testsuite/gcc.dg/strpaste-2.c b/gcc/testsuite/gcc.dg/strpaste-2.c deleted file mode 100644 index d1fcd91..0000000 --- a/gcc/testsuite/gcc.dg/strpaste-2.c +++ /dev/null @@ -1,23 +0,0 @@ -/* { dg-do run } */ - -/* Test for odd corner cases in stringizing/pasting. - Taken more or less verbatim from C99 section 6.10.3.3. */ - -#include -#include - -#define hash_hash # ## # -#define mkstr(a) # a -#define in_between(a) mkstr(a) -#define join(c, d) in_between(c hash_hash d) - -const char p[] = join(x, y); -const char q[] = "x ## y"; - -int -main (void) -{ - if (strcmp (p, q)) - abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/strpaste.c b/gcc/testsuite/gcc.dg/strpaste.c deleted file mode 100644 index 096d968..0000000 --- a/gcc/testsuite/gcc.dg/strpaste.c +++ /dev/null @@ -1,35 +0,0 @@ -/* { dg-do run } */ - -/* Regression test for stringizing and token pasting. - We got internal escape markers in the strings. */ - -#include -#include - -#define S(x) _S(x) -#define _S(x) #x - -#define I 1 -static const char s1[] = S(I.1); -static const char t1[] = "1.1"; - -#define f h -#define h(a) a+f -static const char s2[] = S( f(1)(2) ); -static const char t2[] = "1+h(2)"; - -#undef I -#undef f -#undef h - -int -main(void) -{ - if (strcmp (s1, t1)) - abort (); - - if (strcmp (s2, t2)) - abort (); - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/trigraphs.c b/gcc/testsuite/gcc.dg/trigraphs.c deleted file mode 100644 index 5f60b63..0000000 --- a/gcc/testsuite/gcc.dg/trigraphs.c +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-ansi" } */ - -extern void abort (void); - -/* Basic tests for trigraph conversion. - All of them are here, but not in all possible contexts. *??/ -/ - -??=include - -??=define TWELVE 1??/ -2 - -static const char str??(??) = "0123456789??/n"; - -int -main(void) -??< - if (sizeof str != TWELVE) - abort (); - - if ((5 ??' 3) != 6) - abort (); - - if ((5 ??! 3) != 7) - abort (); - - return 0; -??> diff --git a/gcc/testsuite/gcc.dg/undef-2.c b/gcc/testsuite/gcc.dg/undef-2.c deleted file mode 100644 index 3ecfb6e..0000000 --- a/gcc/testsuite/gcc.dg/undef-2.c +++ /dev/null @@ -1,23 +0,0 @@ -/* C99 6.10.8 para 4: None of [the predefined macro names] shall be the - subject of a #define or an #undef preprocessing directive. */ - -/* { dg-do preprocess } */ - -#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */ -#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */ -#undef __FILE__ /* { dg-warning "undefining" "__FILE__" } */ -#undef __LINE__ /* { dg-warning "undefining" "__LINE__" } */ -#undef __STDC__ /* { dg-warning "undefining" "__STDC__" } */ - -/* These should be protected from #undef, but aren't, because they - are set with normal #define commands - and on top of that, some - of them are library properties, outside our control. To consider: - warn about undefining/redefining any identifier beginning with - __STDC_ . - - __STDC_HOSTED__ - __STDC_VERSION__ - __STDC_IEC_559__ - __STDC_IEC_559_COMPLEX__ - __STDC_ISO_10646__ - */ diff --git a/gcc/testsuite/gcc.dg/undef.c b/gcc/testsuite/gcc.dg/undef.c deleted file mode 100644 index 024efce..0000000 --- a/gcc/testsuite/gcc.dg/undef.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do preprocess } */ - -/* 6.9.3.11: ...If there are sequences of preprocessing tokens within - the list of arguments that would otherwise act as preprocessing - directives, the behavior is undefined. - - I choose to make this a hard error. It definitely should not cause - a core dump. */ - -#define foo(bar) bar - -foo( blah -#undef foo /* { dg-error "may not be used inside" "foo(#undef foo)" } */ - blah ) -- cgit v1.1