1 ; RUN: llc -filetype=asm -mtriple=mipsel-none-nacl -relocation-model=static \
2 ; RUN: -O3 < %s | FileCheck %s
5 ; This test tests that NaCl functions are bundle-aligned.
17 ; This test tests that blocks that are jumped to through jump table are
20 define i32 @test1(i32 %i) {
22 switch i32 %i, label %default [
44 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
46 ; CHECK-NEXT: addiu $2, $zero, 111
47 ; CHECK-NEXT: .p2align 4
48 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
50 ; CHECK-NEXT: addiu $2, $zero, 333
51 ; CHECK-NEXT: .p2align 4
52 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
54 ; CHECK-NEXT: addiu $2, $zero, 444
55 ; CHECK-NEXT: .p2align 4
56 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
58 ; CHECK-NEXT: addiu $2, $zero, 222
59 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
61 ; CHECK-NEXT: addiu $2, $zero, 555
66 ; This test tests that a block whose address is taken is bundle-aligned in NaCl.
68 @bb_array = constant [2 x ptr] [ptr blockaddress(@test2, %bb1),
69 ptr blockaddress(@test2, %bb2)], align 4
71 define i32 @test2(i32 %i) {
73 %elementptr = getelementptr inbounds [2 x ptr], ptr @bb_array, i32 0, i32 %i
74 %0 = load ptr, ptr %elementptr, align 4
75 indirectbr ptr %0, [label %bb1, label %bb2]
85 ; Note that there are two consecutive labels - one temporary and one for
89 ; CHECK-NEXT: ${{[a-zA-Z0-9]+}}:
90 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
92 ; CHECK-NEXT: addiu $2, $zero, 111
93 ; CHECK-NEXT: .p2align 4
94 ; CHECK-NEXT: ${{[a-zA-Z0-9]+}}:
95 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
97 ; CHECK-NEXT: addiu $2, $zero, 222