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: ${{BB[0-9]+_[0-9]+}}:
49 ; CHECK-NEXT: addiu $2, $zero, 555
50 ; CHECK-NEXT: .p2align 4
51 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
53 ; CHECK-NEXT: addiu $2, $zero, 222
54 ; CHECK-NEXT: .p2align 4
55 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
57 ; CHECK-NEXT: addiu $2, $zero, 333
62 ; This test tests that a block whose address is taken is bundle-aligned in NaCl.
64 @bb_array = constant [2 x i8*] [i8* blockaddress(@test2, %bb1),
65 i8* blockaddress(@test2, %bb2)], align 4
67 define i32 @test2(i32 %i) {
69 %elementptr = getelementptr inbounds [2 x i8*], [2 x i8*]* @bb_array, i32 0, i32 %i
70 %0 = load i8*, i8** %elementptr, align 4
71 indirectbr i8* %0, [label %bb1, label %bb2]
81 ; Note that there are two consecutive labels - one temporary and one for
85 ; CHECK-NEXT: ${{[a-zA-Z0-9]+}}:
86 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
88 ; CHECK-NEXT: addiu $2, $zero, 111
89 ; CHECK-NEXT: .p2align 4
90 ; CHECK-NEXT: ${{[a-zA-Z0-9]+}}:
91 ; CHECK-NEXT: ${{BB[0-9]+_[0-9]+}}:
93 ; CHECK-NEXT: addiu $2, $zero, 222