[clang] 539163a - [X86] Add tests to clang Driver to ensure that SLH/Retpoline features are not enabled with LVI-CFI

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 10:48:28 PDT 2020


Author: Scott Constable
Date: 2020-04-14T10:47:27-07:00
New Revision: 539163affea7dc006c341ec82d80aece26a3c643

URL: https://github.com/llvm/llvm-project/commit/539163affea7dc006c341ec82d80aece26a3c643
DIFF: https://github.com/llvm/llvm-project/commit/539163affea7dc006c341ec82d80aece26a3c643.diff

LOG: [X86] Add tests to clang Driver to ensure that SLH/Retpoline features are not enabled with LVI-CFI

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

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 a280caff2366..721972c33158 100644
--- a/clang/test/Driver/x86-target-features.c
+++ b/clang/test/Driver/x86-target-features.c
@@ -159,6 +159,13 @@
 // LVICFI: "-target-feature" "+lvi-cfi"
 // NO-LVICFI-NOT: lvi-cfi
 
+// RUN: %clang -target i386-linux-gnu -mlvi-cfi -mspeculative-load-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVICFI-SLH %s
+// LVICFI-SLH: error: invalid argument 'mspeculative-load-hardening' not allowed with 'mlvi-cfi'
+// RUN: %clang -target i386-linux-gnu -mlvi-cfi -mretpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVICFI-RETPOLINE %s
+// LVICFI-RETPOLINE: error: invalid argument 'mretpoline' not allowed with 'mlvi-cfi'
+// RUN: %clang -target i386-linux-gnu -mlvi-cfi -mretpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVICFI-RETPOLINE-EXTERNAL-THUNK %s
+// LVICFI-RETPOLINE-EXTERNAL-THUNK: error: invalid argument 'mretpoline-external-thunk' not allowed with 'mlvi-cfi'
+
 // RUN: %clang -target i386-linux-gnu -mwaitpkg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=WAITPKG %s
 // RUN: %clang -target i386-linux-gnu -mno-waitpkg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-WAITPKG %s
 // WAITPKG: "-target-feature" "+waitpkg"


        


More information about the cfe-commits mailing list