1 ; RUN: opt < %s -constprop -S | FileCheck %s
3 %struct = type { i32, [4 x i8] }
6 %A = extractvalue %struct { i32 2, [4 x i8] c"foo\00" }, 0
13 %A = extractvalue %struct { i32 2, [4 x i8] c"foo\00" }, 1, 2
15 ; CHECK-LABEL: @test2(
20 %A = extractvalue [3 x %struct] [ %struct { i32 0, [4 x i8] c"aaaa" }, %struct { i32 1, [4 x i8] c"bbbb" }, %struct { i32 2, [4 x i8] c"cccc" } ], 1, 0
22 ; CHECK-LABEL: @test3(
26 define i32 @zeroinitializer-test1() {
27 %A = extractvalue %struct zeroinitializer, 0
29 ; CHECK: @zeroinitializer-test1
33 define i8 @zeroinitializer-test2() {
34 %A = extractvalue %struct zeroinitializer, 1, 2
36 ; CHECK: @zeroinitializer-test2
40 define i32 @zeroinitializer-test3() {
41 %A = extractvalue [3 x %struct] zeroinitializer, 1, 0
43 ; CHECK: @zeroinitializer-test3
47 define i32 @undef-test1() {
48 %A = extractvalue %struct undef, 0
51 ; CHECK: ret i32 undef
54 define i8 @undef-test2() {
55 %A = extractvalue %struct undef, 1, 2
61 define i32 @undef-test3() {
62 %A = extractvalue [3 x %struct] undef, 1, 0
65 ; CHECK: ret i32 undef