1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // Check invalid -fuse-cuid= option.
6 // RUN: not %clang -### -x hip \
7 // RUN: --target=x86_64-unknown-linux-gnu \
8 // RUN: --offload-arch=gfx900 \
9 // RUN: --offload-arch=gfx906 \
10 // RUN: -c -nogpuinc -nogpulib -fuse-cuid=invalid \
11 // RUN: %S/Inputs/hip_multiple_inputs/a.cu \
12 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
13 // RUN: 2>&1 | FileCheck -check-prefixes=INVALID %s
15 // Check random CUID generator.
17 // RUN: %clang -### -x hip \
18 // RUN: --target=x86_64-unknown-linux-gnu \
19 // RUN: --offload-arch=gfx900 \
20 // RUN: --offload-arch=gfx906 \
21 // RUN: -c -nogpuinc -nogpulib -fuse-cuid=random \
22 // RUN: %S/Inputs/hip_multiple_inputs/a.cu \
23 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
24 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
28 // RUN: %clang -### -x hip \
29 // RUN: --target=x86_64-unknown-linux-gnu \
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: --offload-arch=gfx900 \
42 // RUN: --offload-arch=gfx906 \
43 // RUN: -c -nogpuinc -nogpulib -fuse-cuid=random -cuid=xyz_123 \
44 // RUN: %S/Inputs/hip_multiple_inputs/a.cu \
45 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
46 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,FIXED %s
48 // Check hash CUID generator.
50 // RUN: %clang -### -x hip \
51 // RUN: --target=x86_64-unknown-linux-gnu \
52 // RUN: --offload-arch=gfx900 \
53 // RUN: --offload-arch=gfx906 \
54 // RUN: -c -nogpuinc -nogpulib -fuse-cuid=hash \
55 // RUN: %S/Inputs/hip_multiple_inputs/a.cu \
56 // RUN: %S/Inputs/hip_multiple_inputs/b.hip \
57 // RUN: 2>&1 | FileCheck -check-prefixes=COMMON,HEX %s
59 // INVALID: invalid value 'invalid' in '-fuse-cuid=invalid'
61 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
62 // COMMON-SAME: "-target-cpu" "gfx900"
63 // HEX-SAME: "-cuid=[[CUID:[0-9a-f]+]]"
64 // FIXED-SAME: "-cuid=[[CUID:xyz_123]]"
65 // COMMON-SAME: "{{.*}}a.cu"
67 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
68 // COMMON-SAME: "-target-cpu" "gfx906"
69 // COMMON-SAME: "-cuid=[[CUID]]"
70 // COMMON-SAME: "{{.*}}a.cu"
72 // COMMON: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
73 // COMMON-SAME: "-cuid=[[CUID]]"
74 // COMMON-SAME: "{{.*}}a.cu"
76 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
77 // COMMON-SAME: "-target-cpu" "gfx900"
78 // HEX-NOT: "-cuid=[[CUID]]"
79 // HEX-SAME: "-cuid=[[CUID2:[0-9a-f]+]]"
80 // FIXED-SAME: "-cuid=[[CUID2:xyz_123]]"
81 // COMMON-SAME: "{{.*}}b.hip"
83 // COMMON: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa"
84 // COMMON-SAME: "-target-cpu" "gfx906"
85 // HEX-NOT: "-cuid=[[CUID]]"
86 // COMMON-SAME: "-cuid=[[CUID2]]"
87 // COMMON-SAME: "{{.*}}b.hip"
89 // COMMON: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu"
90 // HEX-NOT: "-cuid=[[CUID]]"
91 // COMMON-SAME: "-cuid=[[CUID2]]"
92 // COMMON-SAME: "{{.*}}b.hip"