1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // Check CUID generated by hash.
5 // The same CUID is generated for the same file with the same options.
7 // RUN: %clang -### -x hip -target x86_64-unknown-linux-gnu \
8 // RUN: --offload-arch=gfx906 -c -nogpulib -fuse-cuid=hash \
9 // RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
11 // RUN: %clang -### -x hip -target x86_64-unknown-linux-gnu \
12 // RUN: --offload-arch=gfx906 -c -nogpulib -fuse-cuid=hash \
13 // RUN: %S/Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
15 // RUN: FileCheck %s -check-prefixes=SAME -input-file %t.out
17 // Check CUID generated by hash.
18 // Different CUID's are generated for the same file with different options.
20 // RUN: %clang -### -x hip -target x86_64-unknown-linux-gnu -DX=1 \
21 // RUN: --offload-arch=gfx906 -c -nogpulib -fuse-cuid=hash \
22 // RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
24 // RUN: %clang -### -x hip -target x86_64-unknown-linux-gnu -DX=2 \
25 // RUN: --offload-arch=gfx906 -c -nogpulib -fuse-cuid=hash \
26 // RUN: %S/Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
28 // RUN: FileCheck %s -check-prefixes=DIFF -input-file %t.out
30 // SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
31 // SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"
33 // DIFF: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
34 // DIFF-NOT: "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"