[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / hip-toolchain-rdc-static-lib.hip
blob5276faf31bdc2b065254a94307ed09ebaa0c67dc
1 // RUN: %clang -### --target=x86_64-linux-gnu \
2 // RUN:   -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
3 // RUN:   --no-offload-new-driver --emit-static-lib -nogpulib \
4 // RUN:   -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
5 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
6 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
7 // RUN: 2>&1 | FileCheck %s
9 // emit objects for host side path
10 // CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
11 // CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
12 // CHECK-SAME: "-emit-obj"
13 // CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
14 // CHECK-SAME: "-fgpu-rdc"
15 // CHECK-SAME: {{.*}} "-o" [[A_OBJ_HOST:".*o"]] "-x" "hip"
16 // CHECK-SAME: {{.*}} [[A_SRC:".*a.cu"]]
18 // CHECK: [[CLANG]] "-cc1" "-triple" "x86_64-unknown-linux-gnu"
19 // CHECK-SAME: "-aux-triple" "amdgcn-amd-amdhsa"
20 // CHECK-SAME: "-emit-obj"
21 // CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
22 // CHECK-SAME: "-fgpu-rdc"
23 // CHECK-SAME: {{.*}} "-o" [[B_OBJ_HOST:".*o"]] "-x" "hip"
24 // CHECK-SAME: {{.*}} [[B_SRC:".*b.hip"]]
26 // generate image for device side path on gfx803
27 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
28 // CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
29 // CHECK-SAME: "-emit-llvm-bc"
30 // CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
31 // CHECK-SAME: "-fcuda-is-device"
32 // CHECK-SAME: "-target-cpu" "gfx803"
33 // CHECK-SAME: "-fgpu-rdc"
34 // CHECK-SAME: {{.*}} "-o" [[A_BC1:".*bc"]] "-x" "hip"
35 // CHECK-SAME: {{.*}} [[A_SRC]]
37 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
38 // CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
39 // CHECK-SAME: "-emit-llvm-bc"
40 // CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
41 // CHECK-SAME: "-fcuda-is-device"
42 // CHECK-SAME: "-target-cpu" "gfx803"
43 // CHECK-SAME: "-fgpu-rdc"
44 // CHECK-SAME: {{.*}} "-o" [[B_BC1:".*bc"]] "-x" "hip"
45 // CHECK-SAME: {{.*}} [[B_SRC]]
47 // CHECK-NOT: "*.llvm-link"
48 // CHECK-NOT: ".*opt"
49 // CHECK-NOT: ".*llc"
50 // CHECK: [[LLD: ".*lld.*"]] {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
51 // CHECK-SAME: "-plugin-opt=mcpu=gfx803"
52 // CHECK-SAME: "-o" "[[IMG_DEV1:.*out]]" [[A_BC1]] [[B_BC1]]
54 // generate image for device side path on gfx900
55 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
56 // CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
57 // CHECK-SAME: "-emit-llvm-bc"
58 // CHECK-SAME: {{.*}} "-main-file-name" "a.cu"
59 // CHECK-SAME: "-fcuda-is-device"
60 // CHECK-SAME: "-target-cpu" "gfx900"
61 // CHECK-SAME: "-fgpu-rdc"
62 // CHECK-SAME: {{.*}} "-o" [[A_BC2:".*bc"]] "-x" "hip"
63 // CHECK-SAME: {{.*}} [[A_SRC]]
65 // CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
66 // CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
67 // CHECK-SAME: "-emit-llvm-bc"
68 // CHECK-SAME: {{.*}} "-main-file-name" "b.hip"
69 // CHECK-SAME: "-fcuda-is-device"
70 // CHECK-SAME: "-target-cpu" "gfx900"
71 // CHECK-SAME: "-fgpu-rdc"
72 // CHECK-SAME: {{.*}} "-o" [[B_BC2:".*bc"]] "-x" "hip"
73 // CHECK-SAME: {{.*}} [[B_SRC]]
75 // CHECK-NOT: "*.llvm-link"
76 // CHECK-NOT: ".*opt"
77 // CHECK-NOT: ".*llc"
78 // CHECK: [[LLD]] {{.*}} "-plugin-opt=-amdgpu-internalize-symbols"
79 // CHECK-SAME: "-plugin-opt=mcpu=gfx900"
80 // CHECK-SAME: "--whole-archive"
81 // CHECK-SAME: "-o" "[[IMG_DEV2:.*out]]" [[A_BC2]] [[B_BC2]]
82 // CHECK-SAME: "--no-whole-archive"
84 // combine images generated into hip fat binary object
85 // CHECK: [[BUNDLER:".*clang-offload-bundler"]] "-type=o"
86 // CHECK-SAME: "-targets={{.*}},hipv4-amdgcn-amd-amdhsa--gfx803,hipv4-amdgcn-amd-amdhsa--gfx900"
87 // CHECK-SAME: "-input=[[IMG_DEV1]]" "-input=[[IMG_DEV2]]" "-output=[[BUNDLE:.*hipfb]]"
89 // CHECK: [[MC:".*clang.*"]] "-o" [[OBJBUNDLE:".*o"]] "{{.*}}.mcin"
91 // CHECK: [[AR:".*llvm-ar.*"]] "rcsD" "{{.*}}.out" [[A_OBJ_HOST]] [[B_OBJ_HOST]] [[OBJBUNDLE]]