blob: ef2a32a69c8f4366a5f0a1896e0de4fd7e123c12 [file] [log] [blame]
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target
// Check CUID generated by hash.
// The same CUID is generated for the same file with the same options.
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
// RUN: FileCheck %s -check-prefixes=SAME -input-file %t.out
// Check CUID generated by hash.
// Different CUID's are generated for the same file with different options.
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=2 --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
// RUN: %S/Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1
// RUN: FileCheck %s -check-prefixes=DIFF -input-file %t.out
// SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
// SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"
// DIFF: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
// DIFF-NOT: "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"