|
| 1 | +// REQUIRES: clang-driver |
| 2 | +// REQUIRES: x86-registered-target |
| 3 | +// REQUIRES: amdgpu-registered-target |
| 4 | + |
| 5 | +// RUN: %clang -### -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908:xnack- -fsanitize=address -fgpu-sanitize %s 2>&1 \ |
| 6 | +// RUN: | FileCheck -check-prefixes=XNACK-DAG,GPUSAN,XNACKNEG %s |
| 7 | + |
| 8 | +// RUN: %clang -### -fopenmp --offload-arch=gfx908:xnack- -fsanitize=address -fgpu-sanitize %s 2>&1 \ |
| 9 | +// RUN: | FileCheck -check-prefixes=XNACK-DAG,GPUSAN,XNACKNEG %s |
| 10 | + |
| 11 | +// RUN: %clang -### -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908 -fsanitize=address -fgpu-sanitize %s 2>&1 \ |
| 12 | +// RUN: | FileCheck -check-prefixes=XNACKNONE-DAG,GPUSAN,XNACKNONE %s |
| 13 | + |
| 14 | +// RUN: %clang -### -fopenmp --offload-arch=gfx908 -fsanitize=address -fgpu-sanitize %s 2>&1 \ |
| 15 | +// RUN: | FileCheck -check-prefixes=XNACKNONE-DAG,GPUSAN,XNACKNONE %s |
| 16 | + |
| 17 | +// RUN: %clang -### -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908:xnack+ -fsanitize=address -fgpu-sanitize %s 2>&1 \ |
| 18 | +// RUN: | FileCheck -check-prefixes=GPUSAN,XNACKPOS %s |
| 19 | + |
| 20 | +// RUN: %clang -### -fopenmp --offload-arch=gfx908:xnack+ -fsanitize=address -fgpu-sanitize %s 2>&1 \ |
| 21 | +// RUN: | FileCheck -check-prefixes=GPUSAN,XNACKPOS %s |
| 22 | + |
| 23 | +// RUN: %clang -### -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908:xnack+ -fsanitize=address -fno-gpu-sanitize %s 2>&1 \ |
| 24 | +// RUN: | FileCheck -check-prefixes=NOGPUSAN,XNACKPOS %s |
| 25 | + |
| 26 | +// RUN: %clang -### -fopenmp --offload-arch=gfx908:xnack+ -fsanitize=address -fno-gpu-sanitize %s 2>&1 \ |
| 27 | +// RUN: | FileCheck -check-prefixes=NOGPUSAN,XNACKPOS %s |
| 28 | + |
| 29 | +// RUN: %clang -### -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908:xnack- -fsanitize=address -fno-gpu-sanitize %s 2>&1 \ |
| 30 | +// RUN: | FileCheck -check-prefixes=NOGPUSAN,XNACKNEG %s |
| 31 | + |
| 32 | +// RUN: %clang -### -fopenmp --offload-arch=gfx908:xnack- -fsanitize=address -fno-gpu-sanitize %s 2>&1 \ |
| 33 | +// RUN: | FileCheck -check-prefixes=NOGPUSAN,XNACKNEG %s |
| 34 | + |
| 35 | +// XNACK-DAG: warning: ignoring '-fsanitize=address' option as it is not currently supported for offload arch 'gfx908:xnack-'. Use it with an offload arch containing 'xnack+' instead |
| 36 | +// XNACKNONE-DAG: warning: ignoring '-fsanitize=address' option as it is not currently supported for offload arch 'gfx908'. Use it with an offload arch containing 'xnack+' instead |
| 37 | + |
| 38 | +// GPUSAN: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fopenmp"{{.*}}"-fsanitize=address"{{.*}}"-fopenmp-targets=amdgcn-amd-amdhsa"{{.*}}"-x" "c"{{.*}} |
| 39 | +// GPUSAN: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fopenmp"{{.*}}"-fsanitize=address"{{.*}}"-fopenmp-targets=amdgcn-amd-amdhsa"{{.*}}"-x" "ir"{{.*}} |
| 40 | +// GPUSAN: clang{{.*}}"-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc"{{.*}}"-target-cpu" "gfx908"{{.*}}"-fcuda-is-device"{{.*}}"-fopenmp"{{.*}}"-fsanitize=address"{{.*}} |
| 41 | +// GPUSAN: llvm-link{{.*}}"--internalize" "--only-needed"{{.*}}"{{.*}}asanrtl.bc"{{.*}}"{{.*}}libomptarget-amdgcn-gfx908.bc"{{.*}}"-o" "{{.*}}.bc" |
| 42 | + |
| 43 | +// NOGPUSAN: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fopenmp"{{.*}}"-fsanitize=address"{{.*}}"-fopenmp-targets=amdgcn-amd-amdhsa"{{.*}}"-x" "c"{{.*}} |
| 44 | +// NOGPUSAN: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fopenmp"{{.*}}"-fsanitize=address"{{.*}}"-fopenmp-targets=amdgcn-amd-amdhsa"{{.*}}"-x" "ir"{{.*}} |
| 45 | +// NOGPUSAN: clang{{.*}}"-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc"{{.*}}"-target-cpu" "gfx908"{{.*}}"-fcuda-is-device"{{.*}}"-fopenmp"{{.*}} |
| 46 | +// NOGPUSAN: llvm-link{{.*}}"--internalize" "--only-needed"{{.*}}"{{.*}}libomptarget-amdgcn-gfx908.bc"{{.*}}"-o" "{{.*}}.bc" |
| 47 | + |
| 48 | +// XNACKNEG: opt{{.*}}"-mtriple=amdgcn-amd-amdhsa"{{.*}}"-mcpu=gfx908" "-mattr=-xnack"{{.*}}"-o" "{{.*}}.bc" |
| 49 | +// XNACKNEG: llc{{.*}}"-mtriple=amdgcn-amd-amdhsa"{{.*}}"-mcpu=gfx908" "-filetype=obj"{{.*}}"-mattr=-xnack"{{.*}}"-o" "{{.*}}.o" |
| 50 | +// XNACKNEG: lld{{.*}}"-flavor" "gnu" "--no-undefined" "-shared" "-o"{{.*}}.out{{.*}}"-plugin-opt=mcpu=gfx908" "-plugin-opt=-mattr=-xnack" |
| 51 | +// XNACKNEG: clang-offload-wrapper{{.*}}"-target" "x86_64-unknown-linux-gnu"{{.*}}"--offload-arch=gfx908:xnack-"{{.*}} |
| 52 | + |
| 53 | +// XNACKNONE: opt{{.*}}"-mtriple=amdgcn-amd-amdhsa"{{.*}}"-mcpu=gfx908"{{.*}}"-o" "{{.*}}.bc" |
| 54 | +// XNACKNONE: llc{{.*}}"-mtriple=amdgcn-amd-amdhsa"{{.*}}"-mcpu=gfx908" "-filetype=obj"{{.*}}"-o" "{{.*}}.o" |
| 55 | +// XNACKNONE: lld{{.*}}"-flavor" "gnu" "--no-undefined" "-shared" "-o"{{.*}}.out{{.*}}"-plugin-opt=mcpu=gfx908" |
| 56 | +// XNACKNONE: clang-offload-wrapper{{.*}}"-target" "x86_64-unknown-linux-gnu"{{.*}}"--offload-arch=gfx908"{{.*}} |
| 57 | + |
| 58 | +// XNACKPOS: opt{{.*}}"-mtriple=amdgcn-amd-amdhsa"{{.*}}"-mcpu=gfx908" "-mattr=+xnack"{{.*}}"-o" "{{.*}}.bc" |
| 59 | +// XNACKPOS: llc{{.*}}"-mtriple=amdgcn-amd-amdhsa"{{.*}}"-mcpu=gfx908" "-filetype=obj"{{.*}}"-mattr=+xnack"{{.*}}"-o" "{{.*}}.o" |
| 60 | +// XNACKPOS: lld{{.*}}"-flavor" "gnu" "--no-undefined" "-shared" "-o"{{.*}}.out{{.*}}"-plugin-opt=mcpu=gfx908" "-plugin-opt=-mattr=+xnack" |
| 61 | +// XNACKPOS: clang-offload-wrapper{{.*}}"-target" "x86_64-unknown-linux-gnu"{{.*}}"--offload-arch=gfx908:xnack+"{{.*}} |
| 62 | + |
| 63 | +// RUN: %clang -### -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx908:xnack+ -fsanitize=address -fgpu-sanitize -nogpuinc --rocm-path=%S/Inputs/rocm-invalid %s 2>&1 \ |
| 64 | +// RUN: | FileCheck --check-prefix=FAIL %s |
| 65 | + |
| 66 | +// FAIL: error: AMDGPU address sanitizer runtime library (asanrtl) not found. Please install ROCm device library which supports address sanitizer |
0 commit comments