Skip to content

Commit 5e7442e

Browse files
committed
make tests/codegen-llvm/darwin-objc.rs no_core so we can test more targets
1 parent 461dc01 commit 5e7442e

File tree

1 file changed

+35
-25
lines changed

1 file changed

+35
-25
lines changed

tests/codegen-llvm/darwin-objc.rs

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,53 @@
11
// ignore-tidy-linelength
2-
// //@ revisions: i686_apple_darwin
3-
// //@ [i686_apple_darwin] compile-flags: --target i686-apple-darwin
4-
// //@ [i686_apple_darwin] needs-llvm-components: x86
2+
//@ add-core-stubs
3+
//@ revisions: i686_apple_darwin
4+
//@ [i686_apple_darwin] compile-flags: --target i686-apple-darwin
5+
//@ [i686_apple_darwin] needs-llvm-components: x86
56
//@ revisions: x86_64_apple_darwin
67
//@ [x86_64_apple_darwin] compile-flags: --target x86_64-apple-darwin
78
//@ [x86_64_apple_darwin] needs-llvm-components: x86
89
//@ revisions: aarch64_apple_darwin
910
//@ [aarch64_apple_darwin] compile-flags: --target aarch64-apple-darwin
1011
//@ [aarch64_apple_darwin] needs-llvm-components: aarch64
11-
// //@ revisions: i386_apple_ios
12-
// //@ [i386_apple_ios] compile-flags: --target i386-apple-ios
13-
// //@ [i386_apple_ios] needs-llvm-components: x86
14-
// //@ revisions: x86_64_apple_ios
15-
// //@ [x86_64_apple_ios] compile-flags: --target x86_64-apple-ios
16-
// //@ [x86_64_apple_ios] needs-llvm-components: x86
17-
// //@ revisions: armv7s_apple_ios
18-
// //@ [armv7s_apple_ios] compile-flags: --target armv7s-apple-ios
19-
// //@ [armv7s_apple_ios] needs-llvm-components: arm
20-
// //@ revisions: aarch64_apple_ios
21-
// //@ [aarch64_apple_ios] compile-flags: --target aarch64-apple-ios
22-
// //@ [aarch64_apple_ios] needs-llvm-components: aarch64
23-
// //@ revisions: aarch64_apple_ios_sim
24-
// //@ [aarch64_apple_ios_sim] compile-flags: --target aarch64-apple-ios-sim
25-
// //@ [aarch64_apple_ios_sim] needs-llvm-components: aarch64
12+
//@ revisions: i386_apple_ios
13+
//@ [i386_apple_ios] compile-flags: --target i386-apple-ios
14+
//@ [i386_apple_ios] needs-llvm-components: x86
15+
//@ revisions: x86_64_apple_ios
16+
//@ [x86_64_apple_ios] compile-flags: --target x86_64-apple-ios
17+
//@ [x86_64_apple_ios] needs-llvm-components: x86
18+
//@ revisions: armv7s_apple_ios
19+
//@ [armv7s_apple_ios] compile-flags: --target armv7s-apple-ios
20+
//@ [armv7s_apple_ios] needs-llvm-components: arm
21+
//@ revisions: aarch64_apple_ios
22+
//@ [aarch64_apple_ios] compile-flags: --target aarch64-apple-ios
23+
//@ [aarch64_apple_ios] needs-llvm-components: aarch64
24+
//@ revisions: aarch64_apple_ios_sim
25+
//@ [aarch64_apple_ios_sim] compile-flags: --target aarch64-apple-ios-sim
26+
//@ [aarch64_apple_ios_sim] needs-llvm-components: aarch64
2627

2728
#![crate_type = "lib"]
28-
#![feature(darwin_objc)]
29-
#![no_std]
29+
#![feature(no_core, lang_items, rustc_attrs)]
30+
#![no_core]
3031

31-
use core::os::darwin::objc;
32+
extern crate minicore;
33+
use minicore::*;
3234

3335
#[no_mangle]
34-
pub fn get_class() -> objc::Class {
35-
objc::class!("MyClass")
36+
pub fn get_class() -> *mut () {
37+
unsafe extern "C" {
38+
#[rustc_objc_class = "MyClass"]
39+
safe static VAL: *mut ();
40+
}
41+
VAL
3642
}
3743

3844
#[no_mangle]
39-
pub fn get_selector() -> objc::SEL {
40-
objc::selector!("myMethod")
45+
pub fn get_selector() -> *mut () {
46+
unsafe extern "C" {
47+
#[rustc_objc_selector = "myMethod"]
48+
safe static VAL: *mut ();
49+
}
50+
VAL
4151
}
4252

4353
// i686_apple_darwin: %struct._objc_module = type { i32, i32, ptr, ptr }

0 commit comments

Comments
 (0)