brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 806cc9c Raw
100 lines · plain
1; RUN: llc < %s -mtriple=armv6-linux-gnueabi | FileCheck %s -check-prefix=CHECKELF2; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 | FileCheck %s -check-prefix=CHECKT2D3 4%struct.A = type { i8 }5%struct.B = type { i32 }6%struct.C = type { %struct.B }7%struct.D = type { %struct.B }8%struct.E = type { %struct.B, %struct.B }9 10declare ptr @A_ctor_base(ptr returned)11declare ptr @B_ctor_base(ptr returned, i32)12declare ptr @B_ctor_complete(ptr returned, i32)13 14declare ptr @A_ctor_base_nothisret(ptr)15declare ptr @B_ctor_base_nothisret(ptr, i32)16declare ptr @B_ctor_complete_nothisret(ptr, i32)17 18define ptr @C_ctor_base(ptr returned %this, i32 %x) {19entry:20; CHECKELF-LABEL: C_ctor_base:21; CHECKELF-NOT: mov {{r[0-9]+}}, r022; CHECKELF: bl A_ctor_base23; CHECKELF-NOT: mov r0, {{r[0-9]+}}24; CHECKELF: b B_ctor_base25; CHECKT2D-LABEL: C_ctor_base:26; CHECKT2D-NOT: mov {{r[0-9]+}}, r027; CHECKT2D: bl _A_ctor_base28; CHECKT2D-NOT: mov r0, {{r[0-9]+}}29; CHECKT2D: b.w _B_ctor_base30  %call = tail call ptr @A_ctor_base(ptr returned %this)31  %call2 = tail call ptr @B_ctor_base(ptr returned %this, i32 %x)32  ret ptr %this33}34 35define ptr @C_ctor_base_nothisret(ptr %this, i32 %x) {36entry:37; CHECKELF-LABEL: C_ctor_base_nothisret:38; CHECKELF: mov [[SAVETHIS:r[0-9]+]], r039; CHECKELF: bl A_ctor_base_nothisret40; CHECKELF: mov r0, [[SAVETHIS]]41; CHECKELF-NOT: b B_ctor_base_nothisret42; CHECKT2D-LABEL: C_ctor_base_nothisret:43; CHECKT2D: mov [[SAVETHIS:r[0-9]+]], r044; CHECKT2D: bl _A_ctor_base_nothisret45; CHECKT2D: mov r0, [[SAVETHIS]]46; CHECKT2D-NOT: b.w _B_ctor_base_nothisret47  %call = tail call ptr @A_ctor_base_nothisret(ptr %this)48  %call2 = tail call ptr @B_ctor_base_nothisret(ptr %this, i32 %x)49  ret ptr %this50}51 52define ptr @C_ctor_complete(ptr %this, i32 %x) {53entry:54; CHECKELF-LABEL: C_ctor_complete:55; CHECKELF: b C_ctor_base56; CHECKT2D-LABEL: C_ctor_complete:57; CHECKT2D: b.w _C_ctor_base58  %call = tail call ptr @C_ctor_base(ptr returned %this, i32 %x)59  ret ptr %this60}61 62define ptr @C_ctor_complete_nothisret(ptr %this, i32 %x) {63entry:64; CHECKELF-LABEL: C_ctor_complete_nothisret:65; CHECKELF-NOT: b C_ctor_base_nothisret66; CHECKT2D-LABEL: C_ctor_complete_nothisret:67; CHECKT2D-NOT: b.w _C_ctor_base_nothisret68  %call = tail call ptr @C_ctor_base_nothisret(ptr %this, i32 %x)69  ret ptr %this70}71 72define ptr @D_ctor_base(ptr %this, i32 %x) {73entry:74; CHECKELF-LABEL: D_ctor_base:75; CHECKELF-NOT: mov {{r[0-9]+}}, r076; CHECKELF: bl B_ctor_complete77; CHECKELF-NOT: mov r0, {{r[0-9]+}}78; CHECKELF: b B_ctor_complete79; CHECKT2D-LABEL: D_ctor_base:80; CHECKT2D-NOT: mov {{r[0-9]+}}, r081; CHECKT2D: bl _B_ctor_complete82; CHECKT2D-NOT: mov r0, {{r[0-9]+}}83; CHECKT2D: b.w _B_ctor_complete84  %call = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)85  %call2 = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)86  ret ptr %this87}88 89define ptr @E_ctor_base(ptr %this, i32 %x) {90entry:91; CHECKELF-LABEL: E_ctor_base:92; CHECKELF-NOT: b B_ctor_complete93; CHECKT2D-LABEL: E_ctor_base:94; CHECKT2D-NOT: b.w _B_ctor_complete95  %call = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)96  %b2 = getelementptr inbounds %struct.E, ptr %this, i32 0, i32 197  %call2 = tail call ptr @B_ctor_complete(ptr returned %b2, i32 %x)98  ret ptr %this99}100