| 1 |
// Check CUID generated by hash. |
| 2 |
// The same CUID is generated for the same file with the same options. |
| 3 |
|
| 4 |
// This test requires relative paths for input files. Since the test may be |
| 5 |
// done out of source tree, create the local directory structure and copy the |
| 6 |
// input file from the source tree into that directory. |
| 7 |
// RUN: mkdir -p %t/Inputs/hip_multiple_inputs |
| 8 |
// RUN: cp %S/Inputs/hip_multiple_inputs/a.cu %t/Inputs/hip_multiple_inputs/a.cu |
| 9 |
// RUN: cd %t |
| 10 |
|
| 11 |
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \ |
| 12 |
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \ |
| 13 |
// RUN: Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1 |
| 14 |
|
| 15 |
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \ |
| 16 |
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \ |
| 17 |
// RUN: Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1 |
| 18 |
|
| 19 |
// RUN: FileCheck %s -check-prefixes=SAME -input-file %t.out |
| 20 |
|
| 21 |
// Check CUID generated by hash. |
| 22 |
// Different CUID's are generated for the same file with different options. |
| 23 |
|
| 24 |
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=1 --no-offload-new-driver \ |
| 25 |
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \ |
| 26 |
// RUN: Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1 |
| 27 |
|
| 28 |
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -DX=2 --no-offload-new-driver \ |
| 29 |
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \ |
| 30 |
// RUN: Inputs/../Inputs/hip_multiple_inputs/a.cu >>%t.out 2>&1 |
| 31 |
|
| 32 |
// RUN: FileCheck %s -check-prefixes=DIFF -input-file %t.out |
| 33 |
|
| 34 |
// SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]" |
| 35 |
// SAME: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]" |
| 36 |
|
| 37 |
// DIFF: "-cc1"{{.*}} "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID:[0-9a-f]+]]" |
| 38 |
// DIFF-NOT: "-target-cpu" "gfx906" {{.*}}"-cuid=[[CUID]]" |