120 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 42; RUN: llc -mtriple=thumbv7m-none-none-eabi < %s | FileCheck %s3 4target datalayout = "e-m:o-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"5 6%struct.wibble = type { [30 x i8], i8, i32 }7%struct.eggs = type { i32, [30 x i8], i8, i8, i8, [3 x i8] }8 9@global = external global [3 x %struct.wibble], align 410@global.1 = external global [3 x %struct.wibble], align 411 12; Test case to make sure calling an outlined function does not clobber LR used13; by a tail call in caller.14define void @test(ptr nocapture noundef writeonly %arg, i32 noundef %arg1, i8 noundef zeroext %arg2) unnamed_addr #0 {15; CHECK-LABEL: test:16; CHECK: @ %bb.0: @ %bb17; CHECK-NEXT: cmp r1, #218; CHECK-NEXT: beq .LBB0_319; CHECK-NEXT: @ %bb.1: @ %bb20; CHECK-NEXT: cmp r1, #121; CHECK-NEXT: bne .LBB0_522; CHECK-NEXT: @ %bb.2: @ %bb423; CHECK-NEXT: movs r1, #124; CHECK-NEXT: strb.w r1, [r0, #36]25; CHECK-NEXT: movs r1, #3026; CHECK-NEXT: strb.w r1, [r0, #34]27; CHECK-NEXT: add.w r1, r2, r2, lsl #328; CHECK-NEXT: ldr r2, .LCPI0_129; CHECK-NEXT: b .LBB0_430; CHECK-NEXT: .LBB0_3: @ %bb1431; CHECK-NEXT: movs r1, #132; CHECK-NEXT: strb.w r1, [r0, #36]33; CHECK-NEXT: movs r1, #3034; CHECK-NEXT: strb.w r1, [r0, #34]35; CHECK-NEXT: add.w r1, r2, r2, lsl #336; CHECK-NEXT: ldr r2, .LCPI0_037; CHECK-NEXT: .LBB0_4: @ %bb438; CHECK-NEXT: add.w r1, r2, r1, lsl #239; CHECK-NEXT: adds r0, #440; CHECK-NEXT: movs r2, #3041; CHECK-NEXT: b __aeabi_memcpy42; CHECK-NEXT: .LBB0_5: @ %bb2443; CHECK-NEXT: .save {r7, lr}44; CHECK-NEXT: push {r7, lr}45; CHECK-NEXT: bl wombat46; CHECK-NEXT: @APP47; CHECK-NEXT: @NO_APP48; CHECK-NEXT: pop {r7, pc}49; CHECK-NEXT: .p2align 250; CHECK-NEXT: @ %bb.6:51; CHECK-NEXT: .LCPI0_0:52; CHECK-NEXT: .long global.153; CHECK-NEXT: .LCPI0_1:54; CHECK-NEXT: .long global55bb:56 %gep = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 457 %zext = zext i8 %arg2 to i3258 switch i32 %arg1, label %bb24 [59 i32 1, label %bb460 i32 2, label %bb1461 ]62 63bb4: ; preds = %bb364 store i8 1, ptr %gep, align 4, !tbaa !665 %gep5 = getelementptr inbounds [3 x %struct.wibble], ptr @global, i32 0, i32 %zext66 %gep6 = getelementptr inbounds [3 x %struct.wibble], ptr @global, i32 0, i32 %zext, i32 267 %load = load i32, ptr %gep6, align 4, !tbaa !1168 %gep7 = getelementptr inbounds [3 x %struct.wibble], ptr @global, i32 0, i32 %zext, i32 169 %load8 = load i8, ptr %gep7, align 2, !tbaa !1370 %gep9 = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 371 %gep10 = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 272 store i8 30, ptr %gep10, align 2, !tbaa !1673 %gep11 = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 174 tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(30) %gep11, ptr noundef nonnull align 4 dereferenceable(30) %gep5, i32 30, i1 false)75 br label %bb2676 77bb14: ; preds = %bb1278 store i8 1, ptr %gep, align 4, !tbaa !679 %gep16 = getelementptr inbounds [3 x %struct.wibble], ptr @global.1, i32 0, i32 %zext80 %gep17 = getelementptr inbounds [3 x %struct.wibble], ptr @global.1, i32 0, i32 %zext, i32 281 %load18 = load i32, ptr %gep17, align 4, !tbaa !2182 %gep19 = getelementptr inbounds [3 x %struct.wibble], ptr @global.1, i32 0, i32 %zext, i32 183 %load20 = load i8, ptr %gep19, align 2, !tbaa !2384 %gep21 = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 385 %gep22 = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 286 store i8 30, ptr %gep22, align 2, !tbaa !1687 %gep23 = getelementptr inbounds %struct.eggs, ptr %arg, i32 0, i32 188 tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(30) %gep23, ptr noundef nonnull align 4 dereferenceable(30) %gep16, i32 30, i1 false)89 br label %bb2690 91bb24: ; preds = %bb92 tail call void @wombat()93 tail call void asm sideeffect "", ""()94 br label %bb2695 96bb26: ; preds = %bb24, %bb14, %bb12, %bb4, %bb397 ret void98}99 100declare void @wombat()101 102declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #2103 104attributes #0 = { minsize noimplicitfloat nounwind optsize }105 106!6 = !{!7, !9, i64 36}107!7 = !{!"", !8, i64 0, !9, i64 4, !9, i64 34, !9, i64 35, !9, i64 36, !9, i64 37}108!8 = !{!"long", !9, i64 0}109!9 = !{!"omnipotent char", !10, i64 0}110!10 = !{!"Simple C/C++ TBAA"}111!11 = !{!12, !8, i64 32}112!12 = !{!"B", !9, i64 0, !9, i64 30, !8, i64 32}113!13 = !{!12, !9, i64 30}114!14 = !{!7, !8, i64 0}115!15 = !{!7, !9, i64 35}116!16 = !{!7, !9, i64 34}117!21 = !{!22, !8, i64 32}118!22 = !{!"A", !9, i64 0, !9, i64 30, !8, i64 32}119!23 = !{!22, !9, i64 30}120