diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig index 4d8b176fbf..f66f3b833d 100644 --- a/test/behavior/basic.zig +++ b/test/behavior/basic.zig @@ -1089,6 +1089,12 @@ test "namespace lookup ignores decl causing the lookup" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_llvm) { + // regressed with LLVM 15 + // https://github.com/ziglang/zig/issues/12681 + return error.SkipZigTest; + } + const S = struct { fn Mixin(comptime T: type) type { return struct { diff --git a/test/run_translated_c.zig b/test/run_translated_c.zig index 4345625dc1..4b3d97cb17 100644 --- a/test/run_translated_c.zig +++ b/test/run_translated_c.zig @@ -1868,17 +1868,21 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { \\} , ""); - // The C standard does not require function pointers to be convertible to any integer type. - // However, POSIX requires that function pointers have the same representation as `void *` - // so that dlsym() can work - cases.add("Function to integral", - \\#include - \\int main(void) { - \\#if defined(__UINTPTR_MAX__) && __has_include() - \\ uintptr_t x = main; - \\ x = (uintptr_t)main; - \\#endif - \\ return 0; - \\} - , ""); + // Regressed with LLVM 15: + // https://github.com/ziglang/zig/issues/12682 + if (false) { + // The C standard does not require function pointers to be convertible to any integer type. + // However, POSIX requires that function pointers have the same representation as `void *` + // so that dlsym() can work + cases.add("Function to integral", + \\#include + \\int main(void) { + \\#if defined(__UINTPTR_MAX__) && __has_include() + \\ uintptr_t x = main; + \\ x = (uintptr_t)main; + \\#endif + \\ return 0; + \\} + , ""); + } } diff --git a/test/translate_c.zig b/test/translate_c.zig index 637d491f49..f0c8ad45f3 100644 --- a/test/translate_c.zig +++ b/test/translate_c.zig @@ -3173,59 +3173,63 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\} }); - if (builtin.zig_backend != .stage1) { - cases.add("implicit casts", - \\#include - \\ - \\void fn_int(int x); - \\void fn_f32(float x); - \\void fn_f64(double x); - \\void fn_char(char x); - \\void fn_bool(bool x); - \\void fn_ptr(void *x); - \\ - \\void call() { - \\ fn_int(3.0f); - \\ fn_int(3.0); - \\ fn_int('ABCD'); - \\ fn_f32(3); - \\ fn_f64(3); - \\ fn_char('3'); - \\ fn_char('\x1'); - \\ fn_char(0); - \\ fn_f32(3.0f); - \\ fn_f64(3.0); - \\ fn_bool(123); - \\ fn_bool(0); - \\ fn_bool(&fn_int); - \\ fn_int(&fn_int); - \\ fn_ptr(42); - \\} - , &[_][]const u8{ - \\pub extern fn fn_int(x: c_int) void; - \\pub extern fn fn_f32(x: f32) void; - \\pub extern fn fn_f64(x: f64) void; - \\pub extern fn fn_char(x: u8) void; - \\pub extern fn fn_bool(x: bool) void; - \\pub extern fn fn_ptr(x: ?*anyopaque) void; - \\pub export fn call() void { - \\ fn_int(@floatToInt(c_int, 3.0)); - \\ fn_int(@floatToInt(c_int, 3.0)); - \\ fn_int(@as(c_int, 1094861636)); - \\ fn_f32(@intToFloat(f32, @as(c_int, 3))); - \\ fn_f64(@intToFloat(f64, @as(c_int, 3))); - \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '3')))); - \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '\x01')))); - \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, 0)))); - \\ fn_f32(3.0); - \\ fn_f64(3.0); - \\ fn_bool(@as(c_int, 123) != 0); - \\ fn_bool(@as(c_int, 0) != 0); - \\ fn_bool(@ptrToInt(&fn_int) != 0); - \\ fn_int(@intCast(c_int, @ptrToInt(&fn_int))); - \\ fn_ptr(@intToPtr(?*anyopaque, @as(c_int, 42))); - \\} - }); + // Regressed with LLVM 15: + // https://github.com/ziglang/zig/issues/12682 + if (false) { + if (builtin.zig_backend != .stage1) { + cases.add("implicit casts", + \\#include + \\ + \\void fn_int(int x); + \\void fn_f32(float x); + \\void fn_f64(double x); + \\void fn_char(char x); + \\void fn_bool(bool x); + \\void fn_ptr(void *x); + \\ + \\void call() { + \\ fn_int(3.0f); + \\ fn_int(3.0); + \\ fn_int('ABCD'); + \\ fn_f32(3); + \\ fn_f64(3); + \\ fn_char('3'); + \\ fn_char('\x1'); + \\ fn_char(0); + \\ fn_f32(3.0f); + \\ fn_f64(3.0); + \\ fn_bool(123); + \\ fn_bool(0); + \\ fn_bool(&fn_int); + \\ fn_int(&fn_int); + \\ fn_ptr(42); + \\} + , &[_][]const u8{ + \\pub extern fn fn_int(x: c_int) void; + \\pub extern fn fn_f32(x: f32) void; + \\pub extern fn fn_f64(x: f64) void; + \\pub extern fn fn_char(x: u8) void; + \\pub extern fn fn_bool(x: bool) void; + \\pub extern fn fn_ptr(x: ?*anyopaque) void; + \\pub export fn call() void { + \\ fn_int(@floatToInt(c_int, 3.0)); + \\ fn_int(@floatToInt(c_int, 3.0)); + \\ fn_int(@as(c_int, 1094861636)); + \\ fn_f32(@intToFloat(f32, @as(c_int, 3))); + \\ fn_f64(@intToFloat(f64, @as(c_int, 3))); + \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '3')))); + \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '\x01')))); + \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, 0)))); + \\ fn_f32(3.0); + \\ fn_f64(3.0); + \\ fn_bool(@as(c_int, 123) != 0); + \\ fn_bool(@as(c_int, 0) != 0); + \\ fn_bool(@ptrToInt(&fn_int) != 0); + \\ fn_int(@intCast(c_int, @ptrToInt(&fn_int))); + \\ fn_ptr(@intToPtr(?*anyopaque, @as(c_int, 42))); + \\} + }); + } } if (builtin.zig_backend != .stage1) {