#
# This is a generic function to test that restoring registers during unwinding work correctly.
#
.literal4
.align 2
LC14: .long 1096810496
LC15: .long 1097859072
LC16: .long 1098907648
LC17: .long 1099431936
LC18: .long 1099956224
LC19: .long 1100480512
LC20: .long 1101004800
LC21: .long 1101529088
LC22: .long 1102053376
LC23: .long 1102577664
LC24: .long 1103101952
LC25: .long 1103626240
LC26: .long 1104150528
LC27: .long 1104674816
LC28: .long 1105199104
LC29: .long 1105723392
LC30: .long 1106247680
LC31: .long 1106771968
.literal16
LV23: .long 0x23232323, 0x23232322, 0x23232321, 0x23232320
LV24: .long 0x24242424, 0x24242422, 0x24242421, 0x24242420
LV25: .long 0x25252525, 0x25252522, 0x25252521, 0x25252520
LV26: .long 0x26262626, 0x26262622, 0x26262621, 0x26262620
LV27: .long 0x27272727, 0x27272722, 0x27272721, 0x27272720
LV28: .long 0x28282828, 0x28282822, 0x28282821, 0x28282820
LV29: .long 0x29292929, 0x29292922, 0x29292921, 0x29292920
LV30: .long 0x30303030, 0x30303022, 0x30303021, 0x30303020
LV31: .long 0x31313131, 0x31313122, 0x31313121, 0x31313120
.text
.globl _unwind_tester
_unwind_tester:
LFB2:
mflr r0
LCFI43:
bl saveFP stmw r13,-220(r1)
LCFI45:
stwu r1,-336(r1)
LCFI46:
# load magic values into non-volatile registers
lis r31,0x3333
ori r31,r31,0x3131
lis r30,0x3333
ori r30,r30,0x3030
lis r29,0x2222
ori r29,r29,0x2929
lis r28,0x2222
ori r28,r28,0x2828
lis r27,0x2222
ori r27,r27,0x2727
lis r26,0x2222
ori r26,r26,0x2626
lis r25,0x2222
ori r25,r25,0x2525
lis r24,0x2222
ori r24,r24,0x2424
lis r23,0x2222
ori r23,r23,0x2323
lis r22,0x2222
ori r22,r22,0x2222
lis r21,0x2222
ori r21,r21,0x2121
lis r20,0x2222
ori r20,r20,0x2020
lis r19,0x1111
ori r19,r19,0x1919
lis r18,0x1111
ori r18,r18,0x1818
lis r17,0x1111
ori r17,r17,0x1717
lis r16,0x1111
ori r16,r16,0x1616
lis r15,0x1111
ori r15,r15,0x1515
lis r14,0x1111
ori r14,r14,0x1414
lis r13,0x1111
ori r13,r13,0x1313
lis r2,ha16(LC14)
lfs f14,lo16(LC14)(r2)
lis r2,ha16(LC15)
lfs f15,lo16(LC15)(r2)
lis r2,ha16(LC16)
lfs f16,lo16(LC16)(r2)
lis r2,ha16(LC17)
lfs f17,lo16(LC17)(r2)
lis r2,ha16(LC18)
lfs f18,lo16(LC18)(r2)
lis r2,ha16(LC19)
lfs f19,lo16(LC19)(r2)
lis r2,ha16(LC20)
lfs f20,lo16(LC20)(r2)
lis r2,ha16(LC21)
lfs f21,lo16(LC21)(r2)
lis r2,ha16(LC22)
lfs f22,lo16(LC22)(r2)
lis r2,ha16(LC23)
lfs f23,lo16(LC23)(r2)
lis r2,ha16(LC24)
lfs f24,lo16(LC24)(r2)
lis r2,ha16(LC25)
lfs f25,lo16(LC25)(r2)
lis r2,ha16(LC26)
lfs f26,lo16(LC26)(r2)
lis r2,ha16(LC27)
lfs f27,lo16(LC27)(r2)
lis r2,ha16(LC28)
lfs f28,lo16(LC28)(r2)
lis r2,ha16(LC29)
lfs f29,lo16(LC29)(r2)
lis r2,ha16(LC30)
lfs f30,lo16(LC30)(r2)
lis r2,ha16(LC31)
lfs f31,lo16(LC31)(r2)
lis r2,ha16(LV23)
la r2,lo16(LV23)(r2)
lvx v23,0,r2
lis r2,ha16(LV24)
la r2,lo16(LV24)(r2)
lvx v24,0,r2
lis r2,ha16(LV25)
la r2,lo16(LV25)(r2)
lvx v25,0,r2
lis r2,ha16(LV26)
la r2,lo16(LV26)(r2)
lvx v26,0,r2
lis r2,ha16(LV27)
la r2,lo16(LV27)(r2)
lvx v27,0,r2
lis r2,ha16(LV28)
la r2,lo16(LV28)(r2)
lvx v28,0,r2
lis r2,ha16(LV29)
la r2,lo16(LV29)(r2)
lvx v29,0,r2
lis r2,ha16(LV30)
la r2,lo16(LV30)(r2)
lvx v30,0,r2
lis r2,ha16(LV31)
la r2,lo16(LV31)(r2)
lvx v31,0,r2
lis r2,0x1234
ori r2,r2,0x5678
mtocrf 255,r2
# call test function which will invoke unwinder which "returns" here
mtctr r3
bctrl
# verify that non-volatile registers still contain magic values
lis r3,0x3333
ori r3,r3,0x3131
cmpw r3,r31
bne L2
lis r3,0x3333
ori r3,r3,0x3030
cmpw r3,r30
bne L2
lis r3,0x2222
ori r3,r3,0x2929
cmpw r3,r29
bne L2
lis r3,0x2222
ori r3,r3,0x2828
cmpw r3,r28
bne L2
lis r3,0x2222
ori r3,r3,0x2727
cmpw r3,r27
bne L2
lis r3,0x2222
ori r3,r3,0x2626
cmpw r3,r26
bne L2
lis r3,0x2222
ori r3,r3,0x2525
cmpw r3,r25
bne L2
lis r3,0x2222
ori r3,r3,0x2424
cmpw r3,r24
bne L2
lis r3,0x2222
ori r3,r3,0x2323
cmpw r3,r23
bne L2
lis r3,0x2222
ori r3,r3,0x2222
cmpw r3,r22
bne L2
lis r3,0x2222
ori r3,r3,0x2121
cmpw r3,r21
bne L2
lis r3,0x2222
ori r3,r3,0x2020
cmpw r3,r20
bne L2
lis r3,0x1111
ori r3,r3,0x1919
cmpw r3,r19
bne L2
lis r3,0x1111
ori r3,r3,0x1818
cmpw r3,r18
bne L2
lis r3,0x1111
ori r3,r3,0x1717
cmpw r3,r17
bne L2
lis r3,0x1111
ori r3,r3,0x1616
cmpw r3,r16
bne L2
lis r3,0x1111
ori r3,r3,0x1515
cmpw r3,r15
bne L2
lis r3,0x1111
ori r3,r3,0x1414
cmpw r3,r14
bne L2
lis r3,0x1111
ori r3,r3,0x1313
cmpw r3,r13
bne L2
lis r2,ha16(LC14)
lfs f1,lo16(LC14)(r2)
fcmpu cr7,f1,f14
bne cr7,L2
lis r2,ha16(LC15)
lfs f1,lo16(LC15)(r2)
fcmpu cr7,f1,f15
bne cr7,L2
lis r2,ha16(LC16)
lfs f1,lo16(LC16)(r2)
fcmpu cr7,f1,f16
bne cr7,L2
lis r2,ha16(LC17)
lfs f1,lo16(LC17)(r2)
fcmpu cr7,f1,f17
bne cr7,L2
lis r2,ha16(LC18)
lfs f1,lo16(LC18)(r2)
fcmpu cr7,f1,f18
bne cr7,L2
lis r2,ha16(LC19)
lfs f1,lo16(LC19)(r2)
fcmpu cr7,f1,f19
bne cr7,L2
lis r2,ha16(LC20)
lfs f1,lo16(LC20)(r2)
fcmpu cr7,f1,f20
bne cr7,L2
lis r2,ha16(LC21)
lfs f1,lo16(LC21)(r2)
fcmpu cr7,f1,f21
bne cr7,L2
lis r2,ha16(LC22)
lfs f1,lo16(LC22)(r2)
fcmpu cr7,f1,f22
bne cr7,L2
lis r2,ha16(LC23)
lfs f1,lo16(LC23)(r2)
fcmpu cr7,f1,f23
bne cr7,L2
lis r2,ha16(LC24)
lfs f1,lo16(LC24)(r2)
fcmpu cr7,f1,f24
bne cr7,L2
lis r2,ha16(LC25)
lfs f1,lo16(LC25)(r2)
fcmpu cr7,f1,f25
bne cr7,L2
lis r2,ha16(LC26)
lfs f1,lo16(LC26)(r2)
fcmpu cr7,f1,f26
bne cr7,L2
lis r2,ha16(LC27)
lfs f1,lo16(LC27)(r2)
fcmpu cr7,f1,f27
bne cr7,L2
lis r2,ha16(LC28)
lfs f1,lo16(LC28)(r2)
fcmpu cr7,f1,f28
bne cr7,L2
lis r2,ha16(LC29)
lfs f1,lo16(LC29)(r2)
fcmpu cr7,f1,f29
bne cr7,L2
lis r2,ha16(LC30)
lfs f1,lo16(LC30)(r2)
fcmpu cr7,f1,f30
bne cr7,L2
lis r2,ha16(LC31)
lfs f1,lo16(LC31)(r2)
fcmpu cr7,f1,f31
bne cr7,L2
lis r2,ha16(LV23)
la r2,lo16(LV23)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v23
beq cr6,L2
lis r2,ha16(LV24)
la r2,lo16(LV24)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v24
beq cr6,L2
lis r2,ha16(LV25)
la r2,lo16(LV25)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v25
beq cr6,L2
lis r2,ha16(LV26)
la r2,lo16(LV26)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v26
beq cr6,L2
lis r2,ha16(LV27)
la r2,lo16(LV27)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v27
beq cr6,L2
lis r2,ha16(LV28)
la r2,lo16(LV28)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v28
beq cr6,L2
lis r2,ha16(LV29)
la r2,lo16(LV29)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v29
beq cr6,L2
lis r2,ha16(LV30)
la r2,lo16(LV30)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v30
beq cr6,L2
lis r2,ha16(LV31)
la r2,lo16(LV31)(r2)
lvx v1,0,r2
vcmpequw. v0,v1,v31
beq cr6,L2
mfcr r3
lis r2,0x00FF
ori r2,r2,0xF000
and r3,r3,r2
lis r2,0x0034
ori r2,r2,0x5000
cmpw r3,r2
bne L2
li r3,0
b L3
L2: li r3,1
L3:
addi r1,r1,336
lwz r0,8(r1)
lmw r13,-220(r1)
mtlr r0
b restFP
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
EH_frame1:
.set L$set$0,LECIE1-LSCIE1
.long L$set$0 .long 0x0 .ascii "zR\0" .byte 0x7c .byte 0x1 .byte 0xc .byte 0x0 LECIE1:
.globl _unwind_tester.eh
_unwind_tester.eh:
LSFDE27:
.set L$set$34,LEFDE27-LASFDE27
.long L$set$34 .long LASFDE27-EH_frame1 .set L$set$35,LFE2-LFB2
.long L$set$35 .byte 0x4 .long L$set$36
.byte 0x9 .byte 0x0 .set L$set$37,LCFI46-LCFI43
.long L$set$37
.byte 0xe .byte 0x9f .byte 0x9e .byte 0x9d .byte 0x9c .byte 0x9b .byte 0x9a .byte 0x99 .byte 0x98 .byte 0x97 .byte 0x96 .byte 0x95 .byte 0x94 .byte 0x93 .byte 0x92 .byte 0x91 .byte 0x90 .byte 0x8f .byte 0x8e .byte 0x8d .byte 0x11 .byte 0x7e .byte 0x2 .byte 0x4 .byte 0x6 .byte 0x8 .byte 0xa .byte 0xc .byte 0xe .byte 0x10 .byte 0x12 .byte 0x14 .byte 0x16 .byte 0x18 .byte 0x1a .byte 0x1c .byte 0x1e .byte 0x20 .byte 0x22 .byte 0x24 LEFDE27: