Add -fopenmp -cc1 option and wire it up to define _OPENMP, from Alexey Bataev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172509 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/OpenMP/predefined_macro.c b/test/OpenMP/predefined_macro.c
new file mode 100644
index 0000000..e18c3d2
--- /dev/null
+++ b/test/OpenMP/predefined_macro.c
@@ -0,0 +1,17 @@
+// 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
+#ifdef _OPENMP
+#error "_OPENMP macro is defined without -fopenmp option"
+#endif // _OPENMP
+#endif // FOPENMP
+