Transforms: reapply SVN r219899
[oota-llvm.git] / test / Transforms / TailCallElim / byval.ll
1 ; RUN: opt -mtriple i386 -Os -S %s -o - | FileCheck %s
2 ; RUN: opt -mtriple x86_64 -Os -S %s -o - | FileCheck %s
3 ; RUN: opt -mtriple armv7 -Os -S %s -o - | FileCheck %s
4
5 %struct.D16 = type { [16 x double] }
6
7 declare void @_Z2OpP3D16PKS_S2_(%struct.D16*, %struct.D16*, %struct.D16*)
8
9 define void @_Z7TestRefRK3D16S1_(%struct.D16* noalias sret %agg.result, %struct.D16* %RHS, %struct.D16* %LHS) {
10   %1 = alloca %struct.D16*, align 8
11   %2 = alloca %struct.D16*, align 8
12   store %struct.D16* %RHS, %struct.D16** %1, align 8
13   store %struct.D16* %LHS, %struct.D16** %2, align 8
14   %3 = load %struct.D16** %1, align 8
15   %4 = load %struct.D16** %2, align 8
16   call void @_Z2OpP3D16PKS_S2_(%struct.D16* %agg.result, %struct.D16* %3, %struct.D16* %4)
17   ret void
18 }
19
20 ; CHECK: define void @_Z7TestRefRK3D16S1_({{.*}}) {
21 ; CHECK:   tail call void @_Z2OpP3D16PKS_S2_(%struct.D16* %agg.result, %struct.D16* %RHS, %struct.D16* %LHS)
22 ; CHECK:   ret void
23 ; CHECK: }
24
25 define void @_Z7TestVal3D16S_(%struct.D16* noalias sret %agg.result, %struct.D16* byval align 8 %RHS, %struct.D16* byval align 8 %LHS) {
26   call void @_Z2OpP3D16PKS_S2_(%struct.D16* %agg.result, %struct.D16* %RHS, %struct.D16* %LHS)
27   ret void
28 }
29
30 ; CHECK: define void @_Z7TestVal3D16S_({{.*}}) {
31 ; CHECK:   tail call void @_Z2OpP3D16PKS_S2_(%struct.D16* %agg.result, %struct.D16* %RHS, %struct.D16* %LHS)
32 ; CHECK:   ret void
33 ; CHECK: }
34