mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 07:06:05 +00:00

Currently, the interpreter does not initialize `undef` constants of aggregate types correctly (with respect to arrays). The initialization of the array elements is skipped although it is valid to directly write to them. Instructions like `insertvalue {i32, [4 x i32]} undef, i32 1, 1, 2` therefore lead to a crash. This is fixed by initializing array values just as fixed-size vectors or structs.
10 lines
254 B
LLVM
10 lines
254 B
LLVM
; RUN: %lli -jit-kind=mcjit -force-interpreter=true %s
|
|
|
|
define i32 @main() {
|
|
%a = add i32 0, undef
|
|
%b = fadd float 0.0, undef
|
|
%c = fadd double 0.0, undef
|
|
%d = insertvalue {i32, [4 x i32]} undef, i32 1, 1, 2
|
|
ret i32 0
|
|
}
|