1
1
// REQUIRES: x86-registered-target, amdgpu-registered-target
2
2
3
3
// Fail on invalid ROCm Path.
4
- // RUN: not %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fgpu-sanitize -nogpuinc --rocm-path=%S/Inputs/rocm-invalid %s 2>&1 \
4
+ // RUN: not %clang -no-canonical-prefixes -### -mcode-object-version=5 - -target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fgpu-sanitize -nogpuinc --rocm-path=%S/Inputs/rocm-invalid %s 2>&1 \
5
5
// RUN: | FileCheck --check-prefix=FAIL %s
6
6
7
7
// Enable multiple sanitizer's apart from ASan with invalid rocm-path.
13
13
// RUN: | FileCheck --check-prefix=NOTSUPPORTED %s
14
14
15
15
// GPU ASan Enabled Test Cases
16
- // ASan enabled for amdgpu-arch [gfx908]
17
- // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908 -fsanitize=address -fgpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
18
- // RUN: | FileCheck -check-prefixes=NOXNACK,GPUSAN %s
19
-
20
- // GPU ASan enabled for amdgpu-arch [gfx908:xnack-]
21
- // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack- -fsanitize=address -fgpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
22
- // RUN: | FileCheck -check-prefixes=XNACKNEG,GPUSAN %s
23
16
24
17
// GPU ASan enabled for amdgpu-arch [gfx908:xnack+]
25
18
// RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fgpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
26
- // RUN: | FileCheck -check-prefixes=GPUSAN %s
19
+ // RUN: | FileCheck -check-prefixes=HOSTSAN,GPUSAN,SAN %s
20
+
21
+ // GPU ASan enabled through '-fsanitize=address' flag without '-fgpu-sanitize' for amdgpu-arch [gfx908:xnack+]
22
+ // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address --rocm-path=%S/Inputs/rocm %s 2>&1 \
23
+ // RUN: | FileCheck -check-prefixes=HOSTSAN,GPUSAN,SAN %s
27
24
28
25
// ASan enabled for multiple amdgpu-arch [gfx908:xnack+,gfx900:xnack+]
29
26
// RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ --offload-arch=gfx900:xnack+ -fsanitize=address -fgpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
30
- // RUN: | FileCheck -check-prefixes=GPUSAN %s
27
+ // RUN: | FileCheck -check-prefixes=HOSTSAN, GPUSAN,SAN %s
31
28
32
29
// GPU ASan Disabled Test Cases
33
- // ASan disabled for amdgpu-arch [gfx908]
34
- // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908 -fsanitize=address -fno-gpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
35
- // RUN: | FileCheck -check-prefixes=NOGPUSAN %s
30
+
31
+ // GPU ASan disabled through '-fsanitize=address' without '-fgpu-sanitize' flag for amdgpu-arch [gfx908]
32
+ // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908 -fsanitize=address --rocm-path=%S/Inputs/rocm %s 2>&1 \
33
+ // RUN: | FileCheck -check-prefixes=NOXNACK,HOSTSAN,NOGPUSAN,SAN %s
34
+
35
+ // GPU ASan disabled for amdgpu-arch [gfx908]
36
+ // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908 -fsanitize=address -fgpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
37
+ // RUN: | FileCheck -check-prefixes=NOXNACK,HOSTSAN,NOGPUSAN,SAN %s
36
38
37
39
// GPU ASan disabled for amdgpu-arch [gfx908:xnack-]
38
- // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack- -fsanitize=address -fno-gpu -sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
39
- // RUN: | FileCheck -check-prefixes=NOGPUSAN %s
40
+ // RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack- -fsanitize=address -fgpu -sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
41
+ // RUN: | FileCheck -check-prefixes=XNACKNEG,HOSTSAN, NOGPUSAN,SAN %s
40
42
41
- // GPU ASan disabled for amdgpu-arch [gfx908:xnack+]
43
+ // GPU ASan disabled using '-fno-gpu-sanitize' for amdgpu-arch [gfx908:xnack+]
42
44
// RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fno-gpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
43
- // RUN: | FileCheck -check-prefixes=NOGPUSAN %s
45
+ // RUN: | FileCheck -check-prefixes=HOSTSAN, NOGPUSAN,SAN %s
44
46
45
- // ASan disabled for amdgpu-arch [gfx908:xnack+,gfx900:xnack+]
47
+ // GPU ASan disabled for multiple amdgpu-arch [gfx908:xnack+,gfx900:xnack+]
46
48
// RUN: %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ --offload-arch=gfx900:xnack+ -fsanitize=address -fno-gpu-sanitize --rocm-path=%S/Inputs/rocm %s 2>&1 \
47
- // RUN: | FileCheck -check-prefixes=NOGPUSAN %s
49
+ // RUN: | FileCheck -check-prefixes=HOSTSAN, NOGPUSAN,SAN %s
48
50
49
51
// FAIL-DAG: error: cannot find ROCm device library for ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
50
52
// NOTSUPPORTED-DAG: warning: ignoring '-fsanitize=leak' option as it is not currently supported for target 'amdgcn-amd-amdhsa'
51
53
52
54
// NOXNACK: warning: ignoring '-fsanitize=address' option for offload arch 'gfx908' as it is not currently supported there. Use it with an offload arch containing 'xnack+' instead
53
55
// XNACKNEG: warning: ignoring '-fsanitize=address' option for offload arch 'gfx908:xnack-' as it is not currently supported there. Use it with an offload arch containing 'xnack+' instead
54
56
55
- // GPUSAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "x86_64-unknown-linux-gnu".* "-fopenmp".* "-fsanitize=address".* "-fopenmp-targets=amdgcn-amd-amdhsa".* "-x" "c".*}}
56
- // GPUSAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu".* "-emit-llvm-bc".* "-target-cpu" "(gfx908|gfx900)".* "-fopenmp".* "-fsanitize=address".* "-x" "c".*}}
57
- // GPUSAN: {{"[^"]*clang-offload-packager[^"]*" "-o".* "--image=file=.*.bc,triple=amdgcn-amd-amdhsa,arch=gfx908(:xnack\-|:xnack\+)?,kind=openmp(,feature=(\-xnack|\+xnack))?"}}
58
- // GPUSAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "x86_64-unknown-linux-gnu".* "-fopenmp".* "-fsanitize=address".* "-fopenmp-targets=amdgcn-amd-amdhsa".* "-x" "ir".*}}
59
- // GPUSAN: {{"[^"]*clang-linker-wrapper[^"]*".* "--host-triple=x86_64-unknown-linux-gnu".* "--linker-path=[^"]*".* "--whole-archive" "[^"]*(libclang_rt.asan_static.a|libclang_rt.asan_static-x86_64.a)".* "--whole-archive" "[^"]*(libclang_rt.asan.a|libclang_rt.asan-x86_64.a)".*}}
57
+ // HOSTSAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "x86_64-unknown-linux-gnu".* "-fopenmp".* "-fsanitize=address".* "-fopenmp-targets=amdgcn-amd-amdhsa".* "-x" "c".*}}
60
58
61
- // NOGPUSAN : {{"[^"]*clang[^"]*" "-cc1" "-triple" "x86_64-unknown-linux-gnu".* "-fopenmp ".* "-fsanitize=address". * "-fopenmp-targets=amdgcn-amd-amdhsa ".* "-x" "c".*}}
59
+ // GPUSAN : {{"[^"]*clang[^"]*" "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" " x86_64-unknown-linux-gnu".* "-emit-llvm-bc ".* "-mlink-bitcode-file" "[^"]*asanrtl.bc". * "-mlink-bitcode-file" "[^"]*ockl.bc".* "-target-cpu" "(gfx908|gfx900)".* "-fopenmp".* "-fsanitize=address ".* "-x" "c".*}}
62
60
// NOGPUSAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu".* "-emit-llvm-bc".* "-target-cpu" "(gfx908|gfx900)".* "-fopenmp".* "-x" "c".*}}
63
- // NOGPUSAN: {{"[^"]*clang-offload-packager[^"]*" "-o".* "--image=file=.*.bc,triple=amdgcn-amd-amdhsa,arch=gfx908(:xnack\-|:xnack\+)?,kind=openmp(,feature=(\-xnack|\+xnack))?"}}
64
- // NOGPUSAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "x86_64-unknown-linux-gnu".* "-fopenmp".* "-fsanitize=address".* "-fopenmp-targets=amdgcn-amd-amdhsa".* "-x" "ir".*}}
65
- // NOGPUSAN: {{"[^"]*clang-linker-wrapper[^"]*".* "--host-triple=x86_64-unknown-linux-gnu".* "--linker-path=[^"]*".* "--whole-archive" "[^"]*(libclang_rt.asan_static.a|libclang_rt.asan_static-x86_64.a)".* "--whole-archive" "[^"]*(libclang_rt.asan.a|libclang_rt.asan-x86_64.a)".*}}
61
+
62
+ // SAN: {{"[^"]*clang-offload-packager[^"]*" "-o".* "--image=file=.*.bc,triple=amdgcn-amd-amdhsa,arch=gfx908(:xnack\-|:xnack\+)?,kind=openmp(,feature=(\-xnack|\+xnack))?"}}
63
+ // SAN: {{"[^"]*clang[^"]*" "-cc1" "-triple" "x86_64-unknown-linux-gnu".* "-fopenmp".* "-fsanitize=address".* "-fopenmp-targets=amdgcn-amd-amdhsa".* "-x" "ir".*}}
64
+ // SAN: {{"[^"]*clang-linker-wrapper[^"]*".* "--host-triple=x86_64-unknown-linux-gnu".* "--linker-path=[^"]*".* "--whole-archive" "[^"]*(libclang_rt.asan_static.a|libclang_rt.asan_static-x86_64.a)".* "--whole-archive" "[^"]*(libclang_rt.asan.a|libclang_rt.asan-x86_64.a)".*}}
0 commit comments