summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/pch
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pch')
-rw-r--r--gcc/testsuite/gcc.dg/pch/pch.exp7
-rw-r--r--gcc/testsuite/gcc.dg/pch/static-3.c8
-rw-r--r--gcc/testsuite/gcc.dg/pch/static-3.hs7
3 files changed, 20 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc/testsuite/gcc.dg/pch/pch.exp
index 7a5aacaac56..543d6147d7b 100644
--- a/gcc/testsuite/gcc.dg/pch/pch.exp
+++ b/gcc/testsuite/gcc.dg/pch/pch.exp
@@ -41,8 +41,11 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
catch { file delete "$bname.s-gch" }
# We don't try to use the loop-optimizing options, since they are highly
- # unlikely to make any difference to PCH.
- foreach flags $torture_without_loops {
+ # 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.
+ set pch_torture [concat [list {-O0 -g}] $torture_without_loops]
+ foreach flags $pch_torture {
verbose "Testing $nshort, $flags" 1
# For the header files, the default is to precompile.
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 00000000000..eae0ab07805
--- /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 00000000000..b881945f5ea
--- /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;
+}
OpenPOWER on IntegriCloud