1 // Test the that the driver produces reasonable linker invocations with 2 // -fopenmp or -fopenmp=libiomp5|libgomp. 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" 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" "-lgcc" 37 // CHECK-IOMP5-LD-32: "-lpthread" "-lc" 38 // 39 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 40 // RUN: -fopenmp=libiomp5 -target x86_64-unknown-linux \ 41 // RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s 42 // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}" 43 // CHECK-IOMP5-LD-64: "-liomp5" "-lgcc" 44 // CHECK-IOMP5-LD-64: "-lpthread" "-lc" 45 // 46 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 47 // RUN: -fopenmp=lib -target i386-unknown-linux \ 48 // RUN: | FileCheck --check-prefix=CHECK-LIB-LD-32 %s 49 // CHECK-LIB-LD-32: error: unsupported argument 'lib' to option 'fopenmp=' 50 // 51 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 52 // RUN: -fopenmp=lib -target x86_64-unknown-linux \ 53 // RUN: | FileCheck --check-prefix=CHECK-LIB-LD-64 %s 54 // CHECK-LIB-LD-64: error: unsupported argument 'lib' to option 'fopenmp=' 55 // 56 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 57 // RUN: -fopenmp -fopenmp=libiomp5 -target i386-unknown-linux \ 58 // RUN: | FileCheck --check-prefix=CHECK-LD-WARN-32 %s 59 // CHECK-LD-WARN-32: warning: argument unused during compilation: '-fopenmp=libiomp5' 60 // CHECK-LD-WARN-32: "{{.*}}ld{{(.exe)?}}" 61 // CHECK-LD-WARN-32: "-lgomp" "-lrt" "-lgcc" 62 // CHECK-LD-WARN-32: "-lpthread" "-lc" 63 // 64 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 65 // RUN: -fopenmp -fopenmp=libiomp5 -target x86_64-unknown-linux \ 66 // RUN: | FileCheck --check-prefix=CHECK-LD-WARN-64 %s 67 // CHECK-LD-WARN-64: warning: argument unused during compilation: '-fopenmp=libiomp5' 68 // CHECK-LD-WARN-64: "{{.*}}ld{{(.exe)?}}" 69 // CHECK-LD-WARN-64: "-lgomp" "-lrt" "-lgcc" 70 // CHECK-LD-WARN-64: "-lpthread" "-lc" 71 // 72