xref: /aosp_15_r20/external/llvm/test/MC/Mips/do_switch2.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// This test case will cause an internal EK_GPRel64BlockAddress to be
2*9880d681SAndroid Build Coastguard Worker// produced. This was not handled for direct object and an assertion
3*9880d681SAndroid Build Coastguard Worker// to occur. This is a variation on test case test/CodeGen/Mips/do_switch.ll
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc < %s -filetype=obj -triple=mips-pc-linux
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker	.text
8*9880d681SAndroid Build Coastguard Worker	.abicalls
9*9880d681SAndroid Build Coastguard Worker	.section	.mdebug.abi32,"",@progbits
10*9880d681SAndroid Build Coastguard Worker	.file	"/home/espindola/llvm/llvm/test/MC/Mips/do_switch.ll"
11*9880d681SAndroid Build Coastguard Worker	.text
12*9880d681SAndroid Build Coastguard Worker	.globl	main
13*9880d681SAndroid Build Coastguard Worker	.align	2
14*9880d681SAndroid Build Coastguard Worker	.type	main,@function
15*9880d681SAndroid Build Coastguard Worker	.set	nomips16
16*9880d681SAndroid Build Coastguard Worker	.ent	main
17*9880d681SAndroid Build Coastguard Workermain:                                   # @main
18*9880d681SAndroid Build Coastguard Worker	.frame	$sp,8,$ra
19*9880d681SAndroid Build Coastguard Worker	.mask 	0x00000000,0
20*9880d681SAndroid Build Coastguard Worker	.fmask	0x00000000,0
21*9880d681SAndroid Build Coastguard Worker	.set	noreorder
22*9880d681SAndroid Build Coastguard Worker	.set	nomacro
23*9880d681SAndroid Build Coastguard Worker	.set	noat
24*9880d681SAndroid Build Coastguard Worker# BB#0:                                 # %entry
25*9880d681SAndroid Build Coastguard Worker	lui	$2, %hi(_gp_disp)
26*9880d681SAndroid Build Coastguard Worker	addiu	$2, $2, %lo(_gp_disp)
27*9880d681SAndroid Build Coastguard Worker	addiu	$sp, $sp, -8
28*9880d681SAndroid Build Coastguard Worker	addiu	$1, $zero, 2
29*9880d681SAndroid Build Coastguard Worker	sw	$1, 4($sp)
30*9880d681SAndroid Build Coastguard Worker	lw	$3, 4($sp)
31*9880d681SAndroid Build Coastguard Worker	sltiu	$1, $3, 4
32*9880d681SAndroid Build Coastguard Worker	bnez	$1, $BB0_2
33*9880d681SAndroid Build Coastguard Worker	addu	$2, $2, $25
34*9880d681SAndroid Build Coastguard Worker$BB0_1:                                 # %bb4
35*9880d681SAndroid Build Coastguard Worker	addiu	$2, $zero, 4
36*9880d681SAndroid Build Coastguard Worker	jr	$ra
37*9880d681SAndroid Build Coastguard Worker	addiu	$sp, $sp, 8
38*9880d681SAndroid Build Coastguard Worker$BB0_2:                                 # %entry
39*9880d681SAndroid Build Coastguard Worker	sll	$1, $3, 2
40*9880d681SAndroid Build Coastguard Worker	lw	$3, %got($JTI0_0)($2)
41*9880d681SAndroid Build Coastguard Worker	addu	$1, $1, $3
42*9880d681SAndroid Build Coastguard Worker	lw	$1, %lo($JTI0_0)($1)
43*9880d681SAndroid Build Coastguard Worker	addu	$1, $1, $2
44*9880d681SAndroid Build Coastguard Worker	jr	$1
45*9880d681SAndroid Build Coastguard Worker	nop
46*9880d681SAndroid Build Coastguard Worker$BB0_3:                                 # %bb5
47*9880d681SAndroid Build Coastguard Worker	addiu	$2, $zero, 1
48*9880d681SAndroid Build Coastguard Worker	jr	$ra
49*9880d681SAndroid Build Coastguard Worker	addiu	$sp, $sp, 8
50*9880d681SAndroid Build Coastguard Worker$BB0_4:                                 # %bb1
51*9880d681SAndroid Build Coastguard Worker	addiu	$2, $zero, 2
52*9880d681SAndroid Build Coastguard Worker	jr	$ra
53*9880d681SAndroid Build Coastguard Worker	addiu	$sp, $sp, 8
54*9880d681SAndroid Build Coastguard Worker$BB0_5:                                 # %bb2
55*9880d681SAndroid Build Coastguard Worker	addiu	$2, $zero, 0
56*9880d681SAndroid Build Coastguard Worker	jr	$ra
57*9880d681SAndroid Build Coastguard Worker	addiu	$sp, $sp, 8
58*9880d681SAndroid Build Coastguard Worker$BB0_6:                                 # %bb3
59*9880d681SAndroid Build Coastguard Worker	addiu	$2, $zero, 3
60*9880d681SAndroid Build Coastguard Worker	jr	$ra
61*9880d681SAndroid Build Coastguard Worker	addiu	$sp, $sp, 8
62*9880d681SAndroid Build Coastguard Worker	.set	at
63*9880d681SAndroid Build Coastguard Worker	.set	macro
64*9880d681SAndroid Build Coastguard Worker	.set	reorder
65*9880d681SAndroid Build Coastguard Worker	.end	main
66*9880d681SAndroid Build Coastguard Worker$tmp0:
67*9880d681SAndroid Build Coastguard Worker	.size	main, ($tmp0)-main
68*9880d681SAndroid Build Coastguard Worker	.section	.rodata,"a",@progbits
69*9880d681SAndroid Build Coastguard Worker	.align	2
70*9880d681SAndroid Build Coastguard Worker$JTI0_0:
71*9880d681SAndroid Build Coastguard Worker	.gpword	($BB0_3)
72*9880d681SAndroid Build Coastguard Worker	.gpword	($BB0_4)
73*9880d681SAndroid Build Coastguard Worker	.gpword	($BB0_5)
74*9880d681SAndroid Build Coastguard Worker	.gpword	($BB0_6)
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard Worker	.text
78