blob: ac0f1b44cba308b98781b148eeaabf51c2fa501d [file] [log] [blame]
Chandler Carruth9c6b4f82015-05-28 01:52:38 +00001// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
2// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
3// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
Joerg Sonnenberger5c3f9d52015-09-23 20:07:56 +00004// RUN: %clang -target x86_64-apple-darwin -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
5// RUN: %clang -target x86_64-apple-darwin -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
6// RUN: %clang -target x86_64-apple-darwin -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
Dimitry Andric0cc6f472015-10-18 13:32:20 +00007// RUN: %clang -target x86_64-freebsd -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
8// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
9// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
Joerg Sonnenberger27a69a22015-09-23 20:11:00 +000010// RUN: %clang -target x86_64-netbsd -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
11// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
12// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
Chandler Carruth9c6b4f82015-05-28 01:52:38 +000013//
14// CHECK-CC1-OPENMP: "-cc1"
15// CHECK-CC1-OPENMP: "-fopenmp"
16//
17// CHECK-CC1-NO-OPENMP: "-cc1"
18// CHECK-CC1-NO-OPENMP-NOT: "-fopenmp"
19//
Chandler Carruth9c6b4f82015-05-28 01:52:38 +000020// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
Jonas Hahnfeld8ea76fa2017-04-19 13:55:39 +000021// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-RT
Chandler Carruth9c6b4f82015-05-28 01:52:38 +000022// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
23//
Joerg Sonnenberger5c3f9d52015-09-23 20:07:56 +000024// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
25// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
26// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
27//
28// RUN: %clang -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
Jonas Hahnfeld8ea76fa2017-04-19 13:55:39 +000029// RUN: %clang -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
Joerg Sonnenberger5c3f9d52015-09-23 20:07:56 +000030// RUN: %clang -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
31//
32// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
33// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
34// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
35//
Jonas Hahnfeld8ea76fa2017-04-19 13:55:39 +000036// RUN: %clang -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
37// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
38// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
Joerg Sonnenberger27a69a22015-09-23 20:11:00 +000039//
Dimitry Andric0cc6f472015-10-18 13:32:20 +000040// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
41// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
42// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
43//
Jonas Hahnfeld8ea76fa2017-04-19 13:55:39 +000044// RUN: %clang -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
45// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
46// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
47//
Joerg Sonnenberger27a69a22015-09-23 20:11:00 +000048// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
49// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
50// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
51//
Chandler Carruth9c6b4f82015-05-28 01:52:38 +000052// CHECK-LD-OMP: "{{.*}}ld{{(.exe)?}}"
53// CHECK-LD-OMP: "-lomp"
54//
55// CHECK-LD-GOMP: "{{.*}}ld{{(.exe)?}}"
56// CHECK-LD-GOMP: "-lgomp"
Jonas Hahnfeld8ea76fa2017-04-19 13:55:39 +000057// CHECK-LD-GOMP-RT: "-lrt"
58// CHECK-LD-GOMP-NO-RT-NOT: "-lrt"
Chandler Carruth9c6b4f82015-05-28 01:52:38 +000059//
60// CHECK-LD-IOMP5: "{{.*}}ld{{(.exe)?}}"
61// CHECK-LD-IOMP5: "-liomp5"
Chandler Carruth25c6a222015-05-28 21:20:14 +000062//
Joerg Sonnenberger5c3f9d52015-09-23 20:07:56 +000063// CHECK-NO-OMP: "{{.*}}ld{{(.exe)?}}"
64// CHECK-NO-OMP-NOT: "-lomp"
65//
66// CHECK-NO-GOMP: "{{.*}}ld{{(.exe)?}}"
67// CHECK-NO-GOMP-NOT: "-lgomp"
68//
69// CHECK-NO-IOMP5: "{{.*}}ld{{(.exe)?}}"
70// CHECK-NO-IOMP5-NOT: "-liomp5"
71//
Chandler Carruth25c6a222015-05-28 21:20:14 +000072// We'd like to check that the default is sane, but until we have the ability
73// to *always* semantically analyze OpenMP without always generating runtime
74// calls (in the event of an unsupported runtime), we don't have a good way to
75// test the CC1 invocation. Instead, just ensure we do eventually link *some*
76// OpenMP runtime.
77//
78// RUN: %clang -target x86_64-linux-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
Joerg Sonnenberger5c3f9d52015-09-23 20:07:56 +000079// RUN: %clang -target x86_64-darwin -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
Dimitry Andric0cc6f472015-10-18 13:32:20 +000080// RUN: %clang -target x86_64-freebsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
Joerg Sonnenberger27a69a22015-09-23 20:11:00 +000081// RUN: %clang -target x86_64-netbsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
Chandler Carruth25c6a222015-05-28 21:20:14 +000082//
83// CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}"
84// CHECK-LD-ANY: "-l{{(omp|gomp|iomp5)}}"