Chandler Carruth | 0153800 | 2013-01-17 13:19:29 +0000 | [diff] [blame] | 1 | // Test the that the driver produces reasonable linker invocations with |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame^] | 2 | // -fopenmp or -fopenmp=libiomp5|libgomp. |
Chandler Carruth | 0153800 | 2013-01-17 13:19:29 +0000 | [diff] [blame] | 3 | // |
| 4 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 5 | // RUN: -fopenmp -target i386-unknown-linux \ |
| 6 | // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s |
| 7 | // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" |
| 8 | // CHECK-LD-32: "-lgomp" "-lrt" "-lgcc" |
| 9 | // CHECK-LD-32: "-lpthread" "-lc" |
| 10 | // |
| 11 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 12 | // RUN: -fopenmp -target x86_64-unknown-linux \ |
| 13 | // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s |
| 14 | // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" |
| 15 | // CHECK-LD-64: "-lgomp" "-lrt" "-lgcc" |
| 16 | // CHECK-LD-64: "-lpthread" "-lc" |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame^] | 17 | // |
| 18 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 19 | // RUN: -fopenmp=libgomp -target i386-unknown-linux \ |
| 20 | // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s |
| 21 | // CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}" |
| 22 | // CHECK-GOMP-LD-32: "-lgomp" "-lrt" "-lgcc" |
| 23 | // CHECK-GOMP-LD-32: "-lpthread" "-lc" |
| 24 | // |
| 25 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 26 | // RUN: -fopenmp=libgomp -target x86_64-unknown-linux \ |
| 27 | // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s |
| 28 | // CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}" |
| 29 | // CHECK-GOMP-LD-64: "-lgomp" "-lrt" "-lgcc" |
| 30 | // CHECK-GOMP-LD-64: "-lpthread" "-lc" |
| 31 | // |
| 32 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 33 | // RUN: -fopenmp=libiomp5 -target i386-unknown-linux \ |
| 34 | // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s |
| 35 | // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}" |
| 36 | // CHECK-IOMP5-LD-32: "-liomp5" |
| 37 | // |
| 38 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 39 | // RUN: -fopenmp=libiomp5 -target x86_64-unknown-linux \ |
| 40 | // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s |
| 41 | // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" |
| 42 | // CHECK-IOMP5-LD-64: "-liomp5" |
| 43 | // |
| 44 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 45 | // RUN: -fopenmp=lib -target i386-unknown-linux \ |
| 46 | // RUN: | FileCheck --check-prefix=CHECK-LIB-LD-32 %s |
| 47 | // CHECK-LIB-LD-32: error: unsupported argument 'lib' to option 'fopenmp=' |
| 48 | // |
| 49 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 50 | // RUN: -fopenmp=lib -target x86_64-unknown-linux \ |
| 51 | // RUN: | FileCheck --check-prefix=CHECK-LIB-LD-64 %s |
| 52 | // CHECK-LIB-LD-64: error: unsupported argument 'lib' to option 'fopenmp=' |
| 53 | // |
| 54 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 55 | // RUN: -fopenmp -fopenmp=libiomp5 -target i386-unknown-linux \ |
| 56 | // RUN: | FileCheck --check-prefix=CHECK-LD-WARN-32 %s |
| 57 | // CHECK-LD-WARN-32: warning: argument unused during compilation: '-fopenmp=libiomp5' |
| 58 | // CHECK-LD-WARN-32: "{{.*}}ld{{(.exe)?}}" |
| 59 | // CHECK-LD-WARN-32: "-lgomp" "-lrt" "-lgcc" |
| 60 | // CHECK-LD-WARN-32: "-lpthread" "-lc" |
| 61 | // |
| 62 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 63 | // RUN: -fopenmp -fopenmp=libiomp5 -target x86_64-unknown-linux \ |
| 64 | // RUN: | FileCheck --check-prefix=CHECK-LD-WARN-64 %s |
| 65 | // CHECK-LD-WARN-64: warning: argument unused during compilation: '-fopenmp=libiomp5' |
| 66 | // CHECK-LD-WARN-64: "{{.*}}ld{{(.exe)?}}" |
| 67 | // CHECK-LD-WARN-64: "-lgomp" "-lrt" "-lgcc" |
| 68 | // CHECK-LD-WARN-64: "-lpthread" "-lc" |
| 69 | // |