aboutsummaryrefslogtreecommitdiff
path: root/test/OpenMP/predefined_macro.c
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2013-03-22 06:34:35 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2013-03-22 06:34:35 +0000
commitc640058aa7f224a71ce3b1d2601d84e1b57f82d3 (patch)
tree9b76815ba1471c89d54aee2255d56e0d513c8049 /test/OpenMP/predefined_macro.c
parent9bb4a0c195eda6e034c467a63b9ada2209a6df3f (diff)
OpenMP threadprivate directive parsing and semantic analysis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/predefined_macro.c')
-rw-r--r--test/OpenMP/predefined_macro.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/OpenMP/predefined_macro.c b/test/OpenMP/predefined_macro.c
index d6ab853c34..cf6c0cc611 100644
--- a/test/OpenMP/predefined_macro.c
+++ b/test/OpenMP/predefined_macro.c
@@ -7,6 +7,23 @@
#error "No _OPENMP macro is defined with -fopenmp option"
#elsif _OPENMP != 201107
#error "_OPENMP has incorrect value"
+#endif //_OPENMP
+#else
+// No -fopenmp option is specified
+#ifdef _OPENMP
+#error "_OPENMP macro is defined without -fopenmp option"
+#endif // _OPENMP
+#endif // FOPENMP
+
+// RUN: %clang_cc1 -fopenmp -verify -DFOPENMP -o - %s
+// RUN: %clang_cc1 -verify -o - %s
+// expected-no-diagnostics
+#ifdef FOPENMP
+// -fopenmp option is specified
+#ifndef _OPENMP
+#error "No _OPENMP macro is defined with -fopenmp option"
+#elsif _OPENMP != 201107
+#error "_OPENMP has incorrect value"
#endif // _OPENMP
#else
// No -fopenmp option is specified