brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 6ced5c1 Raw
52 lines · c
1// Check that we enable LTO-mode properly with '-fopenmp-target-jit' and that it2// still enabled LTO-mode if `-fno-offload-lto` is on.3// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-phases -fopenmp=libomp \4// RUN:  --offload-arch=sm_52 -fopenmp-target-jit %s 2>&1 \5// RUN: | FileCheck -check-prefix=PHASES-JIT %s6// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-phases -fopenmp=libomp \7// RUN:   --offload-arch=sm_52 -foffload-lto -fopenmp-target-jit %s 2>&1 \8// RUN: | FileCheck -check-prefix=PHASES-JIT %s9// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-phases -fopenmp=libomp \10// RUN:   --offload-arch=gfx90a -fopenmp-target-jit %s 2>&1 \11// RUN: | FileCheck -check-prefix=PHASES-JIT %s12// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-phases -fopenmp=libomp \13// RUN:   --offload-arch=gfx90a -foffload-lto -fopenmp-target-jit %s 2>&1 \14// RUN: | FileCheck -check-prefix=PHASES-JIT %s15// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-phases -fopenmp=libomp \16// RUN:   --offload-arch=gfx90a -fno-offload-lto -fopenmp-target-jit %s 2>&1 \17// RUN: | FileCheck -check-prefix=PHASES-JIT %s18//19//      PHASES-JIT: 0: input, "[[INPUT:.+]]", c, (host-openmp)20// PHASES-JIT-NEXT: 1: preprocessor, {0}, cpp-output, (host-openmp)21// PHASES-JIT-NEXT: 2: compiler, {1}, ir, (host-openmp)22// PHASES-JIT-NEXT: 3: input, "[[INPUT]]", c, (device-openmp, {{.*}})23// PHASES-JIT-NEXT: 4: preprocessor, {3}, cpp-output, (device-openmp, {{.*}})24// PHASES-JIT-NEXT: 5: compiler, {4}, ir, (device-openmp, {{.*}})25// PHASES-JIT-NEXT: 6: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp ([[TARGET:.+]])" {5}, ir26// PHASES-JIT-NEXT: 7: backend, {6}, lto-bc, (device-openmp, {{.*}})27// PHASES-JIT-NEXT: 8: offload, "device-openmp ([[TARGET]])" {7}, lto-bc28// PHASES-JIT-NEXT: 9: llvm-offload-binary, {8}, image, (device-openmp)29// PHASES-JIT-NEXT: 10: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (x86_64-unknown-linux-gnu)" {9}, ir30// PHASES-JIT-NEXT: 11: backend, {10}, assembler, (host-openmp)31// PHASES-JIT-NEXT: 12: assembler, {11}, object, (host-openmp)32// PHASES-JIT-NEXT: 13: clang-linker-wrapper, {12}, image, (host-openmp)33 34// Check that we add the `--embed-bitcode` flag to the linker wrapper.35// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp \36// RUN:   --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda \37// RUN:   -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_52 \38// RUN:   -fopenmp-target-jit %s 2>&1 | FileCheck -check-prefix=LINKER %s39// LINKER: clang-linker-wrapper"{{.*}}"--embed-bitcode"40 41// Check for incompatible combinations42 43// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fno-offload-lto \44// RUN:   --offload-arch=sm_52 -fopenmp-target-jit %s 2>&1 \45// RUN: | FileCheck -check-prefix=NO-LTO %s46// NO-LTO: error: the combination of '-fno-offload-lto' and '-fopenmp-target-jit' is incompatible47 48// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -foffload-lto=thin \49// RUN:   --offload-arch=sm_52 -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-target-jit %s 2>&1 \50// RUN: | FileCheck -check-prefix=THIN-LTO %s51// THIN-LTO: error: the combination of '-foffload-lto=' and '-fopenmp-target-jit' is incompatible52