35 lines · plain
1; RUN: llc -mtriple=thumbv4t-linux-gnueabi -o - %s | FileCheck %s2 3; Functions may have more features than the base triple; code generation and4; instruction selection may be performed based on this information. This test5; makes sure that the MC layer performs instruction relaxation based on the6; target-features of the function. The relaxation for tail call is particularly7; important on Thumb2 as the 16-bit Thumb branch instruction has an extremely8; short range.9 10declare dso_local void @g(...) local_unnamed_addr #211 12define dso_local void @f() local_unnamed_addr #0 {13entry:14 tail call void @g() #315 ret void16}17; Function has thumb2 target-feature, tail call is allowed and must be widened.18; CHECK: f:19; CHECK: b g20 21define dso_local void @h() local_unnamed_addr #2 {22entry:23 tail call void @g() #324 ret void25}26; Function does not have thumb2 target-feature, tail call should not be27; generated as it cannot be widened.28; CHECK: h:29; CHECK: bl g30 31attributes #0 = { nounwind "disable-tail-calls"="false" "target-cpu"="cortex-a53" "target-features"="+crypto,+fp-armv8,+neon,+soft-float-abi,+strict-align,+thumb-mode,-crc,-dotprod,-dsp,-hwdiv,-hwdiv-arm,-ras" "use-soft-float"="true" }32 33attributes #2 = { nounwind "disable-tail-calls"="false" "target-cpu"="arm7tdmi" "target-features"="+strict-align,+thumb-mode,-crc,-dotprod,-dsp,-hwdiv,-hwdiv-arm,-ras" "use-soft-float"="true" }34attributes #3 = { nounwind }35