[clang] 63c648f - [Driver][test] Add --rocm-path or -nogpuinc/-nogpulib to some AMDGPU tests
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 1 13:16:08 PDT 2023
Author: Fangrui Song
Date: 2023-08-01T13:16:01-07:00
New Revision: 63c648f46dff8d21ade2b77515579b29421b5b69
URL: https://github.com/llvm/llvm-project/commit/63c648f46dff8d21ade2b77515579b29421b5b69
DIFF: https://github.com/llvm/llvm-project/commit/63c648f46dff8d21ade2b77515579b29421b5b69.diff
LOG: [Driver][test] Add --rocm-path or -nogpuinc/-nogpulib to some AMDGPU tests
An upcoming change D156363 will change -### to exit with code 1
if hasErrorOccurred. Some AMDGPU tests would exit with code 1.
Added:
Modified:
clang/test/Driver/cl-denorms-are-zero.cl
clang/test/Driver/fast-math.c
clang/test/Driver/frame-pointer-elim.cl
clang/test/Driver/hip-code-object-version.hip
clang/test/Driver/opencl.cl
clang/test/Driver/split-debug.c
Removed:
################################################################################
diff --git a/clang/test/Driver/cl-denorms-are-zero.cl b/clang/test/Driver/cl-denorms-are-zero.cl
index 6ca90edc1730d6..85c268436bea3e 100644
--- a/clang/test/Driver/cl-denorms-are-zero.cl
+++ b/clang/test/Driver/cl-denorms-are-zero.cl
@@ -1,14 +1,14 @@
// Slow FMAF and slow f32 denormals
// RUN: %clang -### -target amdgcn--amdhsa -nogpulib -c -mcpu=pitcairn %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
-// RUN: %clang -### -cl-denorms-are-zero -o - --target=amdgcn--amdhsa -c -mcpu=pitcairn %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
+// RUN: %clang -### -cl-denorms-are-zero -o - --target=amdgcn--amdhsa -nogpulib -c -mcpu=pitcairn %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
// Fast FMAF, but slow f32 denormals
// RUN: %clang -### -target amdgcn--amdhsa -nogpulib -c -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
-// RUN: %clang -### -cl-denorms-are-zero -o - --target=amdgcn--amdhsa -c -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
+// RUN: %clang -### -cl-denorms-are-zero -o - --target=amdgcn--amdhsa -nogpulib -c -mcpu=tahiti %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
// Fast F32 denormals, but slow FMAF
// RUN: %clang -### -target amdgcn--amdhsa -nogpulib -c -mcpu=fiji %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
-// RUN: %clang -### -cl-denorms-are-zero -o - --target=amdgcn--amdhsa -c -mcpu=fiji %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
+// RUN: %clang -### -cl-denorms-are-zero -o - --target=amdgcn--amdhsa -nogpulib -c -mcpu=fiji %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s
// Fast F32 denormals and fast FMAF
// RUN: %clang -### -target amdgcn--amdhsa -nogpulib -c -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-DENORM %s
diff --git a/clang/test/Driver/fast-math.c b/clang/test/Driver/fast-math.c
index f72c977282e1ac..34b9899e9fc185 100644
--- a/clang/test/Driver/fast-math.c
+++ b/clang/test/Driver/fast-math.c
@@ -130,7 +130,7 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target x86_64-linux-musl -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
-// RUN: %clang -### --target=amdgcn-amd-amdhsa -c %s 2>&1 \
+// RUN: %clang -### --target=amdgcn-amd-amdhsa -nogpuinc -nogpulib -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target amdgcn-amd-amdpal -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
diff --git a/clang/test/Driver/frame-pointer-elim.cl b/clang/test/Driver/frame-pointer-elim.cl
index 76f6607a1f1758..d3cdd1518c37d4 100644
--- a/clang/test/Driver/frame-pointer-elim.cl
+++ b/clang/test/Driver/frame-pointer-elim.cl
@@ -1,8 +1,8 @@
-// RUN: %clang --target=amdgcn-amd-amdhsa -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECKNONE %s
-// RUN: %clang --target=amdgcn-amd-amdhsa -### -S -O3 -fno-omit-frame-pointer %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
-// RUN: %clang --target=amdgcn-amd-amdhsa -### -S %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
-// RUN: %clang --target=amdgcn-amd-amdhsa -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
-// RUN: %clang --target=amdgcn-amd-amdhsa -### -S -cl-opt-disable %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang --target=amdgcn-amd-amdhsa -### -nogpuinc -nogpulib -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECKNONE %s
+// RUN: %clang --target=amdgcn-amd-amdhsa -### -nogpuinc -nogpulib -S -O3 -fno-omit-frame-pointer %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang --target=amdgcn-amd-amdhsa -### -nogpuinc -nogpulib -S %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang --target=amdgcn-amd-amdhsa -### -nogpuinc -nogpulib -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang --target=amdgcn-amd-amdhsa -### -nogpuinc -nogpulib -S -cl-opt-disable %s 2>&1 | FileCheck -check-prefix=CHECKALL %s
// CHECKNONE: -mframe-pointer=none
// CHECKALL: -mframe-pointer=all
diff --git a/clang/test/Driver/hip-code-object-version.hip b/clang/test/Driver/hip-code-object-version.hip
index a2968781224dbf..0fa1e81b2d7166 100644
--- a/clang/test/Driver/hip-code-object-version.hip
+++ b/clang/test/Driver/hip-code-object-version.hip
@@ -4,7 +4,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=2 \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=V2 %s
// V2: "-mllvm" "--amdhsa-code-object-version=2"
@@ -14,12 +14,12 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=3 \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=4 -mcode-object-version=3 \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s
// V3: "-mcode-object-version=3"
@@ -30,7 +30,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=4 \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=V4 %s
// V4: "-mcode-object-version=4"
@@ -41,7 +41,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=5 \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=V5 %s
// V5: "-mcode-object-version=5"
@@ -51,7 +51,7 @@
// Check bundle ID for code object version default
// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 -nogpuinc -nogpulib \
// RUN: %s 2>&1 | FileCheck -check-prefix=VD %s
// VD: "-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx906"
@@ -60,7 +60,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=1 \
-// RUN: --offload-arch=gfx906 -nogpulib \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=INVALID %s
// INVALID: error: invalid integral value '1' in '-mcode-object-version=1'
// INVALID-NOT: error: invalid integral value
@@ -71,7 +71,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=5 \
-// RUN: --offload-arch=gfx906 -nogpulib -save-temps \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm -save-temps \
// RUN: %s 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: "-cc1" {{.*}}"-mcode-object-version=5" {{.*}}"-mllvm" "--amdhsa-code-object-version=5"
@@ -79,7 +79,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=5 \
-// RUN: --offload-arch=gfx906 -nogpulib -save-temps \
+// RUN: --offload-arch=gfx906 --rocm-path=%S/Inputs/rocm -save-temps \
// RUN: %s 2>&1 | FileCheck -check-prefix=CC1NEG %s
// CC1NEG-NOT: "-cc1as" {{.*}}"-mcode-object-version=5"
diff --git a/clang/test/Driver/opencl.cl b/clang/test/Driver/opencl.cl
index d93bb3f166e225..b9f52e07f3b1ae 100644
--- a/clang/test/Driver/opencl.cl
+++ b/clang/test/Driver/opencl.cl
@@ -22,7 +22,7 @@
// RUN: not %clang -cl-std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s
// RUN: not %clang -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s
// RUN: %clang -S -### -target spir-unknown-unknown %s 2>&1 | FileCheck --check-prefix=CHECK-W-SPIR-COMPAT %s
-// RUN: %clang -S -### --target=amdgcn-amd-amdhsa-opencl %s 2>&1 | FileCheck --check-prefix=CHECK-NO-W-SPIR-COMPAT %s
+// RUN: %clang -S -### --target=amdgcn-amd-amdhsa-opencl -nogpuinc -nogpulib %s 2>&1 | FileCheck --check-prefix=CHECK-NO-W-SPIR-COMPAT %s
// RUN: %clang -S -### -cl-ext="+test_ext" %s 2>&1 | FileCheck --check-prefix=CHECK-EXT %s
// CHECK-CL: "-cc1" {{.*}} "-cl-std=CL"
diff --git a/clang/test/Driver/split-debug.c b/clang/test/Driver/split-debug.c
index b66ea9eb97d12b..968f33b4cc035c 100644
--- a/clang/test/Driver/split-debug.c
+++ b/clang/test/Driver/split-debug.c
@@ -15,7 +15,7 @@
// SPLIT-SAME: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
// RUN: %clang -### -c -target wasm32 -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT
-// RUN: %clang -### -c --target=amdgcn-amd-amdhsa -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT
+// RUN: %clang -### -c --target=amdgcn-amd-amdhsa -nogpuinc -nogpulib -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT
// RUN: %clang_cl -### -c --target=x86_64-unknown-windows-msvc -gno-split-dwarf -gsplit-dwarf -g -- %s 2>&1 | FileCheck %s --check-prefix=SPLIT
/// -gsplit-dwarf is a no-op on a non-ELF platform.
More information about the cfe-commits
mailing list