test(ffi-linkage): xfail postfix extern on #objc_class aggregate (Phase 3.0)
This commit is contained in:
28
examples/1348-ffi-objc-extern-class.sx
Normal file
28
examples/1348-ffi-objc-extern-class.sx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Phase 3.0 (FFI-linkage) — postfix `extern` on an aggregate (`#objc_class`)
|
||||
// is the new spelling of the legacy prefix `#foreign #objc_class` import.
|
||||
// Mirrors 1306's foreign-class chained dispatch with the new syntax:
|
||||
// Name :: #objc_class("X") extern { … } == Name :: #foreign #objc_class("X") { … }
|
||||
//
|
||||
// Red until 3.1 wires the postfix-extern aggregate path through the parser
|
||||
// + lowering (maps `extern` → reference, same as `#foreign`).
|
||||
|
||||
#import "modules/std.sx";
|
||||
#import "modules/build.sx";
|
||||
|
||||
NSObject :: #objc_class("NSObject") extern {
|
||||
alloc :: () -> *NSObject;
|
||||
init :: (self: *Self) -> *Self;
|
||||
}
|
||||
|
||||
main :: () -> i32 {
|
||||
inline if OS == .macos {
|
||||
a := NSObject.alloc().init();
|
||||
if a != null {
|
||||
print("extern-class dispatch ok\n");
|
||||
}
|
||||
}
|
||||
inline if OS != .macos {
|
||||
print("extern-class dispatch ok\n");
|
||||
}
|
||||
0
|
||||
}
|
||||
1
examples/expected/1348-ffi-objc-extern-class.exit
Normal file
1
examples/expected/1348-ffi-objc-extern-class.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
0
examples/expected/1348-ffi-objc-extern-class.stderr
Normal file
0
examples/expected/1348-ffi-objc-extern-class.stderr
Normal file
1
examples/expected/1348-ffi-objc-extern-class.stdout
Normal file
1
examples/expected/1348-ffi-objc-extern-class.stdout
Normal file
@@ -0,0 +1 @@
|
||||
extern-class dispatch ok
|
||||
Reference in New Issue
Block a user