disable tests failing due to LLVM 15 regressions

This commit is contained in:
Andrew Kelley 2022-08-29 22:38:26 -07:00
parent bf28765a97
commit 3c506c8aaa
3 changed files with 80 additions and 66 deletions

View File

@ -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_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) 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 { const S = struct {
fn Mixin(comptime T: type) type { fn Mixin(comptime T: type) type {
return struct { return struct {

View File

@ -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. // Regressed with LLVM 15:
// However, POSIX requires that function pointers have the same representation as `void *` // https://github.com/ziglang/zig/issues/12682
// so that dlsym() can work if (false) {
cases.add("Function to integral", // The C standard does not require function pointers to be convertible to any integer type.
\\#include <stdint.h> // However, POSIX requires that function pointers have the same representation as `void *`
\\int main(void) { // so that dlsym() can work
\\#if defined(__UINTPTR_MAX__) && __has_include(<unistd.h>) cases.add("Function to integral",
\\ uintptr_t x = main; \\#include <stdint.h>
\\ x = (uintptr_t)main; \\int main(void) {
\\#endif \\#if defined(__UINTPTR_MAX__) && __has_include(<unistd.h>)
\\ return 0; \\ uintptr_t x = main;
\\} \\ x = (uintptr_t)main;
, ""); \\#endif
\\ return 0;
\\}
, "");
}
} }

View File

@ -3173,59 +3173,63 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
\\} \\}
}); });
if (builtin.zig_backend != .stage1) { // Regressed with LLVM 15:
cases.add("implicit casts", // https://github.com/ziglang/zig/issues/12682
\\#include <stdbool.h> if (false) {
\\ if (builtin.zig_backend != .stage1) {
\\void fn_int(int x); cases.add("implicit casts",
\\void fn_f32(float x); \\#include <stdbool.h>
\\void fn_f64(double x); \\
\\void fn_char(char x); \\void fn_int(int x);
\\void fn_bool(bool x); \\void fn_f32(float x);
\\void fn_ptr(void *x); \\void fn_f64(double x);
\\ \\void fn_char(char x);
\\void call() { \\void fn_bool(bool x);
\\ fn_int(3.0f); \\void fn_ptr(void *x);
\\ fn_int(3.0); \\
\\ fn_int('ABCD'); \\void call() {
\\ fn_f32(3); \\ fn_int(3.0f);
\\ fn_f64(3); \\ fn_int(3.0);
\\ fn_char('3'); \\ fn_int('ABCD');
\\ fn_char('\x1'); \\ fn_f32(3);
\\ fn_char(0); \\ fn_f64(3);
\\ fn_f32(3.0f); \\ fn_char('3');
\\ fn_f64(3.0); \\ fn_char('\x1');
\\ fn_bool(123); \\ fn_char(0);
\\ fn_bool(0); \\ fn_f32(3.0f);
\\ fn_bool(&fn_int); \\ fn_f64(3.0);
\\ fn_int(&fn_int); \\ fn_bool(123);
\\ fn_ptr(42); \\ fn_bool(0);
\\} \\ fn_bool(&fn_int);
, &[_][]const u8{ \\ fn_int(&fn_int);
\\pub extern fn fn_int(x: c_int) void; \\ fn_ptr(42);
\\pub extern fn fn_f32(x: f32) void; \\}
\\pub extern fn fn_f64(x: f64) void; , &[_][]const u8{
\\pub extern fn fn_char(x: u8) void; \\pub extern fn fn_int(x: c_int) void;
\\pub extern fn fn_bool(x: bool) void; \\pub extern fn fn_f32(x: f32) void;
\\pub extern fn fn_ptr(x: ?*anyopaque) void; \\pub extern fn fn_f64(x: f64) void;
\\pub export fn call() void { \\pub extern fn fn_char(x: u8) void;
\\ fn_int(@floatToInt(c_int, 3.0)); \\pub extern fn fn_bool(x: bool) void;
\\ fn_int(@floatToInt(c_int, 3.0)); \\pub extern fn fn_ptr(x: ?*anyopaque) void;
\\ fn_int(@as(c_int, 1094861636)); \\pub export fn call() void {
\\ fn_f32(@intToFloat(f32, @as(c_int, 3))); \\ fn_int(@floatToInt(c_int, 3.0));
\\ fn_f64(@intToFloat(f64, @as(c_int, 3))); \\ fn_int(@floatToInt(c_int, 3.0));
\\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '3')))); \\ fn_int(@as(c_int, 1094861636));
\\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '\x01')))); \\ fn_f32(@intToFloat(f32, @as(c_int, 3)));
\\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, 0)))); \\ fn_f64(@intToFloat(f64, @as(c_int, 3)));
\\ fn_f32(3.0); \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '3'))));
\\ fn_f64(3.0); \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '\x01'))));
\\ fn_bool(@as(c_int, 123) != 0); \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, 0))));
\\ fn_bool(@as(c_int, 0) != 0); \\ fn_f32(3.0);
\\ fn_bool(@ptrToInt(&fn_int) != 0); \\ fn_f64(3.0);
\\ fn_int(@intCast(c_int, @ptrToInt(&fn_int))); \\ fn_bool(@as(c_int, 123) != 0);
\\ fn_ptr(@intToPtr(?*anyopaque, @as(c_int, 42))); \\ 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) { if (builtin.zig_backend != .stage1) {