• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -fast-isel -fast-isel-abort=1 -verify-machineinstrs
2
3; Regression test for PR47040, in which an assertion was improperly
4; triggered during FastISel's address computation. The issue was that
5; an `Address` set to be relative to FrameIndex zero was incorrectly
6; considered to have an unset base. When the left hand side of an add
7; set the Address to have a FrameIndex base of 0, the right side would
8; not detect that the Address base had already been set and could try
9; to set the Address to be relative to a register instead, triggering
10; an assertion.
11
12target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
13target triple = "wasm32-unknown-unknown"
14
15define i32 @foo() {
16  %stack_addr = alloca i32
17  %stack_i = ptrtoint i32* %stack_addr to i32
18  %added = add i32 %stack_i, undef
19  %added_addr = inttoptr i32 %added to i32*
20  %ret = load i32, i32* %added_addr
21  ret i32 %ret
22}
23