Home | History | Annotate | Download | only in OpenMP
      1 // Test the that the driver produces reasonable linker invocations with
      2 // -fopenmp or -fopenmp|libgomp.
      3 //
      4 // FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time.
      5 //
      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)?}}"
     10 // CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc"
     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)?}}"
     17 // CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc"
     18 // CHECK-LD-64: "-lpthread" "-lc"
     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 \
     35 // RUN:     -fopenmp -target i386-unknown-linux \
     36 // RUN:   | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s
     37 // CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}"
     38 // CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc"
     39 // CHECK-IOMP5-LD-32: "-lpthread" "-lc"
     40 //
     41 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     42 // RUN:     -fopenmp -target x86_64-unknown-linux \
     43 // RUN:   | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s
     44 // CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}"
     45 // CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]" "-lgcc"
     46 // CHECK-IOMP5-LD-64: "-lpthread" "-lc"
     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 \
     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"
     64 //
     65 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     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"
     71 //
     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 //
     90