summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-06 11:33:42 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-06 11:33:42 +0000
commit2c694d44b2428673f2ec4177c57f6efda4c91adb (patch)
tree3c306927913661e1e914dc99031a45c1684aaff8 /gcc/testsuite/gcc.dg/cpp
parent06e10d4a71e4249784f6c0c39a814aefdd275f09 (diff)
downloadgcc-2c694d44b2428673f2ec4177c57f6efda4c91adb.tar.gz
PR preprocessor/48532
libcpp/ * directives.c (do_pragma): Don't forget the invocation location when parsing the pragma name of a namespaced pragma directive. gcc/testsuite/ * gcc.dg/cpp/pragma-3.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174694 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pragma-3.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/pragma-3.c b/gcc/testsuite/gcc.dg/cpp/pragma-3.c
new file mode 100644
index 00000000000..9afc3919a8d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pragma-3.c
@@ -0,0 +1,39 @@
+/*
+ { dg-options "-fopenmp" }
+ { dg-do preprocess }
+ */
+
+void foo (void)
+{
+ int i1, j1, k1;
+#define p parallel
+#define P(x) private (x##1)
+#define S(x) shared (x##1)
+#define F(x) firstprivate (x##1)
+#pragma omp \
+ p \
+ P(i) \
+ S(j) \
+ F(k)
+ ;
+}
+
+/*
+ The bug here was that we had a line like:
+ # 33554432 "../../gcc/testsuite/gcc.dg/cpp/pragma-3.c"
+
+ Before line:
+
+ #pragma omp parallel private (i1) shared (j1) firstprivate (k1)
+
+ Note the very big integer there. Normally we should just have
+ this:
+
+ # 13 "../../gcc/testsuite/gcc.dg/cpp/pragma-3.c"
+ #pragma omp parallel private (i1) shared (j1) firstprivate (k1)
+
+ So let's check that we have no line with a number of 3 or more
+ digit after #:
+
+ { dg-final { scan-file-not pragma-3.i "# \[0-9\]{3} \[^\n\r\]*pragma-3.c" } }
+*/