| 1 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel \ |
| 2 |
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \ |
| 3 |
// RUN: | FileCheck %s |
| 4 |
|
| 5 |
// verify the tools invocations |
| 6 |
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-llvm-bc"{{.*}}"-x" "c" |
| 7 |
// CHECK: "-cc1" "-triple" "spirv64-intel" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}} "-o" "{{.*}}.o" |
| 8 |
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-obj" |
| 9 |
// CHECK: clang-linker-wrapper{{.*}} "-o" "a.out" |
| 10 |
|
| 11 |
// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel %s 2>&1 \ |
| 12 |
// RUN: | FileCheck --check-prefix=CHECK-PHASES %s |
| 13 |
|
| 14 |
// CHECK-PHASES: 0: input, "[[INPUT:.+]]", c, (host-openmp) |
| 15 |
// CHECK-PHASES: 1: preprocessor, {0}, cpp-output, (host-openmp) |
| 16 |
// CHECK-PHASES: 2: compiler, {1}, ir, (host-openmp) |
| 17 |
// CHECK-PHASES: 3: input, "[[INPUT]]", c, (device-openmp) |
| 18 |
// CHECK-PHASES: 4: preprocessor, {3}, cpp-output, (device-openmp) |
| 19 |
// CHECK-PHASES: 5: compiler, {4}, ir, (device-openmp) |
| 20 |
// CHECK-PHASES: 6: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (spirv64-intel)" {5}, ir |
| 21 |
// CHECK-PHASES: 7: backend, {6}, assembler, (device-openmp) |
| 22 |
// CHECK-PHASES: 8: assembler, {7}, object, (device-openmp) |
| 23 |
// CHECK-PHASES: 9: offload, "device-openmp (spirv64-intel)" {8}, object |
| 24 |
// CHECK-PHASES: 10: llvm-offload-binary, {9}, image, (device-openmp) |
| 25 |
// CHECK-PHASES: 11: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (x86_64-unknown-linux-gnu)" {10}, ir |
| 26 |
// CHECK-PHASES: 12: backend, {11}, assembler, (host-openmp) |
| 27 |
// CHECK-PHASES: 13: assembler, {12}, object, (host-openmp) |
| 28 |
// CHECK-PHASES: 14: clang-linker-wrapper, {13}, image, (host-openmp) |
| 29 |
|
| 30 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp=libomp -fopenmp-targets=spirv64-intel -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS |
| 31 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp=libomp -fopenmp-targets=spirv64-intel -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS |
| 32 |
|
| 33 |
// CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[HOST_BC:.+]]" |
| 34 |
// CHECK-BINDINGS: "spirv64-intel" - "clang", inputs: ["[[INPUT]]", "[[HOST_BC]]"], output: "[[DEVICE_SPV:.+]]" |
| 35 |
// CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "Offload::Packager", inputs: ["[[DEVICE_SPV]]"], output: "[[DEVICE_IMAGE:.+]]" |
| 36 |
// CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[HOST_BC]]", "[[DEVICE_IMAGE]]"], output: "[[HOST_OBJ:.+]]" |
| 37 |
// CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[HOST_OBJ]]"], output: "a.out" |
| 38 |
|
| 39 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -save-temps -fopenmp=libomp -fopenmp-targets=spirv64-intel -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS-TEMPS |
| 40 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -save-temps -fopenmp=libomp -fopenmp-targets=spirv64-intel %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS-TEMPS |
| 41 |
// CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[HOST_PP:.+]]" |
| 42 |
// CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[HOST_PP]]"], output: "[[HOST_BC:.+]]" |
| 43 |
// CHECK-BINDINGS-TEMPS: "spirv64-intel" - "clang", inputs: ["[[INPUT]]"], output: "[[DEVICE_PP:.+]]" |
| 44 |
// CHECK-BINDINGS-TEMPS: "spirv64-intel" - "clang", inputs: ["[[DEVICE_PP]]", "[[HOST_BC]]"], output: "[[DEVICE_BC:.+]]" |
| 45 |
// CHECK-BINDINGS-TEMPS: "spirv64-intel" - "clang", inputs: ["[[DEVICE_BC]]"], output: "[[DEVICE_ASM:.+]]" |
| 46 |
// CHECK-BINDINGS-TEMPS: "spirv64-intel" - "SPIR-V::Assembler", inputs: ["[[DEVICE_ASM]]"], output: "[[DEVICE_SPV:.+]]" |
| 47 |
// CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "Offload::Packager", inputs: ["[[DEVICE_SPV]]"], output: "[[DEVICE_IMAGE:.+]]" |
| 48 |
// CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[HOST_BC]]", "[[DEVICE_IMAGE]]"], output: "[[HOST_ASM:.+]]" |
| 49 |
// CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang::as", inputs: ["[[HOST_ASM]]"], output: "[[HOST_OBJ:.+]]" |
| 50 |
// CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[HOST_OBJ]]"], output: "a.out" |
| 51 |
|
| 52 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -emit-llvm -S -fopenmp=libomp -fopenmp-targets=spirv64-intel -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-EMIT-LLVM-IR |
| 53 |
// CHECK-EMIT-LLVM-IR: "-cc1" "-triple" "spirv64-intel"{{.*}}"-emit-llvm-bc" |
| 54 |
|
| 55 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel \ |
| 56 |
// RUN: --sysroot=%S/Inputs/spirv-openmp/ %s 2>&1 | FileCheck --check-prefix=CHECK-GPULIB %s |
| 57 |
// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv.bc" |
| 58 |
|
| 59 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=spirv64-intel \ |
| 60 |
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \ |
| 61 |
// RUN: | FileCheck %s --check-prefix=CHECK-OFFLOAD-ARCH-ERROR |
| 62 |
// CHECK-OFFLOAD-ARCH-ERROR: error: failed to deduce triple for target architecture 'spirv64-intel'; specify the triple using '-fopenmp-targets' and '-Xopenmp-target' instead |
| 63 |
|
| 64 |
// RUN: %clang -mllvm --spirv-ext=+SPV_INTEL_function_pointers -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel \ |
| 65 |
// RUN: -nogpulib %s 2>&1 \ |
| 66 |
// RUN: | FileCheck %s --check-prefix=CHECK-LINKER-ARG |
| 67 |
// CHECK-LINKER-ARG: clang-linker-wrapper |
| 68 |
// CHECK-LINKER-ARG-NOT: --device-linker=spirv64 |
| 69 |
// CHECK-LINKER-ARG-NOT: -mllvm |
| 70 |
// CHECK-LINKER-ARG-NOT: --spirv-ext=+SPV_INTEL_function_pointers |
| 71 |
// CHECK-LINKER-ARG: --linker-path |