authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-29 22:38:26-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-29 22:58:24-07:00
log3c506c8aaa8cc92f444d2559e9ec1b0892a1985c
tree345303a80df31d895d7092cbe0e078ea2751cbd4
parentbf28765a975355c27558eaa86cf00ccb29b663a7

disable tests failing due to LLVM 15 regressions


3 files changed, 80 insertions(+), 66 deletions(-)

test/behavior/basic.zig+6
...@@ -1089,6 +1089,12 @@ test "namespace lookup ignores decl causing the lookup" {...@@ -1089,6 +1089,12 @@ test "namespace lookup ignores decl causing the lookup" {
1089 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO1089 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
1090 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1090 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
10911091
1092 if (builtin.zig_backend == .stage2_llvm) {
1093 // regressed with LLVM 15
1094 // https://github.com/ziglang/zig/issues/12681
1095 return error.SkipZigTest;
1096 }
1097
1092 const S = struct {1098 const S = struct {
1093 fn Mixin(comptime T: type) type {1099 fn Mixin(comptime T: type) type {
1094 return struct {1100 return struct {
test/run_translated_c.zig+17-13
...@@ -1868,17 +1868,21 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {...@@ -1868,17 +1868,21 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
1868 \\}1868 \\}
1869 , "");1869 , "");
18701870
1871 // The C standard does not require function pointers to be convertible to any integer type.1871 // Regressed with LLVM 15:
1872 // However, POSIX requires that function pointers have the same representation as `void *`1872 // https://github.com/ziglang/zig/issues/12682
1873 // so that dlsym() can work1873 if (false) {
1874 cases.add("Function to integral",1874 // The C standard does not require function pointers to be convertible to any integer type.
1875 \\#include <stdint.h>1875 // However, POSIX requires that function pointers have the same representation as `void *`
1876 \\int main(void) {1876 // so that dlsym() can work
1877 \\#if defined(__UINTPTR_MAX__) && __has_include(<unistd.h>)1877 cases.add("Function to integral",
1878 \\ uintptr_t x = main;1878 \\#include <stdint.h>
1879 \\ x = (uintptr_t)main;1879 \\int main(void) {
1880 \\#endif1880 \\#if defined(__UINTPTR_MAX__) && __has_include(<unistd.h>)
1881 \\ return 0;1881 \\ uintptr_t x = main;
1882 \\}1882 \\ x = (uintptr_t)main;
1883 , "");1883 \\#endif
1884 \\ return 0;
1885 \\}
1886 , "");
1887 }
1884}1888}
test/translate_c.zig+57-53
...@@ -3173,59 +3173,63 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -3173,59 +3173,63 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
3173 \\}3173 \\}
3174 });3174 });
31753175
3176 if (builtin.zig_backend != .stage1) {3176 // Regressed with LLVM 15:
3177 cases.add("implicit casts",3177 // https://github.com/ziglang/zig/issues/12682
3178 \\#include <stdbool.h>3178 if (false) {
3179 \\3179 if (builtin.zig_backend != .stage1) {
3180 \\void fn_int(int x);3180 cases.add("implicit casts",
3181 \\void fn_f32(float x);3181 \\#include <stdbool.h>
3182 \\void fn_f64(double x);3182 \\
3183 \\void fn_char(char x);3183 \\void fn_int(int x);
3184 \\void fn_bool(bool x);3184 \\void fn_f32(float x);
3185 \\void fn_ptr(void *x);3185 \\void fn_f64(double x);
3186 \\3186 \\void fn_char(char x);
3187 \\void call() {3187 \\void fn_bool(bool x);
3188 \\ fn_int(3.0f);3188 \\void fn_ptr(void *x);
3189 \\ fn_int(3.0);3189 \\
3190 \\ fn_int('ABCD');3190 \\void call() {
3191 \\ fn_f32(3);3191 \\ fn_int(3.0f);
3192 \\ fn_f64(3);3192 \\ fn_int(3.0);
3193 \\ fn_char('3');3193 \\ fn_int('ABCD');
3194 \\ fn_char('\x1');3194 \\ fn_f32(3);
3195 \\ fn_char(0);3195 \\ fn_f64(3);
3196 \\ fn_f32(3.0f);3196 \\ fn_char('3');
3197 \\ fn_f64(3.0);3197 \\ fn_char('\x1');
3198 \\ fn_bool(123);3198 \\ fn_char(0);
3199 \\ fn_bool(0);3199 \\ fn_f32(3.0f);
3200 \\ fn_bool(&fn_int);3200 \\ fn_f64(3.0);
3201 \\ fn_int(&fn_int);3201 \\ fn_bool(123);
3202 \\ fn_ptr(42);3202 \\ fn_bool(0);
3203 \\}3203 \\ fn_bool(&fn_int);
3204 , &[_][]const u8{3204 \\ fn_int(&fn_int);
3205 \\pub extern fn fn_int(x: c_int) void;3205 \\ fn_ptr(42);
3206 \\pub extern fn fn_f32(x: f32) void;3206 \\}
3207 \\pub extern fn fn_f64(x: f64) void;3207 , &[_][]const u8{
3208 \\pub extern fn fn_char(x: u8) void;3208 \\pub extern fn fn_int(x: c_int) void;
3209 \\pub extern fn fn_bool(x: bool) void;3209 \\pub extern fn fn_f32(x: f32) void;
3210 \\pub extern fn fn_ptr(x: ?*anyopaque) void;3210 \\pub extern fn fn_f64(x: f64) void;
3211 \\pub export fn call() void {3211 \\pub extern fn fn_char(x: u8) void;
3212 \\ fn_int(@floatToInt(c_int, 3.0));3212 \\pub extern fn fn_bool(x: bool) void;
3213 \\ fn_int(@floatToInt(c_int, 3.0));3213 \\pub extern fn fn_ptr(x: ?*anyopaque) void;
3214 \\ fn_int(@as(c_int, 1094861636));3214 \\pub export fn call() void {
3215 \\ fn_f32(@intToFloat(f32, @as(c_int, 3)));3215 \\ fn_int(@floatToInt(c_int, 3.0));
3216 \\ fn_f64(@intToFloat(f64, @as(c_int, 3)));3216 \\ fn_int(@floatToInt(c_int, 3.0));
3217 \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '3'))));3217 \\ fn_int(@as(c_int, 1094861636));
3218 \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '\x01'))));3218 \\ fn_f32(@intToFloat(f32, @as(c_int, 3)));
3219 \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, 0))));3219 \\ fn_f64(@intToFloat(f64, @as(c_int, 3)));
3220 \\ fn_f32(3.0);3220 \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '3'))));
3221 \\ fn_f64(3.0);3221 \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, '\x01'))));
3222 \\ fn_bool(@as(c_int, 123) != 0);3222 \\ fn_char(@bitCast(u8, @truncate(i8, @as(c_int, 0))));
3223 \\ fn_bool(@as(c_int, 0) != 0);3223 \\ fn_f32(3.0);
3224 \\ fn_bool(@ptrToInt(&fn_int) != 0);3224 \\ fn_f64(3.0);
3225 \\ fn_int(@intCast(c_int, @ptrToInt(&fn_int)));3225 \\ fn_bool(@as(c_int, 123) != 0);
3226 \\ fn_ptr(@intToPtr(?*anyopaque, @as(c_int, 42)));3226 \\ fn_bool(@as(c_int, 0) != 0);
3227 \\}3227 \\ fn_bool(@ptrToInt(&fn_int) != 0);
3228 });3228 \\ fn_int(@intCast(c_int, @ptrToInt(&fn_int)));
3229 \\ fn_ptr(@intToPtr(?*anyopaque, @as(c_int, 42)));
3230 \\}
3231 });
3232 }
3229 }3233 }
32303234
3231 if (builtin.zig_backend != .stage1) {3235 if (builtin.zig_backend != .stage1) {