llvm-project/clang/test/Driver/hip-cuid-hash.hip

36 lines
1.5 KiB
Plaintext

// REQUIRES: clang-driver
// 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 \
// RUN: --offload-arch=gfx906 -c -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 \
// RUN: --offload-arch=gfx906 -c -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 \
// RUN: --offload-arch=gfx906 -c -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 \
// RUN: --offload-arch=gfx906 -c -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: "{{.*}}clang{{.*}}" {{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
// SAME: "{{.*}}clang{{.*}}" {{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"
// DIFF: "{{.*}}clang{{.*}}" {{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]"
// DIFF-NOT: "{{.*}}clang{{.*}}" {{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]"