-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
398 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
const std = @import("std"); | ||
|
||
const HashMap_i32__i32__BuildHasherDefault_DefaultHasher = opaque {}; | ||
|
||
const Result_Foo = opaque {}; | ||
|
||
/// Fast hash map used internally. | ||
pub const FastHashMap_i32__i32 = HashMap_i32__i32__BuildHasherDefault_DefaultHasher; | ||
|
||
pub const Foo = FastHashMap_i32__i32; | ||
|
||
pub const Bar = Result_Foo; | ||
|
||
pub extern fn root(a: ?*Foo, b: ?*Bar) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
const std = @import("std"); | ||
|
||
pub extern fn root() anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
const std = @import("std"); | ||
|
||
pub const PREFIXBar = extern struct { | ||
a: i32, | ||
}; | ||
pub const PREFIXFoo = extern struct { | ||
a: i32, | ||
b: u32, | ||
bar: PREFIXBar, | ||
}; | ||
|
||
pub extern fn root(x: PREFIXFoo) anyopaque; | ||
|
||
pub const PREFIXVAL = @import("std").mem.zeroInit(PREFIXFoo, .{ | ||
.a = @as(c_int, 42), | ||
.b = @as(c_int, 1337), | ||
.bar = @import("std").mem.zeroInit(PREFIXBar, .{ | ||
.a = @as(c_int, 323), | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const std = @import("std"); | ||
|
||
pub const Foo = extern struct { | ||
x: i32, | ||
}; | ||
pub const RenamedTy = extern struct { | ||
y: u64, | ||
}; | ||
pub const NoExternTy = extern struct { | ||
field: u8, | ||
}; | ||
pub const ContainsNoExternTy = extern struct { | ||
field: NoExternTy, | ||
}; | ||
|
||
pub extern fn root(a: Foo) anyopaque; | ||
|
||
pub extern fn renamed_func(a: RenamedTy) anyopaque; | ||
|
||
pub extern fn no_extern_func(a: ContainsNoExternTy) anyopaque; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
const std = @import("std"); | ||
|
||
const A = opaque { | ||
|
||
}; | ||
|
||
pub const B = extern struct { | ||
x: i32, | ||
y: f32, | ||
}; | ||
|
||
pub extern fn root( a: ?*A, b: B) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,37 @@ | ||
const std = @import("std"); | ||
|
||
pub const A = enum { | ||
A1, | ||
A2, | ||
A3, | ||
}; | ||
|
||
pub const B = enum { | ||
B1, | ||
B2, | ||
B3, | ||
}; | ||
|
||
pub const C_Tag = enum { | ||
C1, | ||
C2, | ||
C3, | ||
}; | ||
|
||
pub const C1_Body = extern struct { | ||
tag: C_Tag, | ||
a: u32, | ||
}; | ||
|
||
pub const C2_Body = extern struct { | ||
tag: C_Tag, | ||
b: u32, | ||
}; | ||
|
||
pub const C = extern union { | ||
tag: C_Tag, | ||
c1: C1_Body, | ||
c2: C2_Body, | ||
}; | ||
|
||
pub extern fn root(a: A, b: B, c: C) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
const std = @import("std"); | ||
|
||
pub const Opaque = opaque {}; | ||
pub const Option_____Opaque = opaque {}; | ||
|
||
pub const Foo = extern struct { | ||
x: ?*const Opaque, | ||
y: ?*Opaque, | ||
z: ?*const fn () anyopaque, | ||
zz: [*]?*const fn () anyopaque, | ||
}; | ||
|
||
pub const Bar = extern union { | ||
x: ?*const Opaque, | ||
y: ?*Opaque, | ||
z: ?*const fn () anyopaque, | ||
zz: [*]?*const fn () anyopaque, | ||
}; | ||
|
||
pub extern fn root(a: ?*const Opaque, b: ?*Opaque, c: Foo, d: Bar, e: ?*Option_____Opaque, f: ?*const fn (?*const Opaque) anyopaque) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
const std = @import("std"); | ||
|
||
pub const IE = enum { | ||
IV, | ||
}; | ||
|
||
pub const UE = enum { | ||
UV, | ||
}; | ||
|
||
pub const Usize = usize; | ||
|
||
pub const Isize = isize; | ||
|
||
pub extern fn root(Usize, Isize, UE, IE) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
const std = @import("std"); | ||
|
||
const Bar = opaque {}; | ||
|
||
pub const Foo = extern struct {}; | ||
|
||
pub extern const NUMBER: i32; | ||
|
||
pub extern const FOO: Foo; | ||
|
||
pub extern const BAR: Bar; | ||
|
||
pub extern fn root() anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
const std = @import("std"); | ||
|
||
const Option_i32 = opaque {}; | ||
|
||
const Result_i32__String = opaque {}; | ||
|
||
const Vec_String = opaque {}; | ||
|
||
pub extern fn root(a: ?*Vec_String, b: ?*Option_i32, c: ?*Result_i32__String) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
const std = @import("std"); | ||
|
||
const Opaque = opaque { | ||
|
||
}; | ||
|
||
pub const Normal = extern struct { | ||
x: i32, | ||
y: f32, | ||
}; | ||
|
||
pub const NormalWithZST = extern struct { | ||
x: i32, | ||
y: f32, | ||
}; | ||
|
||
pub const TupleRenamed = extern struct { | ||
m0: i32, | ||
m1: f32, | ||
}; | ||
|
||
pub const TupleNamed = extern struct { | ||
x: i32, | ||
y: f32, | ||
}; | ||
|
||
pub extern fn root( a: ?*Opaque, | ||
b: Normal, | ||
c: NormalWithZST, | ||
d: TupleRenamed, | ||
e: TupleNamed) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
const std = @import("std"); | ||
pub const Bar = opaque {}; | ||
pub const Foo = extern struct { | ||
a: i32, | ||
b: u32, | ||
}; | ||
|
||
pub const Foo_FOO = @import("std").mem.zeroInit(Foo, .{ | ||
.a = @as(c_int, 42), | ||
.b = @as(c_int, 47), | ||
}); | ||
pub const Foo_FOO2 = @import("std").mem.zeroInit(Foo, .{ | ||
.a = @as(c_int, 42), | ||
.b = @as(c_int, 47), | ||
}); | ||
pub const Foo_FOO3 = @import("std").mem.zeroInit(Foo, .{ | ||
.a = @as(c_int, 42), | ||
.b = @as(c_int, 47), | ||
}); | ||
pub const BAR = @import("std").mem.zeroInit(Foo, .{ | ||
.a = @as(c_int, 42), | ||
.b = @as(c_int, 1337), | ||
}); | ||
|
||
pub extern fn root(x: Foo, bar: Bar) void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const std = @import("std"); | ||
|
||
pub const Foo_Bar = extern struct { | ||
something: ?*i32, | ||
}; | ||
|
||
pub const Bar = extern struct { | ||
something: i32, | ||
subexpressions: Foo_Bar, | ||
}; | ||
|
||
pub extern fn root(b: Bar) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
const std = @import("std"); | ||
|
||
pub const Opaque = opaque {}; | ||
|
||
pub const SelfTypeTestStruct = extern struct { | ||
times: u8, | ||
}; | ||
|
||
pub const PointerToOpaque = extern struct { | ||
ptr: ?*Opaque, | ||
}; | ||
|
||
pub extern fn rust_print_hello_world() anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_ref(self: [*]const SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_ref_mut(self: [*]SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_not_exist_box(self: [*]SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_not_exist_return_box() [*]SelfTypeTestStruct; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_annotated_self(self: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_annotated_mut_self(self: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_annotated_by_name(self: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_annotated_mut_by_name(self: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_unannotated(self: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn SelfTypeTestStruct_should_exist_mut_unannotated(self: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn free_function_should_exist_ref(test_struct: [*]const SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn free_function_should_exist_ref_mut(test_struct: [*]SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn unnamed_argument([*]SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn free_function_should_not_exist_box(boxed: [*]SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn free_function_should_exist_annotated_by_name(test_struct: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn free_function_should_exist_annotated_mut_by_name(test_struct: SelfTypeTestStruct) anyopaque; | ||
|
||
pub extern fn PointerToOpaque_create(times: u8) PointerToOpaque; | ||
|
||
pub extern fn PointerToOpaque_sayHello(self: PointerToOpaque) anyopaque; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,93 @@ | ||
const std = @import("std"); | ||
|
||
pub const Point_i32 = extern struct { | ||
x: i32, | ||
y: i32, | ||
}; | ||
|
||
pub const Point_f32 = extern struct { | ||
x: f32, | ||
y: f32, | ||
}; | ||
|
||
pub const Foo_i32_Tag = enum { | ||
Foo_i32, | ||
Bar_i32, | ||
Baz_i32, | ||
Bazz_i32, | ||
}; | ||
|
||
pub const Foo_Body_i32 = extern struct { | ||
tag: Foo_i32_Tag, | ||
x: i32, | ||
y: Point_i32, | ||
z: Point_f32, | ||
}; | ||
|
||
pub const Foo_i32 = extern union { | ||
tag: Foo_i32_Tag, | ||
foo: Foo_Body_i32, | ||
}; | ||
|
||
pub const Bar_i32_Tag = enum { | ||
Bar1_i32, | ||
Bar2_i32, | ||
Bar3_i32, | ||
Bar4_i32, | ||
}; | ||
|
||
pub const Bar1_Body_i32 = extern struct { | ||
x: i32, | ||
y: Point_i32, | ||
z: Point_f32, | ||
u: ?fn () i32, | ||
}; | ||
|
||
pub const Bar_i32 = extern struct { | ||
tag: Bar_i32_Tag, | ||
}; | ||
|
||
pub const Point_u32 = extern struct { | ||
x: u32, | ||
y: u32, | ||
}; | ||
|
||
pub const Bar_u32_Tag = enum { | ||
Bar1_u32, | ||
Bar2_u32, | ||
Bar3_u32, | ||
Bar4_u32, | ||
}; | ||
|
||
pub const Bar1_Body_u32 = extern struct { | ||
x: i32, | ||
y: Point_u32, | ||
z: Point_f32, | ||
u: ?fn () i32, | ||
}; | ||
|
||
pub const Bar_u32 = extern struct { | ||
tag: Bar_u32_Tag, | ||
}; | ||
|
||
pub const Baz_Tag = enum { | ||
Baz1, | ||
Baz2, | ||
Baz3, | ||
}; | ||
|
||
pub const Baz = extern union { | ||
tag: Baz_Tag, | ||
}; | ||
|
||
pub const Taz_Tag = enum { | ||
Taz1, | ||
Taz2, | ||
Taz3, | ||
}; | ||
|
||
pub const Taz = extern struct { | ||
tag: Taz_Tag, | ||
}; | ||
|
||
pub extern fn foo(foo: ?*Foo_i32, bar: ?*Bar_i32, baz: ?*Baz, taz: ?*Taz) anyopaque; |
Oops, something went wrong.