1 ; RUN: opt -passes=mergefunc -S < %s | FileCheck %s
3 ; This test makes sure that the mergefunc pass, uses extract and insert value
4 ; to convert the struct result type; as struct types cannot be bitcast.
6 target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
8 %kv1 = type { ptr, ptr }
9 %kv2 = type { ptr, ptr }
16 store ptr null, ptr %tmp
17 store ptr null, ptr %tmp
19 %v3 = load %kv1, ptr %tmp
25 ; CHECK: %1 = tail call %kv1 @fn1()
26 ; CHECK: %2 = extractvalue %kv1 %1, 0
27 ; CHECK: %3 = insertvalue %kv2 poison, ptr %2, 0
29 store ptr null, ptr %tmp
30 store ptr null, ptr %tmp
33 %v3 = load %kv2, ptr %tmp