[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / hip-cuid.hip
blob2e38c59ccf5ef15aeb31a99767fe81213d2d7510
1 // Check invalid -fuse-cuid= option.
3 // RUN: not %clang -### -x hip \
4 // RUN:   --target=x86_64-unknown-linux-gnu \
5 // RUN:   --no-offload-new-driver \
6 // RUN:   --offload-arch=gfx900 \
7 // RUN:   --offload-arch=gfx906 \
8 // RUN:   -c -nogpuinc -nogpulib -fuse-cuid=invalid \
9 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
10 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
11 // RUN: 2>&1 | FileCheck -check-prefixes=INVALID %s
13 // Check random CUID generator.
15 // RUN: %clang -### -x hip \
16 // RUN:   --target=x86_64-unknown-linux-gnu \
17 // RUN:   --no-offload-new-driver \
18 // RUN:   --offload-arch=gfx900 \
19 // RUN:   --offload-arch=gfx906 \
20 // RUN:   -c -nogpuinc -nogpulib -fuse-cuid=random \
21 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
22 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
23 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
25 // Check fixed CUID.
27 // RUN: %clang -### -x hip \
28 // RUN:   --target=x86_64-unknown-linux-gnu \
29 // RUN:   --no-offload-new-driver \
30 // RUN:   --offload-arch=gfx900 \
31 // RUN:   --offload-arch=gfx906 \
32 // RUN:   -c -nogpuinc -nogpulib -cuid=xyz_123 \
33 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
34 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
35 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,FIXED %s
37 // Check fixed CUID override -fuse-cuid.
39 // RUN: %clang -### -x hip \
40 // RUN:   --target=x86_64-unknown-linux-gnu \
41 // RUN:   --no-offload-new-driver \
42 // RUN:   --offload-arch=gfx900 \
43 // RUN:   --offload-arch=gfx906 \
44 // RUN:   -c -nogpuinc -nogpulib -fuse-cuid=random -cuid=xyz_123 \
45 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
46 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
47 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,FIXED %s
49 // Check hash CUID generator.
51 // RUN: %clang -### -x hip \
52 // RUN:   --target=x86_64-unknown-linux-gnu \
53 // RUN:   --no-offload-new-driver \
54 // RUN:   --offload-arch=gfx900 \
55 // RUN:   --offload-arch=gfx906 \
56 // RUN:   -c -nogpuinc -nogpulib -fuse-cuid=hash \
57 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
58 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
59 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
61 // Check that cuid is propagated to the host-only compilation.
62 // RUN: %clang -### -x hip \
63 // RUN:   --target=x86_64-unknown-linux-gnu \
64 // RUN:   --no-offload-new-driver \
65 // RUN:   --offload-arch=gfx900 \
66 // RUN:   --offload-host-only \
67 // RUN:   -c -nogpuinc -nogpulib -cuid=xyz_123 \
68 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
69 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
70 // RUN: 2>&1 | FileCheck -check-prefixes=HOST %s
72 // Check that cuid is propagated to the device-only compilation.
73 // RUN: %clang -### -x hip \
74 // RUN:   --target=x86_64-unknown-linux-gnu \
75 // RUN:   --no-offload-new-driver \
76 // RUN:   --offload-arch=gfx900 \
77 // RUN:   --offload-device-only \
78 // RUN:   -c -nogpuinc -nogpulib -cuid=xyz_123 \
79 // RUN:   %S/Inputs/hip_multiple_inputs/a.cu \
80 // RUN:   %S/Inputs/hip_multiple_inputs/b.hip \
81 // RUN: 2>&1 | FileCheck -check-prefixes=DEVICE %s
83 // INVALID: invalid value 'invalid' in '-fuse-cuid=invalid'
85 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
86 // COMMON-SAME: "-target-cpu" "gfx900"
87 // HEX-SAME: "-cuid=[[CUID:[0-9a-f]+]]"
88 // FIXED-SAME: "-cuid=[[CUID:xyz_123]]"
89 // COMMON-SAME: "{{.*}}a.cu"
91 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
92 // COMMON-SAME: "-target-cpu" "gfx906"
93 // COMMON-SAME: "-cuid=[[CUID]]"
94 // COMMON-SAME: "{{.*}}a.cu"
96 // COMMON: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
97 // COMMON-SAME: "-cuid=[[CUID]]"
98 // COMMON-SAME: "{{.*}}a.cu"
100 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
101 // COMMON-SAME: "-target-cpu" "gfx900"
102 // HEX-NOT: "-cuid=[[CUID]]"
103 // HEX-SAME: "-cuid=[[CUID2:[0-9a-f]+]]"
104 // FIXED-SAME: "-cuid=[[CUID2:xyz_123]]"
105 // COMMON-SAME: "{{.*}}b.hip"
107 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
108 // COMMON-SAME: "-target-cpu" "gfx906"
109 // HEX-NOT: "-cuid=[[CUID]]"
110 // COMMON-SAME: "-cuid=[[CUID2]]"
111 // COMMON-SAME: "{{.*}}b.hip"
113 // COMMON: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
114 // HEX-NOT: "-cuid=[[CUID]]"
115 // COMMON-SAME: "-cuid=[[CUID2]]"
116 // COMMON-SAME: "{{.*}}b.hip"
118 // HOST: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
119 // HOST-SAME: "-cuid=[[CUID:xyz_123]]"
120 // HOST-SAME: "{{.*}}a.cu"
122 // HOST: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
123 // HOST-SAME: "-cuid=[[CUID]]"
124 // HOST-SAME: "{{.*}}b.hip"
126 // DEVICE: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
127 // DEVICE-SAME: "-target-cpu" "gfx900"
128 // DEVICE-SAME: "-cuid=[[CUID:xyz_123]]"
129 // DEVICE-SAME: "{{.*}}a.cu"
131 // DEVICE: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
132 // DEVICE-SAME: "-target-cpu" "gfx900"
133 // DEVICE-SAME: "-cuid=[[CUID]]"
134 // DEVICE-SAME: "{{.*}}b.hip"