-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86][test] Added extra cet tests, NFC (#88736)
Updated cet test to: -Check different modules based on different cet options -Added negative tests also --------- Signed-off-by: Isha Agarwal <isha.agarwal@intel.com>
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
// RUN: %clang_cc1 -E -triple i386 -dM -o - -fcf-protection=return %s | FileCheck %s --check-prefix=RETURN | ||
// RUN: %clang_cc1 -E -triple i386 -dM -o - -fcf-protection=branch %s | FileCheck %s --check-prefix=BRANCH | ||
// RUN: %clang_cc1 -E -triple i386 -dM -o - -fcf-protection=full %s | FileCheck %s --check-prefix=FULL | ||
// RUN: %clang_cc1 -E -triple=x86_64 -dM -o - -fcf-protection=none %s | FileCheck %s --check-prefix=NOTCET | ||
// RUN: not %clang_cc1 -emit-llvm-only -triple i386 -target-cpu pentium-mmx -fcf-protection=branch %s 2>&1 | FileCheck %s --check-prefix=NOCFPROT | ||
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=return %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTR,CFPROTNONE | ||
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=branch %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTB,CFPROTNONE | ||
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=full %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTR,CFPROTB,CFPROTNONE | ||
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=none %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTNONE | ||
|
||
// RETURN: #define __CET__ 2 | ||
// BRANCH: #define __CET__ 1 | ||
// FULL: #define __CET__ 3 | ||
// CFPROT: !{i32 8, !"cf-protection-branch", i32 1} | ||
|
||
// NOTCET-NOT: #define __CET__ | ||
// NOCFPROT: error: option 'cf-protection=branch' cannot be specified on this target | ||
// CFPROTR: !{i32 8, !"cf-protection-return", i32 1} | ||
// CFPROTB: !{i32 8, !"cf-protection-branch", i32 1} | ||
// CFPROTNONE-NOT: cf-protection- | ||
|
||
void foo() {} |