summaryrefslogtreecommitdiff
path: root/test/Driver/fopenmp.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-09 19:08:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-09 19:08:19 +0000
commit798321d8eb5630cd4a8f490a4f25e32ef195fb07 (patch)
treea59f5569ef36d00388c0428426abef26aa9105b6 /test/Driver/fopenmp.c
parent5e20cdd81c44a443562a09007668ffdf76c455af (diff)
Diffstat (limited to 'test/Driver/fopenmp.c')
-rw-r--r--test/Driver/fopenmp.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Driver/fopenmp.c b/test/Driver/fopenmp.c
new file mode 100644
index 000000000000..36c856d8820e
--- /dev/null
+++ b/test/Driver/fopenmp.c
@@ -0,0 +1,33 @@
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+//
+// CHECK-CC1-OPENMP: "-cc1"
+// CHECK-CC1-OPENMP: "-fopenmp"
+//
+// CHECK-CC1-NO-OPENMP: "-cc1"
+// CHECK-CC1-NO-OPENMP-NOT: "-fopenmp"
+//
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
+//
+// CHECK-LD-OMP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-OMP: "-lomp"
+//
+// CHECK-LD-GOMP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-GOMP: "-lgomp"
+//
+// CHECK-LD-IOMP5: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-IOMP5: "-liomp5"
+//
+// We'd like to check that the default is sane, but until we have the ability
+// to *always* semantically analyze OpenMP without always generating runtime
+// calls (in the event of an unsupported runtime), we don't have a good way to
+// test the CC1 invocation. Instead, just ensure we do eventually link *some*
+// OpenMP runtime.
+//
+// RUN: %clang -target x86_64-linux-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
+//
+// CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-ANY: "-l{{(omp|gomp|iomp5)}}"