1 ; RUN: llc < %s -march=xcore | FileCheck %s 2 3 %struct.FRAME.f = type { i32, i32 ()* } 4 5 define void @f() nounwind { 6 entry: 7 ; CHECK: f: 8 ; CHECK: ldap r11, g.1101 9 ; CHECK: stw r11, sp[7] 10 %TRAMP.23 = alloca [20 x i8], align 2 11 %FRAME.0 = alloca %struct.FRAME.f, align 4 12 %TRAMP.23.sub = getelementptr inbounds [20 x i8]* %TRAMP.23, i32 0, i32 0 13 %FRAME.02 = bitcast %struct.FRAME.f* %FRAME.0 to i8* 14 call void @llvm.init.trampoline(i8* %TRAMP.23.sub, i8* bitcast (i32 (%struct.FRAME.f*)* @g.1101 to i8*), i8* %FRAME.02) 15 %tramp = call i8* @llvm.adjust.trampoline(i8* %TRAMP.23.sub) 16 %0 = getelementptr inbounds %struct.FRAME.f* %FRAME.0, i32 0, i32 1 17 %1 = bitcast i8* %tramp to i32 ()* 18 store i32 ()* %1, i32 ()** %0, align 4 19 %2 = getelementptr inbounds %struct.FRAME.f* %FRAME.0, i32 0, i32 0 20 store i32 1, i32* %2, align 4 21 call void @h(i32 ()* %1) nounwind 22 ret void 23 } 24 25 define internal i32 @g.1101(%struct.FRAME.f* nocapture nest %CHAIN.1) nounwind readonly { 26 entry: 27 ; CHECK: g.1101: 28 ; CHECK: ldw r11, sp[0] 29 ; CHECK-NEXT: ldw r0, r11[0] 30 ; CHECK-NEXT: retsp 0 31 %0 = getelementptr inbounds %struct.FRAME.f* %CHAIN.1, i32 0, i32 0 32 %1 = load i32* %0, align 4 33 ret i32 %1 34 } 35 36 declare void @llvm.init.trampoline(i8*, i8*, i8*) nounwind 37 declare i8* @llvm.adjust.trampoline(i8*) nounwind 38 39 declare void @h(i32 ()*) 40