summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/x86-cf-protection.c
diff options
context:
space:
mode:
authorAlexander Ivchenko <alexander.ivchenko@intel.com>2018-05-18 11:56:21 +0000
committerAlexander Ivchenko <alexander.ivchenko@intel.com>2018-05-18 11:56:21 +0000
commit0fb8c877c4a3f4fd74e1d3141b09cd22041f0291 (patch)
tree2796b76ffcc5fbffc4bba741bef663f85fe85b7d /clang/test/CodeGen/x86-cf-protection.c
parentde54c058a68955c71e8040bffceeceed2816c2e5 (diff)
downloadbcm5719-llvm-0fb8c877c4a3f4fd74e1d3141b09cd22041f0291.tar.gz
bcm5719-llvm-0fb8c877c4a3f4fd74e1d3141b09cd22041f0291.zip
This patch aims to match the changes introduced
in gcc by https://gcc.gnu.org/ml/gcc-cvs/2018-04/msg00534.html. The -mibt feature flag is being removed, and the -fcf-protection option now also defines a CET macro and causes errors when used on non-X86 targets, while X86 targets no longer check for -mibt and -mshstk to determine if -fcf-protection is supported. -mshstk is now used only to determine availability of shadow stack intrinsics. Comes with an LLVM patch (D46882). Patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D46881 llvm-svn: 332704
Diffstat (limited to 'clang/test/CodeGen/x86-cf-protection.c')
-rw-r--r--clang/test/CodeGen/x86-cf-protection.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/test/CodeGen/x86-cf-protection.c b/clang/test/CodeGen/x86-cf-protection.c
index 044f839c348..7197dacc4ba 100644
--- a/clang/test/CodeGen/x86-cf-protection.c
+++ b/clang/test/CodeGen/x86-cf-protection.c
@@ -1,6 +1,8 @@
-// RUN: not %clang_cc1 -fsyntax-only -S -o %t -triple i386-unknown-unknown -fcf-protection=return %s 2>&1 | FileCheck %s --check-prefix=RETURN
-// RUN: not %clang_cc1 -fsyntax-only -S -o %t -triple i386-unknown-unknown -fcf-protection=branch %s 2>&1 | FileCheck %s --check-prefix=BRANCH
+// RUN: %clang -target i386-unknown-unknown -x c -E -dM -o - -fcf-protection=return %s | FileCheck %s --check-prefix=RETURN
+// RUN: %clang -target i386-unknown-unknown -x c -E -dM -o - -fcf-protection=branch %s | FileCheck %s --check-prefix=BRANCH
+// RUN: %clang -target i386-unknown-unknown -x c -E -dM -o - -fcf-protection=full %s | FileCheck %s --check-prefix=FULL
-// RETURN: error: option 'cf-protection=return' cannot be specified without '-mshstk'
-// BRANCH: error: option 'cf-protection=branch' cannot be specified without '-mibt'
+// RETURN: #define __CET__ 2
+// BRANCH: #define __CET__ 1
+// FULL: #define __CET__ 3
void foo() {}
OpenPOWER on IntegriCloud