diff --git a/src/analyze.cpp b/src/analyze.cpp index ebdf1e0605..3568cc3b96 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -7633,7 +7633,7 @@ static void resolve_llvm_types_slice(CodeGen *g, ZigType *type, ResolveStatus wa type->data.structure.resolve_status = ResolveStatusLLVMFull; } -static LLVMTypeRef get_llvm_array_type(unsigned byte_size) { +static LLVMTypeRef get_llvm_type_of_n_bytes(unsigned byte_size) { return byte_size == 1 ? LLVMInt8Type() : LLVMArrayType(LLVMInt8Type(), byte_size); } @@ -7735,7 +7735,7 @@ static void resolve_llvm_types_struct(CodeGen *g, ZigType *struct_type, ResolveS size_t full_abi_size = get_abi_size_bytes(full_bit_count, g->pointer_size_bytes); if (full_abi_size * 8 == full_bit_count) { // next field recovers ABI alignment - element_types[gen_field_index] = get_llvm_array_type(full_abi_size); + element_types[gen_field_index] = get_llvm_type_of_n_bytes(full_abi_size); gen_field_index += 1; first_packed_bits_offset_misalign = SIZE_MAX; } @@ -7808,7 +7808,7 @@ static void resolve_llvm_types_struct(CodeGen *g, ZigType *struct_type, ResolveS if (first_packed_bits_offset_misalign != SIZE_MAX) { size_t full_bit_count = packed_bits_offset - first_packed_bits_offset_misalign; size_t full_abi_size = get_abi_size_bytes(full_bit_count, g->pointer_size_bytes); - element_types[gen_field_index] = get_llvm_array_type(full_abi_size); + element_types[gen_field_index] = get_llvm_type_of_n_bytes(full_abi_size); gen_field_index += 1; } diff --git a/test/stage1/behavior.zig b/test/stage1/behavior.zig index 623feeb747..9b7f4305c2 100644 --- a/test/stage1/behavior.zig +++ b/test/stage1/behavior.zig @@ -72,9 +72,7 @@ comptime { _ = @import("behavior/misc.zig"); _ = @import("behavior/muladd.zig"); _ = @import("behavior/namespace_depends_on_compile_var.zig"); - // See #3268 - if (@import("builtin").arch != .aarch64) - _ = @import("behavior/new_stack_call.zig"); + _ = @import("behavior/new_stack_call.zig"); _ = @import("behavior/null.zig"); _ = @import("behavior/optional.zig"); _ = @import("behavior/pointers.zig"); diff --git a/test/stage1/behavior/new_stack_call.zig b/test/stage1/behavior/new_stack_call.zig index cbda9a2435..2200407882 100644 --- a/test/stage1/behavior/new_stack_call.zig +++ b/test/stage1/behavior/new_stack_call.zig @@ -4,6 +4,9 @@ const expect = std.testing.expect; var new_stack_bytes: [1024]u8 align(16) = undefined; test "calling a function with a new stack" { + // TODO: https://github.com/ziglang/zig/issues/3268 + if (@import("builtin").arch == .aarch64) return error.SkipZigTest; + const arg = 1234; const a = @newStackCall(new_stack_bytes[0..512], targetFunction, arg); diff --git a/test/stage1/behavior/widening.zig b/test/stage1/behavior/widening.zig index 2bab106ada..71f8ae482e 100644 --- a/test/stage1/behavior/widening.zig +++ b/test/stage1/behavior/widening.zig @@ -27,3 +27,12 @@ test "float widening" { expect(b == c); expect(c == d); } + +test "float widening f16 to f128" { + // TODO https://github.com/ziglang/zig/issues/3282 + if (@import("builtin").arch == .aarch64) return error.SkipZigTest; + + var x: f16 = 12.34; + var y: f128 = x; + expect(x == y); +}