mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-22 07:32:48 +00:00
fdae312e65
compared to 'AddrMode.BaseReg'. In the case that 'AddrMode.BaseReg' is nullptr, 'Result' will also be nullptr, so the cast causes an assertion. We should use dyn_cast_or_null here to check 'Result' is not null and it is an instruction. Bug found by Mats Petersson, and I reduced his IR to get a test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208705 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
293 B
LLVM
15 lines
293 B
LLVM
; RUN: llc < %s
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
@g = external global [10 x i32]
|
|
|
|
define void @f(i32 %u) {
|
|
%1 = add i32 %u, 4
|
|
br label %P.Proc8.exit
|
|
|
|
P.Proc8.exit:
|
|
%valueindex35.i = getelementptr [10 x i32]* @g, i32 0, i32 %1
|
|
store i32 %u, i32* %valueindex35.i
|
|
ret void
|
|
}
|