[clang] 7e65ffa - [test, x86] Fix spurious x86-target-features.c failure

Thomas Preud'homme via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 01:27:40 PDT 2022


Author: Thomas Preud'homme
Date: 2022-05-18T09:27:32+01:00
New Revision: 7e65ffaa8bb65adc0324ccbea1fef56cab6eafe1

URL: https://github.com/llvm/llvm-project/commit/7e65ffaa8bb65adc0324ccbea1fef56cab6eafe1
DIFF: https://github.com/llvm/llvm-project/commit/7e65ffaa8bb65adc0324ccbea1fef56cab6eafe1.diff

LOG: [test, x86] Fix spurious x86-target-features.c failure

x86-target-features.c can spuriously fail when checking for absence of
the string "lvi" in the compiler output due to the temporary path used
for the output file. For example:
"-o" "/tmp/lit-tmp-981j7lvi/x86-target-features-670b86.o"
will make the test fail. This commit checks specifically for lvi as a
target feature, in a similar way to the positive CHECK directive just
above.

Test Plan: fails when using -mlvi-hardening and pass otherwise

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D125084

Added: 
    

Modified: 
    clang/test/Driver/x86-target-features.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/x86-target-features.c b/clang/test/Driver/x86-target-features.c
index 42385dd5f0a48..078680c1ea81b 100644
--- a/clang/test/Driver/x86-target-features.c
+++ b/clang/test/Driver/x86-target-features.c
@@ -170,7 +170,7 @@
 // RUN: %clang -target i386-linux-gnu -mlvi-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVIHARDENING %s
 // RUN: %clang -target i386-linux-gnu -mno-lvi-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-LVIHARDENING %s
 // LVIHARDENING: "-target-feature" "+lvi-load-hardening" "-target-feature" "+lvi-cfi"
-// NO-LVIHARDENING-NOT: lvi
+// NO-LVIHARDENING-NOT: "+lvi-
 
 // RUN: %clang -target i386-linux-gnu -mlvi-hardening -mspeculative-load-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVIHARDENING-SLH %s
 // LVIHARDENING-SLH: error: invalid argument 'mspeculative-load-hardening' not allowed with 'mlvi-hardening'


        


More information about the cfe-commits mailing list