about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-07-14 10:29:05 +0200
committerNikita Popov <npopov@redhat.com>2025-07-18 09:36:11 +0200
commita65563e9cd817e2cfd75291bb97529dfb14eb451 (patch)
treef4b7a26af8b727d0daf56d3c539b61d6f444c3ad /tests
parent12b19be741ea07934d7478bd8e450dca8f85afe5 (diff)
downloadrust-a65563e9cd817e2cfd75291bb97529dfb14eb451.tar.gz
rust-a65563e9cd817e2cfd75291bb97529dfb14eb451.zip
Make emit-arity-indicator.rs a no_core test
The presence of `@add-core-stubs` indicates that this was already
intended.
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs b/tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs
index b3b623b509b..f9966a23446 100644
--- a/tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs
+++ b/tests/assembly/sanitizer/kcfi/emit-arity-indicator.rs
@@ -8,6 +8,14 @@
 //@ min-llvm-version: 21.0.0
 
 #![crate_type = "lib"]
+#![feature(no_core)]
+#![no_core]
+
+extern crate minicore;
+
+unsafe extern "C" {
+    safe fn add(x: i32, y: i32) -> i32;
+}
 
 pub fn add_one(x: i32) -> i32 {
     // CHECK-LABEL: __cfi__{{.*}}7add_one{{.*}}:
@@ -23,7 +31,7 @@ pub fn add_one(x: i32) -> i32 {
     // CHECK-NEXT:  nop
     // CHECK-NEXT:  nop
     // CHECK-NEXT:  mov ecx, 2628068948
-    x + 1
+    add(x, 1)
 }
 
 pub fn add_two(x: i32, _y: i32) -> i32 {
@@ -40,7 +48,7 @@ pub fn add_two(x: i32, _y: i32) -> i32 {
     // CHECK-NEXT:  nop
     // CHECK-NEXT:  nop
     // CHECK-NEXT:  mov edx, 2505940310
-    x + 2
+    add(x, 2)
 }
 
 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 {
     // CHECK-NEXT:  nop
     // CHECK-NEXT:  nop
     // CHECK-NEXT:  mov edx, 653723426
-    f(arg) + f(arg)
+    add(f(arg), f(arg))
 }