From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/pch/common-1.c | 3 ++ gcc/testsuite/gcc.dg/pch/common-1.hs | 3 ++ gcc/testsuite/gcc.dg/pch/counter-1.c | 9 ++++ gcc/testsuite/gcc.dg/pch/counter-1.hs | 5 +++ gcc/testsuite/gcc.dg/pch/counter-2.c | 18 ++++++++ gcc/testsuite/gcc.dg/pch/counter-2.hs | 4 ++ gcc/testsuite/gcc.dg/pch/counter-3.c | 13 ++++++ gcc/testsuite/gcc.dg/pch/counter-3.hs | 4 ++ gcc/testsuite/gcc.dg/pch/cpp-1.c | 4 ++ gcc/testsuite/gcc.dg/pch/cpp-1.hs | 1 + gcc/testsuite/gcc.dg/pch/cpp-2.c | 4 ++ gcc/testsuite/gcc.dg/pch/cpp-2.hs | 1 + gcc/testsuite/gcc.dg/pch/cpp-3.c | 13 ++++++ gcc/testsuite/gcc.dg/pch/cpp-3.hs | 4 ++ gcc/testsuite/gcc.dg/pch/cpp-3a.h | 4 ++ gcc/testsuite/gcc.dg/pch/cpp-3b.h | 4 ++ gcc/testsuite/gcc.dg/pch/decl-1.c | 2 + gcc/testsuite/gcc.dg/pch/decl-1.hs | 1 + gcc/testsuite/gcc.dg/pch/decl-2.c | 2 + gcc/testsuite/gcc.dg/pch/decl-2.hs | 3 ++ gcc/testsuite/gcc.dg/pch/decl-3.c | 11 +++++ gcc/testsuite/gcc.dg/pch/decl-3.hs | 3 ++ gcc/testsuite/gcc.dg/pch/decl-4.c | 9 ++++ gcc/testsuite/gcc.dg/pch/decl-4.hs | 7 +++ gcc/testsuite/gcc.dg/pch/decl-5.c | 2 + gcc/testsuite/gcc.dg/pch/decl-5.hs | 1 + gcc/testsuite/gcc.dg/pch/empty.c | 8 ++++ gcc/testsuite/gcc.dg/pch/empty.hs | 0 gcc/testsuite/gcc.dg/pch/except-1.c | 7 +++ gcc/testsuite/gcc.dg/pch/except-1.hs | 6 +++ gcc/testsuite/gcc.dg/pch/global-1.c | 2 + gcc/testsuite/gcc.dg/pch/global-1.hs | 1 + gcc/testsuite/gcc.dg/pch/import-1.c | 21 +++++++++ gcc/testsuite/gcc.dg/pch/import-1.hs | 5 +++ gcc/testsuite/gcc.dg/pch/import-1a.h | 5 +++ gcc/testsuite/gcc.dg/pch/import-1b.h | 4 ++ gcc/testsuite/gcc.dg/pch/import-1c.h | 6 +++ gcc/testsuite/gcc.dg/pch/import-2.c | 8 ++++ gcc/testsuite/gcc.dg/pch/import-2.hs | 4 ++ gcc/testsuite/gcc.dg/pch/include/import-2a.h | 1 + gcc/testsuite/gcc.dg/pch/include/import-2b.h | 1 + gcc/testsuite/gcc.dg/pch/inline-1.c | 10 +++++ gcc/testsuite/gcc.dg/pch/inline-1.hs | 5 +++ gcc/testsuite/gcc.dg/pch/inline-2.c | 12 ++++++ gcc/testsuite/gcc.dg/pch/inline-2.hs | 5 +++ gcc/testsuite/gcc.dg/pch/inline-3.c | 5 +++ gcc/testsuite/gcc.dg/pch/inline-3.hs | 7 +++ gcc/testsuite/gcc.dg/pch/inline-4.c | 6 +++ gcc/testsuite/gcc.dg/pch/inline-4.hs | 4 ++ gcc/testsuite/gcc.dg/pch/macro-1.c | 6 +++ gcc/testsuite/gcc.dg/pch/macro-1.hs | 2 + gcc/testsuite/gcc.dg/pch/macro-2.c | 8 ++++ gcc/testsuite/gcc.dg/pch/macro-2.hs | 2 + gcc/testsuite/gcc.dg/pch/macro-3.c | 8 ++++ gcc/testsuite/gcc.dg/pch/macro-3.hs | 2 + gcc/testsuite/gcc.dg/pch/macro-4.c | 8 ++++ gcc/testsuite/gcc.dg/pch/macro-4.hs | 1 + gcc/testsuite/gcc.dg/pch/pch.exp | 64 ++++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/pch/pushpop-1.c | 11 +++++ gcc/testsuite/gcc.dg/pch/pushpop-1.hs | 5 +++ gcc/testsuite/gcc.dg/pch/save-temps-1.c | 9 ++++ gcc/testsuite/gcc.dg/pch/save-temps-1.hs | 5 +++ gcc/testsuite/gcc.dg/pch/static-1.c | 6 +++ gcc/testsuite/gcc.dg/pch/static-1.hs | 5 +++ gcc/testsuite/gcc.dg/pch/static-2.c | 6 +++ gcc/testsuite/gcc.dg/pch/static-2.hs | 5 +++ gcc/testsuite/gcc.dg/pch/static-3.c | 8 ++++ gcc/testsuite/gcc.dg/pch/static-3.hs | 7 +++ gcc/testsuite/gcc.dg/pch/struct-1.c | 16 +++++++ gcc/testsuite/gcc.dg/pch/struct-1.hs | 3 ++ gcc/testsuite/gcc.dg/pch/system-1.c | 6 +++ gcc/testsuite/gcc.dg/pch/system-1.hs | 2 + gcc/testsuite/gcc.dg/pch/valid-1.c | 8 ++++ gcc/testsuite/gcc.dg/pch/valid-1.hs | 3 ++ gcc/testsuite/gcc.dg/pch/valid-1b.c | 5 +++ gcc/testsuite/gcc.dg/pch/valid-1b.hs | 3 ++ gcc/testsuite/gcc.dg/pch/valid-2.c | 7 +++ gcc/testsuite/gcc.dg/pch/valid-2.hs | 1 + gcc/testsuite/gcc.dg/pch/valid-4.c | 6 +++ gcc/testsuite/gcc.dg/pch/valid-4.hs | 1 + gcc/testsuite/gcc.dg/pch/valid-5.c | 5 +++ gcc/testsuite/gcc.dg/pch/valid-5.hs | 1 + gcc/testsuite/gcc.dg/pch/valid-6.c | 5 +++ gcc/testsuite/gcc.dg/pch/valid-6.hs | 1 + gcc/testsuite/gcc.dg/pch/warn-1.c | 14 ++++++ gcc/testsuite/gcc.dg/pch/warn-1.hs | 5 +++ 86 files changed, 528 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pch/common-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/common-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/counter-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/counter-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/counter-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/counter-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/counter-3.c create mode 100644 gcc/testsuite/gcc.dg/pch/counter-3.hs create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-3.c create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-3.hs create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-3a.h create mode 100644 gcc/testsuite/gcc.dg/pch/cpp-3b.h create mode 100644 gcc/testsuite/gcc.dg/pch/decl-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/decl-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/decl-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/decl-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/decl-3.c create mode 100644 gcc/testsuite/gcc.dg/pch/decl-3.hs create mode 100644 gcc/testsuite/gcc.dg/pch/decl-4.c create mode 100644 gcc/testsuite/gcc.dg/pch/decl-4.hs create mode 100644 gcc/testsuite/gcc.dg/pch/decl-5.c create mode 100644 gcc/testsuite/gcc.dg/pch/decl-5.hs create mode 100644 gcc/testsuite/gcc.dg/pch/empty.c create mode 100644 gcc/testsuite/gcc.dg/pch/empty.hs create mode 100644 gcc/testsuite/gcc.dg/pch/except-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/except-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/global-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/global-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/import-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/import-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/import-1a.h create mode 100644 gcc/testsuite/gcc.dg/pch/import-1b.h create mode 100644 gcc/testsuite/gcc.dg/pch/import-1c.h create mode 100644 gcc/testsuite/gcc.dg/pch/import-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/import-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/include/import-2a.h create mode 100644 gcc/testsuite/gcc.dg/pch/include/import-2b.h create mode 100644 gcc/testsuite/gcc.dg/pch/inline-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/inline-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/inline-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/inline-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/inline-3.c create mode 100644 gcc/testsuite/gcc.dg/pch/inline-3.hs create mode 100644 gcc/testsuite/gcc.dg/pch/inline-4.c create mode 100644 gcc/testsuite/gcc.dg/pch/inline-4.hs create mode 100644 gcc/testsuite/gcc.dg/pch/macro-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/macro-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/macro-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/macro-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/macro-3.c create mode 100644 gcc/testsuite/gcc.dg/pch/macro-3.hs create mode 100644 gcc/testsuite/gcc.dg/pch/macro-4.c create mode 100644 gcc/testsuite/gcc.dg/pch/macro-4.hs create mode 100644 gcc/testsuite/gcc.dg/pch/pch.exp create mode 100644 gcc/testsuite/gcc.dg/pch/pushpop-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/pushpop-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/save-temps-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/save-temps-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/static-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/static-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/static-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/static-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/static-3.c create mode 100644 gcc/testsuite/gcc.dg/pch/static-3.hs create mode 100644 gcc/testsuite/gcc.dg/pch/struct-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/struct-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/system-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/system-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/valid-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/valid-1.hs create mode 100644 gcc/testsuite/gcc.dg/pch/valid-1b.c create mode 100644 gcc/testsuite/gcc.dg/pch/valid-1b.hs create mode 100644 gcc/testsuite/gcc.dg/pch/valid-2.c create mode 100644 gcc/testsuite/gcc.dg/pch/valid-2.hs create mode 100644 gcc/testsuite/gcc.dg/pch/valid-4.c create mode 100644 gcc/testsuite/gcc.dg/pch/valid-4.hs create mode 100644 gcc/testsuite/gcc.dg/pch/valid-5.c create mode 100644 gcc/testsuite/gcc.dg/pch/valid-5.hs create mode 100644 gcc/testsuite/gcc.dg/pch/valid-6.c create mode 100644 gcc/testsuite/gcc.dg/pch/valid-6.hs create mode 100644 gcc/testsuite/gcc.dg/pch/warn-1.c create mode 100644 gcc/testsuite/gcc.dg/pch/warn-1.hs (limited to 'gcc/testsuite/gcc.dg/pch') diff --git a/gcc/testsuite/gcc.dg/pch/common-1.c b/gcc/testsuite/gcc.dg/pch/common-1.c new file mode 100644 index 000000000..ec5731028 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/common-1.c @@ -0,0 +1,3 @@ +#include "common-1.h" +int foo2 = 3; +int zz = 2; diff --git a/gcc/testsuite/gcc.dg/pch/common-1.hs b/gcc/testsuite/gcc.dg/pch/common-1.hs new file mode 100644 index 000000000..971e1996a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/common-1.hs @@ -0,0 +1,3 @@ +static int foo1 = 9; +int foo2; +extern int zz; diff --git a/gcc/testsuite/gcc.dg/pch/counter-1.c b/gcc/testsuite/gcc.dg/pch/counter-1.c new file mode 100644 index 000000000..79cea882d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/counter-1.c @@ -0,0 +1,9 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild */ + +#include "counter-1.h" + +int main(void) +{ + return __COUNTER__; +} diff --git a/gcc/testsuite/gcc.dg/pch/counter-1.hs b/gcc/testsuite/gcc.dg/pch/counter-1.hs new file mode 100644 index 000000000..c3d2ce791 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/counter-1.hs @@ -0,0 +1,5 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild */ + +static unsigned offset[] = {__COUNTER__, __COUNTER__, __COUNTER__}; +#define counter __COUNTER__ diff --git a/gcc/testsuite/gcc.dg/pch/counter-2.c b/gcc/testsuite/gcc.dg/pch/counter-2.c new file mode 100644 index 000000000..14ce24909 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/counter-2.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild */ + +/* { dg-options "-I. -Winvalid-pch" } */ + +#if __COUNTER__ != 0 +#error __COUNTER__ != 0 +#endif + +#include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */ +/* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 0 } */ +/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ + +int main(void) +{ + return __COUNTER__; +} diff --git a/gcc/testsuite/gcc.dg/pch/counter-2.hs b/gcc/testsuite/gcc.dg/pch/counter-2.hs new file mode 100644 index 000000000..63b8a2b7f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/counter-2.hs @@ -0,0 +1,4 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild */ + +static int i = __COUNTER__; diff --git a/gcc/testsuite/gcc.dg/pch/counter-3.c b/gcc/testsuite/gcc.dg/pch/counter-3.c new file mode 100644 index 000000000..827920563 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/counter-3.c @@ -0,0 +1,13 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild */ + +#if __COUNTER__ != 0 +#error __COUNTER__ != 0 +#endif + +#include "counter-3.h" + +int main(void) +{ + return __COUNTER__; +} diff --git a/gcc/testsuite/gcc.dg/pch/counter-3.hs b/gcc/testsuite/gcc.dg/pch/counter-3.hs new file mode 100644 index 000000000..19039c820 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/counter-3.hs @@ -0,0 +1,4 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild */ + +#define counter __COUNTER__ diff --git a/gcc/testsuite/gcc.dg/pch/cpp-1.c b/gcc/testsuite/gcc.dg/pch/cpp-1.c new file mode 100644 index 000000000..9a3d6700d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-1.c @@ -0,0 +1,4 @@ +#include "cpp-1.h" +#if !defined(__GNUC__) +panic! panic! +#endif diff --git a/gcc/testsuite/gcc.dg/pch/cpp-1.hs b/gcc/testsuite/gcc.dg/pch/cpp-1.hs new file mode 100644 index 000000000..6e25b021a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-1.hs @@ -0,0 +1 @@ +/* Empty. */ diff --git a/gcc/testsuite/gcc.dg/pch/cpp-2.c b/gcc/testsuite/gcc.dg/pch/cpp-2.c new file mode 100644 index 000000000..aab84110e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-2.c @@ -0,0 +1,4 @@ +/* { dg-options "-Wunknown-pragmas -I." } */ +#include "cpp-2.h" +#pragma GCC poison not_used + diff --git a/gcc/testsuite/gcc.dg/pch/cpp-2.hs b/gcc/testsuite/gcc.dg/pch/cpp-2.hs new file mode 100644 index 000000000..6e25b021a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-2.hs @@ -0,0 +1 @@ +/* Empty. */ diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3.c b/gcc/testsuite/gcc.dg/pch/cpp-3.c new file mode 100644 index 000000000..25b5ca407 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-3.c @@ -0,0 +1,13 @@ +/* PR preprocessor/36649 */ +/* { dg-do compile } */ +/* { dg-options "-H -I." } */ +/* { dg-message "cpp-3.h\[^\n\]*(\n\[^\n\]*cpp-3.c)?\n\[^\n\]*cpp-3a.h\n\[^\n\]*cpp-3b.h" "" { target *-*-* } 0 } */ + +#include "cpp-3.h" +#include "cpp-3a.h" + +int +main (void) +{ + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3.hs b/gcc/testsuite/gcc.dg/pch/cpp-3.hs new file mode 100644 index 000000000..728b1afc7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-3.hs @@ -0,0 +1,4 @@ +#ifndef CPP_3_H +#define CPP_3_H +/* empty */ +#endif diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3a.h b/gcc/testsuite/gcc.dg/pch/cpp-3a.h new file mode 100644 index 000000000..3788d1179 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-3a.h @@ -0,0 +1,4 @@ +#ifndef CPP_3A_H +#define CPP_3A_H +#include "cpp-3b.h" +#endif diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3b.h b/gcc/testsuite/gcc.dg/pch/cpp-3b.h new file mode 100644 index 000000000..5cb0e8104 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/cpp-3b.h @@ -0,0 +1,4 @@ +#ifndef CPP_3B_H +#define CPP_3B_H +/* empty */ +#endif diff --git a/gcc/testsuite/gcc.dg/pch/decl-1.c b/gcc/testsuite/gcc.dg/pch/decl-1.c new file mode 100644 index 000000000..5d6bb1d4a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-1.c @@ -0,0 +1,2 @@ +#include "decl-1.h" +int main(void) { return foo; } diff --git a/gcc/testsuite/gcc.dg/pch/decl-1.hs b/gcc/testsuite/gcc.dg/pch/decl-1.hs new file mode 100644 index 000000000..399f5d3e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-1.hs @@ -0,0 +1 @@ +extern int foo; diff --git a/gcc/testsuite/gcc.dg/pch/decl-2.c b/gcc/testsuite/gcc.dg/pch/decl-2.c new file mode 100644 index 000000000..72b6538b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-2.c @@ -0,0 +1,2 @@ +#include "decl-2.h" +int main(void) { return fun (1, 2); } diff --git a/gcc/testsuite/gcc.dg/pch/decl-2.hs b/gcc/testsuite/gcc.dg/pch/decl-2.hs new file mode 100644 index 000000000..99c372690 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-2.hs @@ -0,0 +1,3 @@ +extern int fun (int a, int b); + + diff --git a/gcc/testsuite/gcc.dg/pch/decl-3.c b/gcc/testsuite/gcc.dg/pch/decl-3.c new file mode 100644 index 000000000..c12abbb1c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-3.c @@ -0,0 +1,11 @@ +#include "decl-3.h" + +foo_p bar (void) +{ + return foop; +} + +struct foo *bar2 (void) +{ + return foop; +} diff --git a/gcc/testsuite/gcc.dg/pch/decl-3.hs b/gcc/testsuite/gcc.dg/pch/decl-3.hs new file mode 100644 index 000000000..787d480f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-3.hs @@ -0,0 +1,3 @@ +struct foo; +typedef struct foo *foo_p; +extern foo_p foop; diff --git a/gcc/testsuite/gcc.dg/pch/decl-4.c b/gcc/testsuite/gcc.dg/pch/decl-4.c new file mode 100644 index 000000000..61affdbc0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-4.c @@ -0,0 +1,9 @@ +#include "decl-4.h" + +int bar (foo_p f) +{ + if (f->a + foop->a) + return f->c->b + foop->b; + else + return foop->c->b + f->a; +} diff --git a/gcc/testsuite/gcc.dg/pch/decl-4.hs b/gcc/testsuite/gcc.dg/pch/decl-4.hs new file mode 100644 index 000000000..3fb220032 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-4.hs @@ -0,0 +1,7 @@ +typedef struct foo { + int a; + char b; + struct foo *c; +} foo_s; +typedef struct foo *foo_p; +extern foo_p foop; diff --git a/gcc/testsuite/gcc.dg/pch/decl-5.c b/gcc/testsuite/gcc.dg/pch/decl-5.c new file mode 100644 index 000000000..705c2fe0d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-5.c @@ -0,0 +1,2 @@ +#include "decl-5.h" +static int (*t)(void) = foo; diff --git a/gcc/testsuite/gcc.dg/pch/decl-5.hs b/gcc/testsuite/gcc.dg/pch/decl-5.hs new file mode 100644 index 000000000..914983c49 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/decl-5.hs @@ -0,0 +1 @@ +extern int foo(void); diff --git a/gcc/testsuite/gcc.dg/pch/empty.c b/gcc/testsuite/gcc.dg/pch/empty.c new file mode 100644 index 000000000..7daa7ca7f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/empty.c @@ -0,0 +1,8 @@ +/* Yes, it's called "empty" because it has no contents at all. + Even this comment goes here, rather than in empty.h. */ +#include "empty.h" + +int main(void) +{ + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pch/empty.hs b/gcc/testsuite/gcc.dg/pch/empty.hs new file mode 100644 index 000000000..e69de29bb diff --git a/gcc/testsuite/gcc.dg/pch/except-1.c b/gcc/testsuite/gcc.dg/pch/except-1.c new file mode 100644 index 000000000..f81b098d7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/except-1.c @@ -0,0 +1,7 @@ +/* { dg-options "-fexceptions -I." } */ +#include "except-1.h" + +int main(void) +{ + return foo(1); +} diff --git a/gcc/testsuite/gcc.dg/pch/except-1.hs b/gcc/testsuite/gcc.dg/pch/except-1.hs new file mode 100644 index 000000000..33a893d15 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/except-1.hs @@ -0,0 +1,6 @@ +/* { dg-options "-fexceptions" } */ +extern inline int +foo(int a) +{ + return a + 1; +} diff --git a/gcc/testsuite/gcc.dg/pch/global-1.c b/gcc/testsuite/gcc.dg/pch/global-1.c new file mode 100644 index 000000000..c1cff5f1c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/global-1.c @@ -0,0 +1,2 @@ +#include "global-1.h" +const int bar = 3; diff --git a/gcc/testsuite/gcc.dg/pch/global-1.hs b/gcc/testsuite/gcc.dg/pch/global-1.hs new file mode 100644 index 000000000..26efffcb2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/global-1.hs @@ -0,0 +1 @@ +const int foo = 2; diff --git a/gcc/testsuite/gcc.dg/pch/import-1.c b/gcc/testsuite/gcc.dg/pch/import-1.c new file mode 100644 index 000000000..b036217f8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-1.c @@ -0,0 +1,21 @@ +/* { dg-options "-I. -I $srcdir/gcc.dg/pch -Wno-deprecated" } */ +#include "import-1.h" +#include "import-1a.h" +#import "import-1b.h" +#include "import-1c.h" + +#ifndef IMPORT_1A +IMPORT_1A not defined +#endif + +#ifndef IMPORT_1B +IMPORT_1B not defined +#endif + +#ifndef IMPORT_1C +IMPORT_1C not defined +#endif + +#ifndef IMPORT_1 +IMPORT_1 not defined +#endif diff --git a/gcc/testsuite/gcc.dg/pch/import-1.hs b/gcc/testsuite/gcc.dg/pch/import-1.hs new file mode 100644 index 000000000..a59099d44 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-1.hs @@ -0,0 +1,5 @@ +/* { dg-options "-I. -I $srcdir/gcc.dg/pch -Wno-deprecated" } */ +#import "import-1a.h" +#include "import-1b.h" +#include "import-1c.h" +#define IMPORT_1 diff --git a/gcc/testsuite/gcc.dg/pch/import-1a.h b/gcc/testsuite/gcc.dg/pch/import-1a.h new file mode 100644 index 000000000..d65336afe --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-1a.h @@ -0,0 +1,5 @@ +#ifdef IMPORT_1A +#error import-1a failure +#endif +#define IMPORT_1A + diff --git a/gcc/testsuite/gcc.dg/pch/import-1b.h b/gcc/testsuite/gcc.dg/pch/import-1b.h new file mode 100644 index 000000000..0dd0c9a9d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-1b.h @@ -0,0 +1,4 @@ +#ifdef IMPORT_1B +#error import-1b failure +#endif +#define IMPORT_1B diff --git a/gcc/testsuite/gcc.dg/pch/import-1c.h b/gcc/testsuite/gcc.dg/pch/import-1c.h new file mode 100644 index 000000000..1c16356cf --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-1c.h @@ -0,0 +1,6 @@ +#pragma once +#ifdef IMPORT_1C +#error import-1c failure +#endif +#define IMPORT_1C + diff --git a/gcc/testsuite/gcc.dg/pch/import-2.c b/gcc/testsuite/gcc.dg/pch/import-2.c new file mode 100644 index 000000000..c037e3d1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-2.c @@ -0,0 +1,8 @@ +/* { dg-options "-I. -I $srcdir/gcc.dg/pch/include -Wno-deprecated" } */ + +#include "import-2.h" +#import "import-2b.h" + +int main(int argc, char **argv) { + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pch/import-2.hs b/gcc/testsuite/gcc.dg/pch/import-2.hs new file mode 100644 index 000000000..8a725de14 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/import-2.hs @@ -0,0 +1,4 @@ +/* { dg-options "-I $srcdir/gcc.dg/pch/include -Wno-deprecated" } */ + +#import "import-2b.h" +#import "import-2a.h" diff --git a/gcc/testsuite/gcc.dg/pch/include/import-2a.h b/gcc/testsuite/gcc.dg/pch/include/import-2a.h new file mode 100644 index 000000000..bb3250cf6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/include/import-2a.h @@ -0,0 +1 @@ +#import "import-2b.h" diff --git a/gcc/testsuite/gcc.dg/pch/include/import-2b.h b/gcc/testsuite/gcc.dg/pch/include/import-2b.h new file mode 100644 index 000000000..ad10c6271 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/include/import-2b.h @@ -0,0 +1 @@ +int dup = 9; diff --git a/gcc/testsuite/gcc.dg/pch/inline-1.c b/gcc/testsuite/gcc.dg/pch/inline-1.c new file mode 100644 index 000000000..38fad39c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-1.c @@ -0,0 +1,10 @@ +#include "inline-1.h" +int bar(int a, int b) +{ + return foo(a) + b; +} + +int baz(void) +{ + return foo(3); +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-1.hs b/gcc/testsuite/gcc.dg/pch/inline-1.hs new file mode 100644 index 000000000..e8f1d6f13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-1.hs @@ -0,0 +1,5 @@ +extern inline int +foo(int a) +{ + return a * 2 + 1; +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-2.c b/gcc/testsuite/gcc.dg/pch/inline-2.c new file mode 100644 index 000000000..59b238a3b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-2.c @@ -0,0 +1,12 @@ +#include "inline-2.h" +extern inline char +bar(int a) +{ + return foo(a)[0]; +} + +extern inline char +baz(void) +{ + return foo(0)[0]; +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-2.hs b/gcc/testsuite/gcc.dg/pch/inline-2.hs new file mode 100644 index 000000000..7d90c63de --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-2.hs @@ -0,0 +1,5 @@ +extern inline const char * +foo(int a) +{ + return "abcdefgh"+a; +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-3.c b/gcc/testsuite/gcc.dg/pch/inline-3.c new file mode 100644 index 000000000..fadaf0785 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-3.c @@ -0,0 +1,5 @@ +#include "inline-3.h" +unsigned bar(double d) +{ + foo (d); +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-3.hs b/gcc/testsuite/gcc.dg/pch/inline-3.hs new file mode 100644 index 000000000..ef2819ace --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-3.hs @@ -0,0 +1,7 @@ +extern double rint(double); +extern double fmod (double, double); +static inline unsigned foo(double d) { + double a; + a = rint(d); + return (unsigned)(fmod(a, (double)0xFFFFFFFF) + ((d - a) * 0xFFFFFFFF)); +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-4.c b/gcc/testsuite/gcc.dg/pch/inline-4.c new file mode 100644 index 000000000..60e35aa62 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-4.c @@ -0,0 +1,6 @@ +#include "inline-4.h" +extern int printf (const char *, ...); +int main(void) { + printf (getstring()); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pch/inline-4.hs b/gcc/testsuite/gcc.dg/pch/inline-4.hs new file mode 100644 index 000000000..31a5069ff --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/inline-4.hs @@ -0,0 +1,4 @@ +static inline char *getstring(void) +{ + return "hello"; +} diff --git a/gcc/testsuite/gcc.dg/pch/macro-1.c b/gcc/testsuite/gcc.dg/pch/macro-1.c new file mode 100644 index 000000000..70546bb09 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-1.c @@ -0,0 +1,6 @@ +#include "macro-1.h" + +int main(void) +{ + return DEFINED_VALUE + 1 - DEFINED_PARAM (3); +} diff --git a/gcc/testsuite/gcc.dg/pch/macro-1.hs b/gcc/testsuite/gcc.dg/pch/macro-1.hs new file mode 100644 index 000000000..5d5b3f4ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-1.hs @@ -0,0 +1,2 @@ +#define DEFINED_VALUE 3 +#define DEFINED_PARAM(x) (x+1) diff --git a/gcc/testsuite/gcc.dg/pch/macro-2.c b/gcc/testsuite/gcc.dg/pch/macro-2.c new file mode 100644 index 000000000..e2d965ff1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-2.c @@ -0,0 +1,8 @@ +#define DEFINED_VALUE_2 3 + +#include "macro-2.h" + +int main(void) +{ + return DEFINED_VALUE - DEFINED_VALUE_2; +} diff --git a/gcc/testsuite/gcc.dg/pch/macro-2.hs b/gcc/testsuite/gcc.dg/pch/macro-2.hs new file mode 100644 index 000000000..6152a84a8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-2.hs @@ -0,0 +1,2 @@ +#define DEFINED_VALUE 3 + diff --git a/gcc/testsuite/gcc.dg/pch/macro-3.c b/gcc/testsuite/gcc.dg/pch/macro-3.c new file mode 100644 index 000000000..493d95498 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-3.c @@ -0,0 +1,8 @@ +#define DEFINED_FUNC_2(x) (3 + (x)) + +#include "macro-3.h" + +int main(void) +{ + return DEFINED_FUNC (1) - DEFINED_FUNC_2 (-1); +} diff --git a/gcc/testsuite/gcc.dg/pch/macro-3.hs b/gcc/testsuite/gcc.dg/pch/macro-3.hs new file mode 100644 index 000000000..d394792a3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-3.hs @@ -0,0 +1,2 @@ +#define DEFINED_FUNC(x) 3 - (x) + diff --git a/gcc/testsuite/gcc.dg/pch/macro-4.c b/gcc/testsuite/gcc.dg/pch/macro-4.c new file mode 100644 index 000000000..1c199fa6e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-4.c @@ -0,0 +1,8 @@ +#define DEFN aa + bb + +#include "macro-4.h" + +int foo(int aa, int bb) +{ + return DEFN; +} diff --git a/gcc/testsuite/gcc.dg/pch/macro-4.hs b/gcc/testsuite/gcc.dg/pch/macro-4.hs new file mode 100644 index 000000000..5af162d63 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/macro-4.hs @@ -0,0 +1 @@ +/* No content! */ diff --git a/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc/testsuite/gcc.dg/pch/pch.exp new file mode 100644 index 000000000..132e595cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/pch.exp @@ -0,0 +1,64 @@ +# Copyright (C) 1997, 2002, 2003, 2007, 2009, 2010 +# 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 3 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 GCC; see the file COPYING3. If not see +# . + +# GCC testsuite for precompiled header interaction, +# that uses the `dg.exp' driver. + +# Load support procs. +load_lib gcc-dg.exp +load_lib dg-pch.exp +load_lib torture-options.exp + +# Initialize `dg'. +dg-init +torture-init +set-torture-options $DG_TORTURE_OPTIONS + +set old_dg_do_what_default "${dg-do-what-default}" + +# Main loop. +foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { + global torture_without_loops + + # We don't try to use the loop-optimizing options, since they are highly + # unlikely to make any difference to PCH. However, we do want to + # add -O0 -g, since users who want PCH usually want debugging and quick + # compiles. + dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h" +} + +set test "largefile.c" +set testh "largefile.hs" +set f [open $test w] +puts $f "/* { dg-timeout-factor 4.0 } */" +set v 0 +for { set v 0 } { $v < 10000 } { incr v } { + puts $f "#define MACRO_${v} \"1234567890\" \"$v\"" +} +puts $f "#include \"largefile.h\"" +close $f +set f [open $testh w] +close $f +dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h" +file delete $test +file delete $testh + +set dg-do-what-default "$old_dg_do_what_default" + +# All done. +torture-finish +dg-finish diff --git a/gcc/testsuite/gcc.dg/pch/pushpop-1.c b/gcc/testsuite/gcc.dg/pch/pushpop-1.c new file mode 100644 index 000000000..c093e575a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/pushpop-1.c @@ -0,0 +1,11 @@ +#include "pushpop-1.hs" + +#if FOO != 2 +#error FOO != 2 +#endif +#pragma pop_macro("FOO") + +#if FOO != 1 +#error FOR != 1 +#endif + diff --git a/gcc/testsuite/gcc.dg/pch/pushpop-1.hs b/gcc/testsuite/gcc.dg/pch/pushpop-1.hs new file mode 100644 index 000000000..e97a4f33a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/pushpop-1.hs @@ -0,0 +1,5 @@ +#define FOO 1 +#pragma push_macro ("FOO") +#undef FOO +#define FOO 2 + diff --git a/gcc/testsuite/gcc.dg/pch/save-temps-1.c b/gcc/testsuite/gcc.dg/pch/save-temps-1.c new file mode 100644 index 000000000..9a5e7223c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/save-temps-1.c @@ -0,0 +1,9 @@ +/* { dg-options "-I. -save-temps" } */ +#include "save-temps-1.h" +#ifndef T +#error T not defined +#endif +#include +int x; + +/* { dg-final { cleanup-saved-temps ".s" } } */ diff --git a/gcc/testsuite/gcc.dg/pch/save-temps-1.hs b/gcc/testsuite/gcc.dg/pch/save-temps-1.hs new file mode 100644 index 000000000..2fe5a3ee7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/save-temps-1.hs @@ -0,0 +1,5 @@ +#define T 123 +int foo (void) +{ + return 3; +} diff --git a/gcc/testsuite/gcc.dg/pch/static-1.c b/gcc/testsuite/gcc.dg/pch/static-1.c new file mode 100644 index 000000000..33a139120 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/static-1.c @@ -0,0 +1,6 @@ +#include "static-1.h" +static int bar(void) +{ + static int counter; + return counter++; +} diff --git a/gcc/testsuite/gcc.dg/pch/static-1.hs b/gcc/testsuite/gcc.dg/pch/static-1.hs new file mode 100644 index 000000000..08cc4395d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/static-1.hs @@ -0,0 +1,5 @@ +static int foo(void) +{ + static int counter; + return counter++; +} diff --git a/gcc/testsuite/gcc.dg/pch/static-2.c b/gcc/testsuite/gcc.dg/pch/static-2.c new file mode 100644 index 000000000..23e9af126 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/static-2.c @@ -0,0 +1,6 @@ +#include "static-2.h" +int bar(void) +{ + static int counter; + return counter++; +} diff --git a/gcc/testsuite/gcc.dg/pch/static-2.hs b/gcc/testsuite/gcc.dg/pch/static-2.hs new file mode 100644 index 000000000..08cc4395d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/static-2.hs @@ -0,0 +1,5 @@ +static int foo(void) +{ + static int counter; + return counter++; +} diff --git a/gcc/testsuite/gcc.dg/pch/static-3.c b/gcc/testsuite/gcc.dg/pch/static-3.c new file mode 100644 index 000000000..eae0ab078 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/static-3.c @@ -0,0 +1,8 @@ +#include "static-3.h" +int bar(int *a) +{ + int i, tot; + for (i = tot = 0; i < 100; i++) + tot += a[i]; + return tot; +} diff --git a/gcc/testsuite/gcc.dg/pch/static-3.hs b/gcc/testsuite/gcc.dg/pch/static-3.hs new file mode 100644 index 000000000..b881945f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/static-3.hs @@ -0,0 +1,7 @@ +static int foo(int *a) +{ + int i, tot; + for (i = tot = 0; i < 100; i++) + tot += a[i]; + return tot; +} diff --git a/gcc/testsuite/gcc.dg/pch/struct-1.c b/gcc/testsuite/gcc.dg/pch/struct-1.c new file mode 100644 index 000000000..9559c07e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/struct-1.c @@ -0,0 +1,16 @@ +#include "struct-1.h" + +struct ChainSearchRecord { + int identity; +}; +typedef struct ChainSearchRecord ChainSearchRecord; +void foo (ChainSearchPtr s) +{ +#if(__SIZEOF_INT__ >= 4) + s->identity = 0x6a73616d; +#else + s->identity = 0x616d; +#endif +} + + diff --git a/gcc/testsuite/gcc.dg/pch/struct-1.hs b/gcc/testsuite/gcc.dg/pch/struct-1.hs new file mode 100644 index 000000000..055353a8f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/struct-1.hs @@ -0,0 +1,3 @@ +struct ChainSearchRecord; +typedef struct ChainSearchRecord *ChainSearchPtr; + diff --git a/gcc/testsuite/gcc.dg/pch/system-1.c b/gcc/testsuite/gcc.dg/pch/system-1.c new file mode 100644 index 000000000..9fde1365d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/system-1.c @@ -0,0 +1,6 @@ +#include "system-1.h" +int main(void) +{ + puts ("hello world!"); + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/pch/system-1.hs b/gcc/testsuite/gcc.dg/pch/system-1.hs new file mode 100644 index 000000000..fbfff34ed --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/system-1.hs @@ -0,0 +1,2 @@ +#include +#include diff --git a/gcc/testsuite/gcc.dg/pch/valid-1.c b/gcc/testsuite/gcc.dg/pch/valid-1.c new file mode 100644 index 000000000..b7f22d0dc --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-1.c @@ -0,0 +1,8 @@ +/* { dg-options "-I. -Winvalid-pch -g" } */ + +#include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */ +/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */ +/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ + +int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-1.hs b/gcc/testsuite/gcc.dg/pch/valid-1.hs new file mode 100644 index 000000000..e1ed11df4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-1.hs @@ -0,0 +1,3 @@ +/* { dg-options "-I. -Winvalid-pch -g0" } */ + +extern int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-1b.c b/gcc/testsuite/gcc.dg/pch/valid-1b.c new file mode 100644 index 000000000..a2709967c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-1b.c @@ -0,0 +1,5 @@ +/* { dg-options "-I. -Winvalid-pch -g0" } */ + +#include "valid-1b.h" + +int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-1b.hs b/gcc/testsuite/gcc.dg/pch/valid-1b.hs new file mode 100644 index 000000000..6dc358735 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-1b.hs @@ -0,0 +1,3 @@ +/* { dg-options "-I. -Winvalid-pch -g" } */ + +extern int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-2.c b/gcc/testsuite/gcc.dg/pch/valid-2.c new file mode 100644 index 000000000..3d8cb1427 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-2.c @@ -0,0 +1,7 @@ +/* { dg-options "-I. -Winvalid-pch -fexceptions" } */ + +#include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */ +/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */ +/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ +int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-2.hs b/gcc/testsuite/gcc.dg/pch/valid-2.hs new file mode 100644 index 000000000..2497af651 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-2.hs @@ -0,0 +1 @@ +extern int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-4.c b/gcc/testsuite/gcc.dg/pch/valid-4.c new file mode 100644 index 000000000..e4419b570 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-4.c @@ -0,0 +1,6 @@ +/* { dg-options "-I. -Winvalid-pch -Wtrigraphs" } */ + +#include "valid-4.h" + +char * x = "??/"; /* { dg-warning "trigraph" } */ + diff --git a/gcc/testsuite/gcc.dg/pch/valid-4.hs b/gcc/testsuite/gcc.dg/pch/valid-4.hs new file mode 100644 index 000000000..051c720ee --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-4.hs @@ -0,0 +1 @@ +extern char * x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-5.c b/gcc/testsuite/gcc.dg/pch/valid-5.c new file mode 100644 index 000000000..4022d0458 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-5.c @@ -0,0 +1,5 @@ +/* { dg-options "-I. -Winvalid-pch -pedantic-errors" } */ + +#include "valid-5.h" + +int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-5.hs b/gcc/testsuite/gcc.dg/pch/valid-5.hs new file mode 100644 index 000000000..2497af651 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-5.hs @@ -0,0 +1 @@ +extern int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-6.c b/gcc/testsuite/gcc.dg/pch/valid-6.c new file mode 100644 index 000000000..f111c31ae --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-6.c @@ -0,0 +1,5 @@ +/* { dg-options "-I. -Winvalid-pch -dH -pipe -fcond-mismatch" } */ + +#include "valid-6.h" + +int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-6.hs b/gcc/testsuite/gcc.dg/pch/valid-6.hs new file mode 100644 index 000000000..2497af651 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/valid-6.hs @@ -0,0 +1 @@ +extern int x; diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.c b/gcc/testsuite/gcc.dg/pch/warn-1.c new file mode 100644 index 000000000..1d31cef05 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/warn-1.c @@ -0,0 +1,14 @@ +/* { dg-options "-I. -Winvalid-pch" } */ + +#define DEFINED_VALUE 3 + +#include "warn-1.h"/* { dg-warning "not used because .DEFINED_VALUE. is defined" } */ +/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */ +/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ + + +int main(void) +{ + return DEFINED_VALUE; +} diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.hs b/gcc/testsuite/gcc.dg/pch/warn-1.hs new file mode 100644 index 000000000..460963f56 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/warn-1.hs @@ -0,0 +1,5 @@ +enum { + DEFINED_VALUE +}; + + -- cgit v1.2.3