Skip to content

Commit 135472b

Browse files
authored
[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 <[email protected]>
1 parent 3c721b9 commit 135472b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
// RUN: %clang_cc1 -E -triple i386 -dM -o - -fcf-protection=return %s | FileCheck %s --check-prefix=RETURN
22
// RUN: %clang_cc1 -E -triple i386 -dM -o - -fcf-protection=branch %s | FileCheck %s --check-prefix=BRANCH
33
// RUN: %clang_cc1 -E -triple i386 -dM -o - -fcf-protection=full %s | FileCheck %s --check-prefix=FULL
4+
// RUN: %clang_cc1 -E -triple=x86_64 -dM -o - -fcf-protection=none %s | FileCheck %s --check-prefix=NOTCET
45
// RUN: not %clang_cc1 -emit-llvm-only -triple i386 -target-cpu pentium-mmx -fcf-protection=branch %s 2>&1 | FileCheck %s --check-prefix=NOCFPROT
6+
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=return %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTR,CFPROTNONE
7+
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=branch %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTB,CFPROTNONE
8+
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=full %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTR,CFPROTB,CFPROTNONE
9+
// RUN: %clang_cc1 -triple=x86_64 -o - -fcf-protection=none %s -emit-llvm | FileCheck %s --check-prefixes=CFPROTNONE
510

611
// RETURN: #define __CET__ 2
712
// BRANCH: #define __CET__ 1
813
// FULL: #define __CET__ 3
9-
// CFPROT: !{i32 8, !"cf-protection-branch", i32 1}
10-
14+
// NOTCET-NOT: #define __CET__
1115
// NOCFPROT: error: option 'cf-protection=branch' cannot be specified on this target
16+
// CFPROTR: !{i32 8, !"cf-protection-return", i32 1}
17+
// CFPROTB: !{i32 8, !"cf-protection-branch", i32 1}
18+
// CFPROTNONE-NOT: cf-protection-
1219

1320
void foo() {}

0 commit comments

Comments
 (0)