Update InstCombine to transform aggregate stores into scalar stores.
[oota-llvm.git] / test / Transforms / InstCombine / unpack-fca.ll
1 ; RUN: opt -instcombine -S < %s | FileCheck %s
2
3 target datalayout = "e-i64:64-f80:128-n8:16:32:64"
4 target triple = "x86_64-unknown-linux-gnu"
5
6 %A__vtbl = type { i8*, i32 (%A*)* }
7 %A = type { %A__vtbl* }
8
9 @A__vtblZ = constant %A__vtbl { i8* null, i32 (%A*)* @A.foo }
10
11 declare i32 @A.foo(%A* nocapture %this)
12
13 declare i8* @allocmemory(i64)
14
15 define void @structA() {
16 body:
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
21   ret void
22 }
23
24 define void @structOfA() {
25 body:
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
30   ret void
31 }