22 lines · plain
1; RUN: llc < %s -fast-isel -fast-isel-abort=1 -verify-machineinstrs2 3; Regression test for PR47040, in which an assertion was improperly4; triggered during FastISel's address computation. The issue was that5; an `Address` set to be relative to FrameIndex zero was incorrectly6; considered to have an unset base. When the left hand side of an add7; set the Address to have a FrameIndex base of 0, the right side would8; not detect that the Address base had already been set and could try9; to set the Address to be relative to a register instead, triggering10; an assertion.11 12target triple = "wasm32-unknown-unknown"13 14define i32 @foo() {15 %stack_addr = alloca i3216 %stack_i = ptrtoint ptr %stack_addr to i3217 %added = add nuw i32 %stack_i, undef18 %added_addr = inttoptr i32 %added to ptr19 %ret = load i32, ptr %added_addr20 ret i32 %ret21}22