aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/scfi/aarch64/scfi-cfg-1.s
blob: 6925a8f7e38d805d1a40701275a82ba60b1e1d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Testcase for forward flow of SCFI information
# and CFG creation as well.  This testcase has two backward edges
# (one of which is a loop) and one exit path.
	.type   foo, %function
foo:
	.cfi_startproc
	stp    x29, x30, [sp, -48]!
	.cfi_def_cfa_offset 48
	.cfi_offset 29, -48
	.cfi_offset 30, -40
	mov     x29, sp
	.cfi_def_cfa_register 29
	str     x0, [sp, 24]
	adrp    x0, :got:xyz
	str     x0, [sp, 40]
	b       .L7
.L10:
	ldr     x0, [sp, 40]
	ldr     x0, [x0]
	mov     x1, x0
	ldr     x0, [sp, 24]
	bl      strcmp
	cmp     w0, 0
	bne     .L8
	ldr     x0, [sp, 40]
	ldr     w0, [x0, 8]
	b       .L9
.L8:
	ldr     x0, [sp, 40]
	add     x0, x0, 24
	str     x0, [sp, 40]
.L7:
	ldr     x0, [sp, 40]
	ldr     w0, [x0, 8]
	cmp     w0, 0
	bne     .L10
	mov     w0, 0
.L9:
	ldp     x29, x30, [sp], 48
	.cfi_def_cfa_register 31
	.cfi_restore 30
	.cfi_restore 29
	.cfi_def_cfa_offset 0
	ret
	.cfi_endproc
	.size   foo, .-foo