Skip to content

Commit 1d86393

Browse files
scottconstabletstellar
authored andcommitted
[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
1 parent ac40e7a commit 1d86393

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@
159159
// LVICFI: "-target-feature" "+lvi-cfi"
160160
// NO-LVICFI-NOT: lvi-cfi
161161

162+
// RUN: %clang -target i386-linux-gnu -mlvi-cfi -mspeculative-load-hardening %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVICFI-SLH %s
163+
// LVICFI-SLH: error: invalid argument 'mspeculative-load-hardening' not allowed with 'mlvi-cfi'
164+
// RUN: %clang -target i386-linux-gnu -mlvi-cfi -mretpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=LVICFI-RETPOLINE %s
165+
// LVICFI-RETPOLINE: error: invalid argument 'mretpoline' not allowed with 'mlvi-cfi'
166+
// 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
167+
// LVICFI-RETPOLINE-EXTERNAL-THUNK: error: invalid argument 'mretpoline-external-thunk' not allowed with 'mlvi-cfi'
168+
162169
// RUN: %clang -target i386-linux-gnu -mwaitpkg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=WAITPKG %s
163170
// RUN: %clang -target i386-linux-gnu -mno-waitpkg %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-WAITPKG %s
164171
// WAITPKG: "-target-feature" "+waitpkg"

0 commit comments

Comments
 (0)