Daniel Sanders | 20c82ee4 | 2014-07-04 15:16:14 +0000 | [diff] [blame] | 1 | ; Test all important variants of the unconditional 'br' instruction. |
| 2 | |
Daniel Sanders | f5a5fbd | 2014-07-09 10:21:59 +0000 | [diff] [blame^] | 3 | ; RUN: llc -march=mips -mcpu=mips32 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOT-R6 |
| 4 | ; RUN: llc -march=mips -mcpu=mips32r2 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOT-R6 |
| 5 | ; RUN: llc -march=mips -mcpu=mips32r6 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=R6 |
| 6 | ; RUN: llc -march=mips64 -mcpu=mips4 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOT-R6 |
| 7 | ; RUN: llc -march=mips64 -mcpu=mips64 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOT-R6 |
| 8 | ; RUN: llc -march=mips64 -mcpu=mips64r2 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOT-R6 |
| 9 | ; RUN: llc -march=mips64 -mcpu=mips64r6 -asm-show-inst < %s | FileCheck %s -check-prefix=ALL -check-prefix=R6 |
Daniel Sanders | 20c82ee4 | 2014-07-04 15:16:14 +0000 | [diff] [blame] | 10 | |
| 11 | define i32 @br(i8 *%addr) { |
| 12 | ; ALL-LABEL: br: |
Daniel Sanders | f5a5fbd | 2014-07-09 10:21:59 +0000 | [diff] [blame^] | 13 | ; NOT-R6: jr $4 # <MCInst #{{[0-9]+}} JR |
| 14 | ; R6: jr $4 # <MCInst #{{[0-9]+}} JALR |
| 15 | |
Daniel Sanders | 20c82ee4 | 2014-07-04 15:16:14 +0000 | [diff] [blame] | 16 | ; ALL: $BB0_1: # %L1 |
Daniel Sanders | f5a5fbd | 2014-07-09 10:21:59 +0000 | [diff] [blame^] | 17 | ; NOT-R6: jr $ra # <MCInst #{{[0-9]+}} JR |
| 18 | ; R6: jr $ra # <MCInst #{{[0-9]+}} JALR |
Daniel Sanders | 20c82ee4 | 2014-07-04 15:16:14 +0000 | [diff] [blame] | 19 | ; ALL: addiu $2, $zero, 0 |
Daniel Sanders | f5a5fbd | 2014-07-09 10:21:59 +0000 | [diff] [blame^] | 20 | |
Daniel Sanders | 20c82ee4 | 2014-07-04 15:16:14 +0000 | [diff] [blame] | 21 | ; ALL: $BB0_2: # %L2 |
Daniel Sanders | f5a5fbd | 2014-07-09 10:21:59 +0000 | [diff] [blame^] | 22 | ; NOT-R6: jr $ra # <MCInst #{{[0-9]+}} JR |
| 23 | ; R6: jr $ra # <MCInst #{{[0-9]+}} JALR |
Daniel Sanders | 20c82ee4 | 2014-07-04 15:16:14 +0000 | [diff] [blame] | 24 | ; ALL: addiu $2, $zero, 1 |
| 25 | |
| 26 | entry: |
| 27 | indirectbr i8* %addr, [label %L1, label %L2] |
| 28 | |
| 29 | L1: |
| 30 | ret i32 0 |
| 31 | |
| 32 | L2: |
| 33 | ret i32 1 |
| 34 | } |