mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
cbe: update test cases
This commit is contained in:
parent
ab468d57e3
commit
e470cf361f
1
lib/include/zig.h
vendored
1
lib/include/zig.h
vendored
@ -3,6 +3,7 @@
|
||||
#define __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
#include <float.h>
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__has_builtin)
|
||||
|
||||
@ -506,7 +506,7 @@ fn main(c_argc: c_int, c_argv: [*c][*c]u8, c_envp: [*c][*c]u8) callconv(.C) c_in
|
||||
}
|
||||
|
||||
fn mainWithoutEnv(c_argc: c_int, c_argv: [*c][*c]u8) callconv(.C) c_int {
|
||||
std.os.argv = c_argv[0..@intCast(usize, c_argc)];
|
||||
std.os.argv = @ptrCast([*][*:0]u8, c_argv)[0..@intCast(usize, c_argc)];
|
||||
return @call(.{ .modifier = .always_inline }, callMain, .{});
|
||||
}
|
||||
|
||||
|
||||
@ -791,6 +791,7 @@ pub const TestContext = struct {
|
||||
.updates = std.ArrayList(Update).init(ctx.cases.allocator),
|
||||
.output_mode = .Exe,
|
||||
.files = std.ArrayList(File).init(ctx.arena),
|
||||
.link_libc = true,
|
||||
}) catch @panic("out of memory");
|
||||
return &ctx.cases.items[ctx.cases.items.len - 1];
|
||||
}
|
||||
|
||||
@ -951,7 +951,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
ctx.h("simple header", linux_x64,
|
||||
\\export fn start() void{}
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(void);
|
||||
\\zig_extern_c zig_void start(zig_void);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with single param function", linux_x64,
|
||||
@ -959,7 +959,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\ _ = a;
|
||||
\\}
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(uint8_t a0);
|
||||
\\zig_extern_c zig_void start(zig_u8 const a0);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with multiple param function", linux_x64,
|
||||
@ -967,25 +967,25 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\ _ = a; _ = b; _ = c;
|
||||
\\}
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(uint8_t a0, uint8_t a1, uint8_t a2);
|
||||
\\zig_extern_c zig_void start(zig_u8 const a0, zig_u8 const a1, zig_u8 const a2);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with u32 param function", linux_x64,
|
||||
\\export fn start(a: u32) void{ _ = a; }
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(uint32_t a0);
|
||||
\\zig_extern_c zig_void start(zig_u32 const a0);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with usize param function", linux_x64,
|
||||
\\export fn start(a: usize) void{ _ = a; }
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(uintptr_t a0);
|
||||
\\zig_extern_c zig_void start(zig_usize const a0);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with bool param function", linux_x64,
|
||||
\\export fn start(a: bool) void{_ = a;}
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(bool a0);
|
||||
\\zig_extern_c zig_void start(zig_bool const a0);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with noreturn function", linux_x64,
|
||||
@ -993,7 +993,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\ unreachable;
|
||||
\\}
|
||||
,
|
||||
\\ZIG_EXTERN_C zig_noreturn void start(void);
|
||||
\\zig_extern_c zig_noreturn start(zig_void);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with multiple functions", linux_x64,
|
||||
@ -1001,15 +1001,15 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\export fn b() void{}
|
||||
\\export fn c() void{}
|
||||
,
|
||||
\\ZIG_EXTERN_C void a(void);
|
||||
\\ZIG_EXTERN_C void b(void);
|
||||
\\ZIG_EXTERN_C void c(void);
|
||||
\\zig_extern_c zig_void a(zig_void);
|
||||
\\zig_extern_c zig_void b(zig_void);
|
||||
\\zig_extern_c zig_void c(zig_void);
|
||||
\\
|
||||
);
|
||||
ctx.h("header with multiple includes", linux_x64,
|
||||
\\export fn start(a: u32, b: usize) void{ _ = a; _ = b; }
|
||||
,
|
||||
\\ZIG_EXTERN_C void start(uint32_t a0, uintptr_t a1);
|
||||
\\zig_extern_c zig_void start(zig_u32 const a0, zig_usize const a1);
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user