Skip to content

Commit 94ca2b6

Browse files
committed
Make emit-arity-indicator.rs a no_core test
The presence of `@add-core-stubs` indicates that this was already intended.
1 parent 3f343f0 commit 94ca2b6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
//@ min-llvm-version: 21.0.0
99

1010
#![crate_type = "lib"]
11+
#![feature(no_core)]
12+
#![no_core]
13+
14+
extern crate minicore;
15+
16+
unsafe extern "C" {
17+
safe fn add(x: i32, y: i32) -> i32;
18+
}
1119

1220
pub fn add_one(x: i32) -> i32 {
1321
// CHECK-LABEL: __cfi__{{.*}}7add_one{{.*}}:
@@ -23,7 +31,7 @@ pub fn add_one(x: i32) -> i32 {
2331
// CHECK-NEXT: nop
2432
// CHECK-NEXT: nop
2533
// CHECK-NEXT: mov ecx, 2628068948
26-
x + 1
34+
add(x, 1)
2735
}
2836

2937
pub fn add_two(x: i32, _y: i32) -> i32 {
@@ -40,7 +48,7 @@ pub fn add_two(x: i32, _y: i32) -> i32 {
4048
// CHECK-NEXT: nop
4149
// CHECK-NEXT: nop
4250
// CHECK-NEXT: mov edx, 2505940310
43-
x + 2
51+
add(x, 2)
4452
}
4553

4654
pub fn do_twice(f: fn(i32) -> i32, arg: i32) -> i32 {
@@ -57,5 +65,5 @@ pub fn do_twice(f: fn(i32) -> i32, arg: i32) -> i32 {
5765
// CHECK-NEXT: nop
5866
// CHECK-NEXT: nop
5967
// CHECK-NEXT: mov edx, 653723426
60-
f(arg) + f(arg)
68+
add(f(arg), f(arg))
6169
}

0 commit comments

Comments
 (0)