llvm-project/llvm/test/ExecutionEngine/2010-01-15-UndefValue.ll
Dudeldu 75d6f508f8
[Interpreter] Add initialization of array members (#66172)
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.
2023-10-20 15:27:11 +02:00

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
}