From e2a1639c738c46f65d978fde161c10bac86392af Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 31 Oct 2020 00:14:59 -0700 Subject: [PATCH] [test] Fix unused check prefixes in test/Driver Note, the deprecated AArch64 -msign-return-address= does not accept b-key. So delete the incorrect tests. --- clang/test/Driver/aarch64-security-options.c | 9 --------- clang/test/Driver/arch-specific-libdir-rpath.c | 2 +- clang/test/Driver/arm-execute-only.c | 2 +- clang/test/Driver/cl-denorms-are-zero.cl | 1 + clang/test/Driver/fopenmp.c | 2 +- clang/test/Driver/fsanitize-blacklist.c | 2 +- clang/test/Driver/fuzzer.c | 8 ++++---- clang/test/Driver/hip-phases.hip | 2 +- clang/test/Driver/rocm-detect.cl | 5 +++-- clang/test/Driver/rocm-detect.hip | 4 +++- 10 files changed, 16 insertions(+), 21 deletions(-) diff --git a/clang/test/Driver/aarch64-security-options.c b/clang/test/Driver/aarch64-security-options.c index 9ba5067..00ea1f4 100644 --- a/clang/test/Driver/aarch64-security-options.c +++ b/clang/test/Driver/aarch64-security-options.c @@ -9,15 +9,6 @@ // RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=all 2>&1 | \ // RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-A --check-prefix=BTE-OFF -// Check that the -msign-return-address= option can also accept the signing key -// to use. - -// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=non-leaf 2>&1 | \ -// RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-B --check-prefix=BTE-OFF - -// RUN: %clang -target aarch64--none-eabi -c %s -### -msign-return-address=all 2>&1 | \ -// RUN: FileCheck %s --check-prefix=RA-ALL --check-prefix=KEY-B --check-prefix=BTE-OFF - // -mbranch-protection with standard // RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=standard 2>&1 | \ // RUN: FileCheck %s --check-prefix=RA-NON-LEAF --check-prefix=KEY-A --check-prefix=BTE-ON diff --git a/clang/test/Driver/arch-specific-libdir-rpath.c b/clang/test/Driver/arch-specific-libdir-rpath.c index 2ea41aa..1aa5bc8 100644 --- a/clang/test/Driver/arch-specific-libdir-rpath.c +++ b/clang/test/Driver/arch-specific-libdir-rpath.c @@ -84,7 +84,7 @@ // NO-RPATH-X86_64-NOT: "-rpath" "[[RESDIR]]{{(/|\\\\)lib(/|\\\\)linux(/|\\\\)x86_64}}" // // LIBPATH-AARCH64: -L[[RESDIR]]{{(/|\\\\)lib(/|\\\\)linux(/|\\\\)aarch64}} -// RPATH-AAARCH4: "-rpath" "[[RESDIR]]{{(/|\\\\)lib(/|\\\\)linux(/|\\\\)aarch64}}" +// RPATH-AARCH64: "-rpath" "[[RESDIR]]{{(/|\\\\)lib(/|\\\\)linux(/|\\\\)aarch64}}" // // NO-LIBPATH-NOT: "-L{{[^"]*Inputs(/|\\\\)resource_dir}}" // NO-RPATH-NOT: "-rpath" {{.*(/|\\\\)Inputs(/|\\\\)resource_dir}} diff --git a/clang/test/Driver/arm-execute-only.c b/clang/test/Driver/arm-execute-only.c index c73785d..81b822f 100644 --- a/clang/test/Driver/arm-execute-only.c +++ b/clang/test/Driver/arm-execute-only.c @@ -11,7 +11,7 @@ // CHECK-EXECUTE-ONLY-LONG-CALLS: error: option '-mexecute-only' cannot be specified with '-mlong-calls' // RUN: %clang -target armv7m-eabi -x assembler -mexecute-only %s -c -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY -check-prefix CHECK-NO-EXECUTE-ONLY-ASM +// RUN: | FileCheck %s --check-prefix=CHECK-NO-EXECUTE-ONLY-ASM // CHECK-NO-EXECUTE-ONLY-ASM: warning: argument unused during compilation: '-mexecute-only' // -mpure-code flag for GCC compatibility diff --git a/clang/test/Driver/cl-denorms-are-zero.cl b/clang/test/Driver/cl-denorms-are-zero.cl index e3fd095..31c1be8c 100644 --- a/clang/test/Driver/cl-denorms-are-zero.cl +++ b/clang/test/Driver/cl-denorms-are-zero.cl @@ -18,6 +18,7 @@ // RUN: %clang -### -target amdgcn--amdhsa -nogpulib -c %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-DENORM %s // RUN: %clang -### -cl-denorms-are-zero -o - -target amdgcn--amdhsa -nogpulib -c %s 2>&1 | FileCheck -check-prefixes=AMDGCN,AMDGCN-FLUSH %s +// AMDGCN: "-triple" "amdgcn-unknown-amdhsa" // AMDGCN-FLUSH: "-fdenormal-fp-math-f32=preserve-sign,preserve-sign" // This should be omitted and default to ieee diff --git a/clang/test/Driver/fopenmp.c b/clang/test/Driver/fopenmp.c index c45dbaf..b467fbe 100644 --- a/clang/test/Driver/fopenmp.c +++ b/clang/test/Driver/fopenmp.c @@ -114,7 +114,7 @@ // CHECK-LD-STATIC-GOMP: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-STATIC-GOMP: "-Bstatic" "-lgomp" "-Bdynamic" // CHECK-LD-STATIC-GOMP-RT: "-lrt" -// CHECK-LD-STATIC-NO-GOMP-RT-NOT: "-lrt" +// CHECK-LD-STATIC-GOMP-NO-RT-NOT: "-lrt" // // CHECK-LD-STATIC-IOMP5: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-STATIC-IOMP5: "-Bstatic" "-liomp5" "-Bdynamic" diff --git a/clang/test/Driver/fsanitize-blacklist.c b/clang/test/Driver/fsanitize-blacklist.c index 254421c..f332161 100644 --- a/clang/test/Driver/fsanitize-blacklist.c +++ b/clang/test/Driver/fsanitize-blacklist.c @@ -30,7 +30,7 @@ // CHECK-DEFAULT-UBSAN-BLACKLIST: -fsanitize-system-blacklist={{.*}}ubsan_blacklist.txt // Check that combining ubsan and another sanitizer results in both blacklists being used. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined,address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --check-prefix=CHECK-DEFAULT-ASAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist= +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined,address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --check-prefix=CHECK-DEFAULT-BLACKLIST-ASAN --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist= // Ignore -fsanitize-blacklist flag if there is no -fsanitize flag. // RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE --check-prefix=DELIMITERS diff --git a/clang/test/Driver/fuzzer.c b/clang/test/Driver/fuzzer.c index d91dd57..de1d51d 100644 --- a/clang/test/Driver/fuzzer.c +++ b/clang/test/Driver/fuzzer.c @@ -1,12 +1,12 @@ // Test flags inserted by -fsanitize=fuzzer. -// RUN: %clang -fsanitize=fuzzer %s -target x86_64-apple-darwin14 -### 2>&1 | FileCheck --check-prefixes=CHECK-FUZZER-LIB,CHECK-COVERAGE-FLAGS %s +// RUN: %clang -fsanitize=fuzzer %s -target x86_64-apple-darwin14 -### 2>&1 | FileCheck --check-prefixes=CHECK-FUZZER-LIB,CHECK-COVERAGE %s // -// CHECK-FUZZER-LIB: libclang_rt.fuzzer -// CHECK-COVERAGE: -fsanitize-coverage-inline-8bit-counters -// CHECK-COVERAGE-SAME: -fsanitize-coverage-indirect-calls +// CHECK-COVERAGE: -fsanitize-coverage-indirect-calls // CHECK-COVERAGE-SAME: -fsanitize-coverage-trace-cmp +// CHECK-COVERAGE-SAME: -fsanitize-coverage-inline-8bit-counters // CHECK-COVERAGE-SAME: -fsanitize-coverage-pc-table +// CHECK-FUZZER-LIB: libclang_rt.fuzzer // RUN: %clang -fsanitize=fuzzer -target i386-unknown-linux -stdlib=platform %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-LINUX %s // diff --git a/clang/test/Driver/hip-phases.hip b/clang/test/Driver/hip-phases.hip index 241448d..b4d1f3a 100644 --- a/clang/test/Driver/hip-phases.hip +++ b/clang/test/Driver/hip-phases.hip @@ -98,7 +98,7 @@ // // RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \ // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -fgpu-rdc 2>&1 \ -// RUN: | FileCheck -check-prefixes=RDC2,CL2,RCL2 %s +// RUN: | FileCheck -check-prefixes=RDC2,RCL2 %s // RUN: %clang -x hip -target x86_64-unknown-linux-gnu -ccc-print-phases \ // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s -fgpu-rdc -c 2>&1 \ diff --git a/clang/test/Driver/rocm-detect.cl b/clang/test/Driver/rocm-detect.cl index 2fac3aa..94a4068 100644 --- a/clang/test/Driver/rocm-detect.cl +++ b/clang/test/Driver/rocm-detect.cl @@ -13,9 +13,10 @@ // RUN: %clang -### -v -target amdgcn-amd-amdhsa -mcpu=gfx902 -nogpulib \ // RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ -// RUN: | FileCheck -check-prefixes=COMMON,GFX902,NODEFAULTLIBS %s - +// RUN: | FileCheck -check-prefixes=COMMON,NODEFAULTLIBS %s // GFX902-DEFAULTLIBS: error: cannot find ROCm device library for gfx902. Provide its path via --rocm-path or --rocm-device-lib-path, or pass -nogpulib to build without ROCm device library // NODEFAULTLIBS-NOT: error: cannot find + +// COMMON: "-triple" "amdgcn-amd-amdhsa" diff --git a/clang/test/Driver/rocm-detect.hip b/clang/test/Driver/rocm-detect.hip index 3a3a028..a329a98 100644 --- a/clang/test/Driver/rocm-detect.hip +++ b/clang/test/Driver/rocm-detect.hip @@ -19,9 +19,11 @@ // RUN: %clang -### -v -target x86_64-linux-gnu --cuda-gpu-arch=gfx902 -nogpulib \ // RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \ -// RUN: | FileCheck -check-prefixes=COMMON,GFX902,NODEFAULTLIBS %s +// RUN: | FileCheck -check-prefixes=COMMON,NODEFAULTLIBS %s // GFX902-DEFAULTLIBS: error: cannot find ROCm device library for gfx902. Provide its path via --rocm-path or --rocm-device-lib-path, or pass -nogpulib to build without ROCm device library // NODEFAULTLIBS-NOT: error: cannot find + +// COMMON: "-triple" "amdgcn-amd-amdhsa" -- 2.7.4