Skip to content

llvm 18 regression: crash in "@intFromBool on vector" behavior test #19825

@andrewrk

Description

@andrewrk

In the llvm18 branch:

[nix-shell:~/src/zig/build-llvm18]$ stage3/bin/zig test -target aarch64-windows-gnu ../test/behavior.zig LLVM Emit Object... zig: /home/andy/dev/llvm-project-18/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp:199: llvm::LegalizeActionStep llvm::LegalizeRuleSet::apply(const llvm::LegalityQuery&) const: Assertion `mutationIsSane(Rule, Query, Mutation) && "legality mutation invalid for match"' failed.
Aborted (core dumped)

This behavior test is failing:

zig/test/behavior/cast.zig

Lines 2477 to 2495 in 1c9bb6a

test "@intFromBool on vector" {
if (builtin.zig_backend == .stage2_wasm) 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_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
const S = struct {
fn doTheTest() !void {
var a: @Vector(3, bool) = .{ false, true, false };
_ = &a;
const b: @Vector(3, u1) = @intFromBool(a);
try expectEqual(@Vector(3, u1){ 0, 1, 0 }, b);
}
};
try S.doTheTest();
try comptime S.doTheTest();
}

Reported upstream at llvm/llvm-project#90698

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-aarch6464-bit Armbackend-llvmThe LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behavioros-windowsregressionIt worked in a previous version of Zig, but stopped working.upstreamAn issue with a third party project that Zig uses.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions