1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // Check only -Xoffload-linker -mllvm=* options are passed
5 // to device lld linker.
6 // -mllvm options are passed to clang only.
8 // RUN: %clang -### --target=x86_64-linux-gnu \
9 // RUN: --offload-arch=gfx803 --offload-arch=gfx900 \
10 // RUN: -nogpuinc -nogpulib -mllvm -unroll-count=10 \
11 // RUN: -Xoffload-linker -mllvm=-inline-threshold=100 \
12 // RUN: %s 2>&1 | FileCheck %s
14 // RUN: %clang -### --target=x86_64-linux-gnu \
15 // RUN: --offload-arch=gfx803 --offload-arch=gfx900 \
16 // RUN: -nogpuinc -nogpulib -mllvm -unroll-count=10 \
17 // RUN: -Xoffload-linker -mllvm=-inline-threshold=100 \
18 // RUN: %s 2>&1 | FileCheck -check-prefix=NEG %s
20 // RUN: %clang -### --target=x86_64-linux-gnu \
21 // RUN: --offload-arch=gfx803 --offload-arch=gfx900 \
22 // RUN: -nogpuinc -nogpulib -fgpu-rdc -mllvm -unroll-count=10 \
23 // RUN: -Xoffload-linker -mllvm=-inline-threshold=100 \
24 // RUN: %s 2>&1 | FileCheck %s
26 // RUN: %clang -### --target=x86_64-linux-gnu \
27 // RUN: --offload-arch=gfx803 --offload-arch=gfx900 \
28 // RUN: -nogpuinc -nogpulib -fgpu-rdc -mllvm -unroll-count=10 \
29 // RUN: -Xoffload-linker -mllvm=-inline-threshold=100 \
30 // RUN: %s 2>&1 | FileCheck -check-prefix=NEG %s
32 // CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
33 // CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
34 // CHECK-SAME: {{.*}} "-target-cpu" "gfx803"
35 // CHECK-SAME: {{.*}} "-mllvm" "-unroll-count=10" {{.*}}
36 // CHECK: [[LLD:".*lld.*"]] {{.*}}"-m" "elf64_amdgpu"{{.*}} "-plugin-opt=-inline-threshold=100"
38 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
39 // CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
40 // CHECK-SAME: {{.*}} "-target-cpu" "gfx900"
41 // CHECK-SAME: {{.*}} "-mllvm" "-unroll-count=10" {{.*}}
42 // CHECK: [[LLD:".*lld.*"]] {{.*}} "-plugin-opt=-inline-threshold=100"
44 // NEG-NOT: {{".*opt"}}
45 // NEG-NOT: {{".*llc"}}
46 // NEG-NOT: "-plugin-opt=-unroll-count=10"
47 // NEG-NOT: "-m" "elf_x86_64"{{.*}} "-plugin-opt=-inline-threshold=100"