1 ; RUN: llc -filetype=asm -mtriple=mipsel-none-linux -relocation-model=static \
2 ; RUN: -O3 < %s | FileCheck %s
4 ; RUN: llc -filetype=asm -mtriple=mipsel-none-nacl -relocation-model=static \
5 ; RUN: -O3 < %s | FileCheck %s -check-prefix=CHECK-NACL
7 @x = global i32 0, align 4
12 define void @test1() {
13 %1 = load i32, i32* @x, align 4
20 ; We first make sure that for non-NaCl targets branch-delay slot contains
21 ; dangerous instructions.
23 ; Check that branch-delay slot is used to load argument from x before function
27 ; CHECK-NEXT: lw $4, %lo(x)(${{[0-9]+}})
29 ; Check that branch-delay slot is used for adjusting sp before return.
32 ; CHECK-NEXT: addiu $sp, $sp, {{[0-9]+}}
35 ; For NaCl, check that branch-delay slot doesn't contain dangerous instructions.
38 ; CHECK-NACL-NEXT: nop
41 ; CHECK-NACL-NEXT: nop
45 define void @test2() {
46 store i32 1, i32* @x, align 4
53 ; Check that branch-delay slot is used for storing to x before function call.
56 ; CHECK-NEXT: sw ${{[0-9]+}}, %lo(x)(${{[0-9]+}})
58 ; Check that branch-delay slot is used for adjusting sp before return.
61 ; CHECK-NEXT: addiu $sp, $sp, {{[0-9]+}}
64 ; For NaCl, check that branch-delay slot doesn't contain dangerous instructions.
67 ; CHECK-NACL-NEXT: nop
70 ; CHECK-NACL-NEXT: nop