summaryrefslogtreecommitdiffstats
path: root/tests/codegen/sanitizer/kcfi-add-kcfi-flag.rs
blob: 6d466b93c406aa20c0dc0bb033bd6125b37c9c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Verifies that "kcfi" module flag is added.
//
// revisions: aarch64 x86_64
// [aarch64] compile-flags: --target aarch64-unknown-none
// [aarch64] needs-llvm-components: aarch64
// [x86_64] compile-flags: --target x86_64-unknown-none
// [x86_64] needs-llvm-components: x86
// compile-flags: -Ctarget-feature=-crt-static -Zsanitizer=kcfi

#![feature(no_core, lang_items)]
#![crate_type="lib"]
#![no_core]

#[lang="sized"]
trait Sized { }
#[lang="copy"]
trait Copy { }

pub fn foo() {
}

// CHECK: !{{[0-9]+}} = !{i32 4, !"kcfi", i32 1}