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 | db39021 | 2015-05-20 04:24:19 +0000 | [diff] [blame] | 2 | // -fopenmp or -fopenmp|libgomp. |
Chandler Carruth | 0153800 | 2013-01-17 13:19:29 +0000 | [diff] [blame] | 3 | // |
Richard Smith | 31d1de2 | 2015-05-20 22:48:44 +0000 | [diff] [blame] | 4 | // FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time. |
| 5 | // |
Chandler Carruth | 0153800 | 2013-01-17 13:19:29 +0000 | [diff] [blame] | 6 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 7 | // RUN: -fopenmp -target i386-unknown-linux \ |
| 8 | // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s |
| 9 | // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" |
Richard Smith | 31d1de2 | 2015-05-20 22:48:44 +0000 | [diff] [blame] | 10 | // CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" |
Chandler Carruth | 0153800 | 2013-01-17 13:19:29 +0000 | [diff] [blame] | 11 | // CHECK-LD-32: "-lpthread" "-lc" |
| 12 | // |
| 13 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 14 | // RUN: -fopenmp -target x86_64-unknown-linux \ |
| 15 | // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s |
| 16 | // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" |
Richard Smith | 31d1de2 | 2015-05-20 22:48:44 +0000 | [diff] [blame] | 17 | // CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" |
Chandler Carruth | 0153800 | 2013-01-17 13:19:29 +0000 | [diff] [blame] | 18 | // CHECK-LD-64: "-lpthread" "-lc" |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 19 | // |
| 20 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 21 | // RUN: -fopenmp=libgomp -target i386-unknown-linux \ |
| 22 | // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s |
| 23 | // CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}" |
| 24 | // CHECK-GOMP-LD-32: "-lgomp" "-lrt" "-lgcc" |
| 25 | // CHECK-GOMP-LD-32: "-lpthread" "-lc" |
| 26 | // |
| 27 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 28 | // RUN: -fopenmp=libgomp -target x86_64-unknown-linux \ |
| 29 | // RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s |
| 30 | // CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}" |
| 31 | // CHECK-GOMP-LD-64: "-lgomp" "-lrt" "-lgcc" |
| 32 | // CHECK-GOMP-LD-64: "-lpthread" "-lc" |
| 33 | // |
| 34 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Alexey Bataev | db39021 | 2015-05-20 04:24:19 +0000 | [diff] [blame] | 35 | // RUN: -fopenmp -target i386-unknown-linux \ |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 36 | // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s |
| 37 | // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}" |
Richard Smith | 31d1de2 | 2015-05-20 22:48:44 +0000 | [diff] [blame] | 38 | // CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" |
Alexey Bataev | 648250a | 2014-03-07 07:43:52 +0000 | [diff] [blame] | 39 | // CHECK-IOMP5-LD-32: "-lpthread" "-lc" |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 40 | // |
| 41 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Alexey Bataev | db39021 | 2015-05-20 04:24:19 +0000 | [diff] [blame] | 42 | // RUN: -fopenmp -target x86_64-unknown-linux \ |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 43 | // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s |
| 44 | // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" |
Richard Smith | 31d1de2 | 2015-05-20 22:48:44 +0000 | [diff] [blame] | 45 | // CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc" |
Alexey Bataev | 648250a | 2014-03-07 07:43:52 +0000 | [diff] [blame] | 46 | // CHECK-IOMP5-LD-64: "-lpthread" "-lc" |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 47 | // |
| 48 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 49 | // RUN: -fopenmp=lib -target i386-unknown-linux \ |
| 50 | // RUN: | FileCheck --check-prefix=CHECK-LIB-LD-32 %s |
| 51 | // CHECK-LIB-LD-32: error: unsupported argument 'lib' to option 'fopenmp=' |
| 52 | // |
| 53 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 54 | // RUN: -fopenmp=lib -target x86_64-unknown-linux \ |
| 55 | // RUN: | FileCheck --check-prefix=CHECK-LIB-LD-64 %s |
| 56 | // CHECK-LIB-LD-64: error: unsupported argument 'lib' to option 'fopenmp=' |
| 57 | // |
| 58 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Alexey Bataev | db39021 | 2015-05-20 04:24:19 +0000 | [diff] [blame] | 59 | // RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \ |
| 60 | // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s |
| 61 | // CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}" |
| 62 | // CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt" "-lgcc" |
| 63 | // CHECK-LD-OVERRIDE-32: "-lpthread" "-lc" |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 64 | // |
| 65 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
Alexey Bataev | db39021 | 2015-05-20 04:24:19 +0000 | [diff] [blame] | 66 | // RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \ |
| 67 | // RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s |
| 68 | // CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}" |
| 69 | // CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt" "-lgcc" |
| 70 | // CHECK-LD-OVERRIDE-64: "-lpthread" "-lc" |
Alexey Bataev | 186b28a | 2014-03-06 05:43:53 +0000 | [diff] [blame] | 71 | // |
Alexey Bataev | c7e8435 | 2015-08-19 04:49:01 +0000 | [diff] [blame] | 72 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 73 | // RUN: -fopenmp=libomp -target x86_64-msvc-win32 \ |
| 74 | // RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s |
| 75 | // CHECK-MSVC-LINK-64: link.exe |
| 76 | // CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib |
| 77 | // CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcompd.lib |
| 78 | // CHECK-MSVC-LINK-64-SAME: -libpath:{{.+}}/../lib |
| 79 | // CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib |
| 80 | // |
| 81 | // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ |
| 82 | // RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 \ |
| 83 | // RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s |
| 84 | // CHECK-MSVC-ILINK-64: link.exe |
| 85 | // CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcomp.lib |
| 86 | // CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcompd.lib |
| 87 | // CHECK-MSVC-ILINK-64-SAME: -libpath:{{.+}}/../lib |
| 88 | // CHECK-MSVC-ILINK-64-SAME: -defaultlib:libiomp5md.lib |
| 89 | // |