1 ; RUN: opt -instcombine -S < %s | FileCheck %s
3 target datalayout = "e-i64:64-f80:128-n8:16:32:64"
4 target triple = "x86_64-unknown-linux-gnu"
6 %A__vtbl = type { i8*, i32 (%A*)* }
7 %A = type { %A__vtbl* }
9 @A__vtblZ = constant %A__vtbl { i8* null, i32 (%A*)* @A.foo }
11 declare i32 @A.foo(%A* nocapture %this)
13 declare i8* @allocmemory(i64)
15 define void @structA() {
17 %0 = tail call i8* @allocmemory(i64 32)
18 %1 = bitcast i8* %0 to %A*
19 ; CHECK: store %A__vtbl* @A__vtblZ
20 store %A { %A__vtbl* @A__vtblZ }, %A* %1, align 8
24 define void @structOfA() {
26 %0 = tail call i8* @allocmemory(i64 32)
27 %1 = bitcast i8* %0 to { %A }*
28 ; CHECK: store %A__vtbl* @A__vtblZ
29 store { %A } { %A { %A__vtbl* @A__vtblZ } }, { %A }* %1, align 8