| ... | ... | @@ -19,7 +19,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 19 | 19 | \\} |
| 20 | 20 | \\ |
| 21 | 21 | ); |
| 22 | | ctx.h("Simple header", linux_x64, |
| 22 | ctx.h("simple header", linux_x64, |
| 23 | 23 | \\export fn start() void{} |
| 24 | 24 | , |
| 25 | 25 | \\void start(void); |
| ... | ... | @@ -249,4 +249,69 @@ pub fn addCases(ctx: *TestContext) !void { |
| 249 | 249 | \\} |
| 250 | 250 | \\ |
| 251 | 251 | ); |
| 252 | ctx.h("header with single param function", linux_x64, |
| 253 | \\export fn start(a: u8) void{} |
| 254 | , |
| 255 | \\#include <stdint.h> |
| 256 | \\ |
| 257 | \\void start(uint8_t arg0); |
| 258 | \\ |
| 259 | ); |
| 260 | ctx.h("header with multiple param function", linux_x64, |
| 261 | \\export fn start(a: u8, b: u8, c: u8) void{} |
| 262 | , |
| 263 | \\#include <stdint.h> |
| 264 | \\ |
| 265 | \\void start(uint8_t arg0, uint8_t arg1, uint8_t arg2); |
| 266 | \\ |
| 267 | ); |
| 268 | ctx.h("header with u32 param function", linux_x64, |
| 269 | \\export fn start(a: u32) void{} |
| 270 | , |
| 271 | \\#include <stdint.h> |
| 272 | \\ |
| 273 | \\void start(uint32_t arg0); |
| 274 | \\ |
| 275 | ); |
| 276 | ctx.h("header with usize param function", linux_x64, |
| 277 | \\export fn start(a: usize) void{} |
| 278 | , |
| 279 | \\#include <stddef.h> |
| 280 | \\ |
| 281 | \\void start(size_t arg0); |
| 282 | \\ |
| 283 | ); |
| 284 | ctx.h("header with bool param function", linux_x64, |
| 285 | \\export fn start(a: bool) void{} |
| 286 | , |
| 287 | \\void start(bool arg0); |
| 288 | \\ |
| 289 | ); |
| 290 | ctx.h("header with noreturn function", linux_x64, |
| 291 | \\export fn start() noreturn { |
| 292 | \\ unreachable; |
| 293 | \\} |
| 294 | , |
| 295 | \\zig_noreturn void start(void); |
| 296 | \\ |
| 297 | ); |
| 298 | ctx.h("header with multiple functions", linux_x64, |
| 299 | \\export fn a() void{} |
| 300 | \\export fn b() void{} |
| 301 | \\export fn c() void{} |
| 302 | , |
| 303 | \\void a(void); |
| 304 | \\void b(void); |
| 305 | \\void c(void); |
| 306 | \\ |
| 307 | ); |
| 308 | ctx.h("header with multiple includes", linux_x64, |
| 309 | \\export fn start(a: u32, b: usize) void{} |
| 310 | , |
| 311 | \\#include <stddef.h> |
| 312 | \\#include <stdint.h> |
| 313 | \\ |
| 314 | \\void start(uint32_t arg0, size_t arg1); |
| 315 | \\ |
| 316 | ); |
| 252 | 317 | } |