| author | |
| committer | |
| log | 77a6031edbd17dfdf654f24d139f27ac7adeb82f |
| tree | f21cd44708a656b27a618d789d5a8abd3ab4d599 |
| parent | 08808701d2b70de41535bb35e4724c8279ea07b7 |
I was too greedy2 files changed, 0 insertions(+), 22 deletions(-)
test/stage1/c_abi/cfuncs.c-12| ... | ... | @@ -23,13 +23,11 @@ void zig_u8(uint8_t); |
| 23 | 23 | void zig_u16(uint16_t); |
| 24 | 24 | void zig_u32(uint32_t); |
| 25 | 25 | void zig_u64(uint64_t); |
| 26 | void zig_u128(unsigned __int128); | |
| 27 | 26 | void zig_struct_u128(struct u128); |
| 28 | 27 | void zig_i8(int8_t); |
| 29 | 28 | void zig_i16(int16_t); |
| 30 | 29 | void zig_i32(int32_t); |
| 31 | 30 | void zig_i64(int64_t); |
| 32 | void zig_i128(__int128); | |
| 33 | 31 | void zig_struct_i128(struct i128); |
| 34 | 32 | void zig_five_integers(int32_t, int32_t, int32_t, int32_t, int32_t); |
| 35 | 33 | |
| ... | ... | @@ -142,7 +140,6 @@ void run_c_tests(void) { |
| 142 | 140 | zig_u16(0xfffe); |
| 143 | 141 | zig_u32(0xfffffffd); |
| 144 | 142 | zig_u64(0xfffffffffffffffc); |
| 145 | zig_u128(0xfffffffffffffffc); | |
| 146 | 143 | { |
| 147 | 144 | struct u128 s = {0xfffffffffffffffc}; |
| 148 | 145 | zig_struct_u128(s); |
| ... | ... | @@ -152,7 +149,6 @@ void run_c_tests(void) { |
| 152 | 149 | zig_i16(-2); |
| 153 | 150 | zig_i32(-3); |
| 154 | 151 | zig_i64(-4); |
| 155 | zig_i128(-5); | |
| 156 | 152 | { |
| 157 | 153 | struct i128 s = {-6}; |
| 158 | 154 | zig_struct_i128(s); |
| ... | ... | @@ -243,10 +239,6 @@ void c_u64(uint64_t x) { |
| 243 | 239 | assert_or_panic(x == 0xfffffffffffffffcULL); |
| 244 | 240 | } |
| 245 | 241 | |
| 246 | void c_u128(unsigned __int128 x) { | |
| 247 | assert_or_panic(x == 0xfffffffffffffffcULL); | |
| 248 | } | |
| 249 | ||
| 250 | 242 | void c_struct_u128(struct u128 x) { |
| 251 | 243 | assert_or_panic(x.value == 0xfffffffffffffffcULL); |
| 252 | 244 | } |
| ... | ... | @@ -267,10 +259,6 @@ void c_i64(int64_t x) { |
| 267 | 259 | assert_or_panic(x == -4); |
| 268 | 260 | } |
| 269 | 261 | |
| 270 | void c_i128(__int128 x) { | |
| 271 | assert_or_panic(x == -5); | |
| 272 | } | |
| 273 | ||
| 274 | 262 | void c_struct_i128(struct i128 x) { |
| 275 | 263 | assert_or_panic(x.value == -6); |
| 276 | 264 | } |
test/stage1/c_abi/main.zig-10| ... | ... | @@ -16,13 +16,11 @@ extern fn c_u8(u8) void; |
| 16 | 16 | extern fn c_u16(u16) void; |
| 17 | 17 | extern fn c_u32(u32) void; |
| 18 | 18 | extern fn c_u64(u64) void; |
| 19 | extern fn c_u128(u128) void; | |
| 20 | 19 | extern fn c_struct_u128(U128) void; |
| 21 | 20 | extern fn c_i8(i8) void; |
| 22 | 21 | extern fn c_i16(i16) void; |
| 23 | 22 | extern fn c_i32(i32) void; |
| 24 | 23 | extern fn c_i64(i64) void; |
| 25 | extern fn c_i128(i128) void; | |
| 26 | 24 | extern fn c_struct_i128(I128) void; |
| 27 | 25 | |
| 28 | 26 | // On windows x64, the first 4 are passed via registers, others on the stack. |
| ... | ... | @@ -41,14 +39,12 @@ test "C ABI integers" { |
| 41 | 39 | c_u16(0xfffe); |
| 42 | 40 | c_u32(0xfffffffd); |
| 43 | 41 | c_u64(0xfffffffffffffffc); |
| 44 | c_u128(0xfffffffffffffffc); | |
| 45 | 42 | c_struct_u128(.{ .value = 0xfffffffffffffffc }); |
| 46 | 43 | |
| 47 | 44 | c_i8(-1); |
| 48 | 45 | c_i16(-2); |
| 49 | 46 | c_i32(-3); |
| 50 | 47 | c_i64(-4); |
| 51 | c_i128(-5); | |
| 52 | 48 | c_struct_i128(.{ .value = -6 }); |
| 53 | 49 | c_five_integers(12, 34, 56, 78, 90); |
| 54 | 50 | } |
| ... | ... | @@ -65,9 +61,6 @@ export fn zig_u32(x: u32) void { |
| 65 | 61 | export fn zig_u64(x: u64) void { |
| 66 | 62 | expect(x == 0xfffffffffffffffc) catch @panic("test failure: zig_u64"); |
| 67 | 63 | } |
| 68 | export fn zig_u128(x: u128) void { | |
| 69 | expect(x == 0xfffffffffffffffc) catch @panic("test failure: zig_u128"); | |
| 70 | } | |
| 71 | 64 | export fn zig_i8(x: i8) void { |
| 72 | 65 | expect(x == -1) catch @panic("test failure: zig_i8"); |
| 73 | 66 | } |
| ... | ... | @@ -80,9 +73,6 @@ export fn zig_i32(x: i32) void { |
| 80 | 73 | export fn zig_i64(x: i64) void { |
| 81 | 74 | expect(x == -4) catch @panic("test failure: zig_i64"); |
| 82 | 75 | } |
| 83 | export fn zig_i128(x: i128) void { | |
| 84 | expect(x == -5) catch @panic("test failure: zig_i128"); | |
| 85 | } | |
| 86 | 76 | |
| 87 | 77 | const I128 = extern struct { |
| 88 | 78 | value: i128, |