| 1 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack+ \ |
| 2 |
// RUN: -fsanitize=address \ |
| 3 |
// RUN: -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 4 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=NORDC %s |
| 5 |
|
| 6 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack+ \ |
| 7 |
// RUN: -fsanitize=address -fno-gpu-sanitize \ |
| 8 |
// RUN: -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 9 |
// RUN: %s 2>&1 | FileCheck %s |
| 10 |
|
| 11 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack+ \ |
| 12 |
// RUN: -fsanitize=address -fgpu-sanitize \ |
| 13 |
// RUN: -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 14 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=NORDC %s |
| 15 |
|
| 16 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack+ \ |
| 17 |
// RUN: -fsanitize=address -fgpu-sanitize -fgpu-rdc \ |
| 18 |
// RUN: -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 19 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=RDC %s |
| 20 |
|
| 21 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack+ \ |
| 22 |
// RUN: -fsanitize=address -fgpu-sanitize \ |
| 23 |
// RUN: -nogpuinc --rocm-path=%S/Inputs/rocm-invalid \ |
| 24 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=FAIL %s |
| 25 |
|
| 26 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack- \ |
| 27 |
// RUN: --offload-arch=gfx900:xnack+ --offload-arch=gfx906 -fsanitize=address -fgpu-sanitize \ |
| 28 |
// RUN: -fsanitize=leak -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 29 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=XNACK %s |
| 30 |
|
| 31 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack- \ |
| 32 |
// RUN: --offload-arch=gfx900:xnack+ --offload-arch=gfx906 -fsanitize=address -fgpu-sanitize \ |
| 33 |
// RUN: -fsanitize=leak -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 34 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=XNACKNEG %s |
| 35 |
|
| 36 |
// Check -fno-gpu-sanitize with supported and unsupported GPU. |
| 37 |
// Sanitizer should be disabled for all GPU's and there should be no warnings about unsupported |
| 38 |
// GPU. |
| 39 |
|
| 40 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack- \ |
| 41 |
// RUN: --offload-arch=gfx900:xnack+ --offload-arch=gfx906 -fsanitize=address -fno-gpu-sanitize \ |
| 42 |
// RUN: -fsanitize=leak -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 43 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=NOGPU %s |
| 44 |
|
| 45 |
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx900:xnack- \ |
| 46 |
// RUN: --offload-arch=gfx900:xnack+ --offload-arch=gfx906 -fsanitize=address -fno-gpu-sanitize \ |
| 47 |
// RUN: -fsanitize=leak -nogpuinc --rocm-path=%S/Inputs/rocm \ |
| 48 |
// RUN: %s 2>&1 | FileCheck -check-prefixes=NOGPUNEG %s |
| 49 |
|
| 50 |
// CHECK-NOT: {{"[^"]*clang[^"]*".* "-fcuda-is-device".* "-fsanitize=address"}} |
| 51 |
// CHECK-NOT: {{"[^"]*clang[^"]*".* "-fcuda-is-device".* "-mlink-bitcode-file" ".*asanrtl.bc"}} |
| 52 |
// CHECK-NOT: {{"[^"]*lld(\.exe){0,1}".* ".*hip.bc"}} |
| 53 |
// CHECK: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}} |
| 54 |
|
| 55 |
// NORDC: {{"[^"]*clang[^"]*".* "-emit-obj".* "-fcuda-is-device".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-mlink-builtin-bitcode" ".*hip.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.o]]" |
| 56 |
// NORDC-NOT: {{"[^"]*lld(\.exe){0,1}".*}} "[[OUT]]" {{".*asanrtl.bc" ".*hip.bc"}} |
| 57 |
// NORDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}} |
| 58 |
|
| 59 |
// RDC: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address"}} |
| 60 |
// RDC: {{"[^"]*clang[^"]*".* "-emit-llvm-bc".* "-fcuda-is-device".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-mlink-builtin-bitcode" ".*hip.bc".* "-fsanitize=address".*}} "-o" "[[OUT:[^"]*.bc]]" |
| 61 |
// RDC-NOT: {{"[^"]*lld(\.exe){0,1}".*}} "[[OUT]]" {{".*asanrtl.bc" ".*hip.bc"}} |
| 62 |
|
| 63 |
// FAIL: AMDGPU address sanitizer runtime library (asanrtl) is not found. Please install ROCm device library which supports address sanitizer |
| 64 |
|
| 65 |
// XNACK-DAG: warning: ignoring '-fsanitize=leak' option as it is not currently supported for target 'amdgcn-amd-amdhsa' |
| 66 |
// XNACK-DAG: warning: ignoring '-fsanitize=address' option for offload arch 'gfx900:xnack-' as it is not currently supported there. Use it with an offload arch containing 'xnack+' instead |
| 67 |
// XNACK-DAG: warning: ignoring '-fsanitize=address' option for offload arch 'gfx906' as it is not currently supported there. Use it with an offload arch containing 'xnack+' instead |
| 68 |
// XNACK-DAG: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx900".* "-target-feature" "\+xnack".* "-fsanitize=address"}} |
| 69 |
// XNACK-DAG: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "-xnack"}} |
| 70 |
// XNACK-DAG: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx906"}} |
| 71 |
// XNACK-DAG: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address,leak"}} |
| 72 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "+xnack".* "-fsanitize=address,leak"}} |
| 73 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "-xnack".* "-fsanitize=address,leak"}} |
| 74 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx906".* "-fsanitize=address,leak"}} |
| 75 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "-xnack".* "-fsanitize=address"}} |
| 76 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx906".* "-fsanitize=address"}} |
| 77 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx900".* "-target-feature" "-xnack"}} |
| 78 |
// XNACKNEG-NOT: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx906"}} |
| 79 |
// XNACKNEG-NOT: {{"[^"]*lld(\.exe){0,1}".* ".*hip.bc"}} |
| 80 |
|
| 81 |
// NOGPU-DAG: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "\+xnack"}} |
| 82 |
// NOGPU-DAG: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "-xnack"}} |
| 83 |
// NOGPU-DAG: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx906"}} |
| 84 |
// NOGPU-DAG: {{"[^"]*clang[^"]*".* "-triple" "x86_64-unknown-linux-gnu".* "-fsanitize=address,leak"}} |
| 85 |
// NOGPUNEG-NOT: warning: ignoring '-fsanitize=leak' option as it is not currently supported for target 'amdgcn-amd-amdhsa' |
| 86 |
// NOGPUNEG-NOT: warning: ignoring '-fsanitize=address' option for offload arch 'gfx900:xnack-' as it is not currently supported there. Use it with an offload arch containing 'xnack+' instead |
| 87 |
// NOGPUNEG-NOT: warning: ignoring '-fsanitize=address' option for offload arch 'gfx906' as it is not currently supported there. Use it with an offload arch containing 'xnack+' instead |
| 88 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx900".* "-target-feature" "\+xnack".* "-fsanitize=address"}} |
| 89 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "\+xnack".* "-fsanitize=address,leak"}} |
| 90 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "-xnack".* "-fsanitize=address,leak"}} |
| 91 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx906".* "-fsanitize=address,leak"}} |
| 92 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "\+xnack".* "-fsanitize=address"}} |
| 93 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx900".* "-target-feature" "-xnack".* "-fsanitize=address"}} |
| 94 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-target-cpu" "gfx906".* "-fsanitize=address"}} |
| 95 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx900".* "-target-feature" "\+xnack"}} |
| 96 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx900".* "-target-feature" "-xnack"}} |
| 97 |
// NOGPUNEG-NOT: {{"[^"]*clang[^"]*".* "-mlink-bitcode-file" ".*asanrtl.bc".* "-target-cpu" "gfx906"}} |
| 98 |
// NOGPUNEG-NOT: {{"[^"]*lld(\.exe){0,1}".* ".*hip.bc"}} |