xref: /llvm-project/llvm/test/CodeGen/Generic/pr33094.ll (revision deab451e7a7f2dff42097049274637052c87eabd)
1; RUN: llc < %s
2
3; PR33094
4; Make sure that a constant extractvalue doesn't cause a crash in
5; SelectionDAGBuilder::visitExtractValue.
6
7%A = type {}
8%B = type {}
9%Tuple = type { i64 }
10
11@A_Inst = global %A zeroinitializer
12@B_Inst = global %B zeroinitializer
13
14define i64 @foo() {
15  %c = icmp eq ptr @A_Inst, @B_Inst
16  %s = select i1 %c, %Tuple { i64 33 }, %Tuple { i64 42 }
17  %e = extractvalue %Tuple %s, 0
18  ret i64 %e
19}
20