mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
C backend: fix @boolToInt
This commit is contained in:
parent
1c93cf52d8
commit
5479c0f9ac
@ -477,7 +477,7 @@ pub const DeclGen = struct {
|
||||
.Bool => try w.writeAll("bool"),
|
||||
.Int => {
|
||||
switch (t.tag()) {
|
||||
.u8 => try w.writeAll("uint8_t"),
|
||||
.u1, .u8 => try w.writeAll("uint8_t"),
|
||||
.i8 => try w.writeAll("int8_t"),
|
||||
.u16 => try w.writeAll("uint16_t"),
|
||||
.i16 => try w.writeAll("int16_t"),
|
||||
|
||||
@ -2,6 +2,7 @@ const builtin = @import("builtin");
|
||||
|
||||
test {
|
||||
// Tests that pass for stage1, stage2, and the C backend.
|
||||
_ = @import("behavior/bool.zig");
|
||||
_ = @import("behavior/if.zig");
|
||||
|
||||
if (builtin.object_format != .c) {
|
||||
@ -11,7 +12,6 @@ test {
|
||||
_ = @import("behavior/atomics.zig");
|
||||
_ = @import("behavior/basic.zig");
|
||||
_ = @import("behavior/bitcast.zig");
|
||||
_ = @import("behavior/bool.zig");
|
||||
_ = @import("behavior/bugs/394.zig");
|
||||
_ = @import("behavior/bugs/624.zig");
|
||||
_ = @import("behavior/bugs/655.zig");
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
const expect = @import("std").testing.expect;
|
||||
const std = @import("std");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
test "bool literals" {
|
||||
try expect(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user