Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -filetype=asm -o - -mtriple=mips-unknown-linux-gnu < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MIPS32 %s
      2 ; RUN: llc -filetype=asm -o - -mtriple=mipsel-unknown-linux-gnu < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MIPS32 %s
      3 ; RUN: llc -filetype=asm -o - -mtriple=mips64-unknown-linux-gnu < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MIPS64 %s
      4 ; RUN: llc -filetype=asm -o - -mtriple=mips64el-unknown-linux-gnu < %s | FileCheck --check-prefix=CHECK --check-prefix=CHECK-MIPS64 %s
      5 
      6 define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" {
      7 ; CHECK:       .p2align 2
      8 ; CHECK-MIPS64-LABEL: .Lxray_sled_0:
      9 ; CHECK-MIPS32-LABEL: $xray_sled_0:
     10 ; CHECK-MIPS64:  b .Ltmp0
     11 ; CHECK-MIPS32:  b $tmp0
     12 ; CHECK-NEXT:  nop
     13 ; CHECK-NEXT:  nop
     14 ; CHECK-NEXT:  nop
     15 ; CHECK-NEXT:  nop
     16 ; CHECK-NEXT:  nop
     17 ; CHECK-NEXT:  nop
     18 ; CHECK-NEXT:  nop
     19 ; CHECK-NEXT:  nop
     20 ; CHECK-NEXT:  nop
     21 ; CHECK-NEXT:  nop
     22 ; CHECK-NEXT:  nop
     23 ; CHECK-MIPS64:  nop
     24 ; CHECK-MIPS64:  nop
     25 ; CHECK-MIPS64:  nop
     26 ; CHECK-MIPS64:  nop
     27 ; CHECK-MIPS64-LABEL: .Ltmp0:
     28 ; CHECK-MIPS32-LABEL: $tmp0:
     29 ; CHECK-MIPS32:  addiu $25, $25, 52
     30   ret i32 0
     31 ; CHECK:       .p2align 2
     32 ; CHECK-MIPS64-LABEL: .Lxray_sled_1:
     33 ; CHECK-MIPS32-LABEL: $xray_sled_1:
     34 ; CHECK-MIPS64:  b .Ltmp1
     35 ; CHECK-MIPS32:  b $tmp1
     36 ; CHECK-NEXT:  nop
     37 ; CHECK-NEXT:  nop
     38 ; CHECK-NEXT:  nop
     39 ; CHECK-NEXT:  nop
     40 ; CHECK-NEXT:  nop
     41 ; CHECK-NEXT:  nop
     42 ; CHECK-NEXT:  nop
     43 ; CHECK-NEXT:  nop
     44 ; CHECK-NEXT:  nop
     45 ; CHECK-NEXT:  nop
     46 ; CHECK-NEXT:  nop
     47 ; CHECK-MIPS64:  nop
     48 ; CHECK-MIPS64:  nop
     49 ; CHECK-MIPS64:  nop
     50 ; CHECK-MIPS64:  nop
     51 ; CHECK-MIPS64-LABEL: .Ltmp1:
     52 ; CHECK-MIPS32-LABEL: $tmp1:
     53 ; CHECK-MIPS32:  addiu $25, $25, 52
     54 }
     55 ; CHECK:  .section xray_instr_map,{{.*}}
     56 ; CHECK-MIPS64: .8byte  .Lxray_sled_0
     57 ; CHECK-MIPS64: .8byte  .Lxray_sled_1
     58 ; CHECK-MIPS32: .4byte  ($xray_sled_0)
     59 ; CHECK-MIPS32: .4byte  ($xray_sled_1)
     60 
     61 ; We test multiple returns in a single function to make sure we're getting all
     62 ; of them with XRay instrumentation.
     63 define i32 @bar(i32 %i) nounwind noinline uwtable "function-instrument"="xray-always" {
     64 ; CHECK:       .p2align 2
     65 ; CHECK-MIPS64-LABEL: .Lxray_sled_2:
     66 ; CHECK-MIPS32-LABEL: $xray_sled_2:
     67 ; CHECK-MIPS64:  b .Ltmp2
     68 ; CHECK-MIPS32:  b $tmp2
     69 ; CHECK-NEXT:  nop
     70 ; CHECK-NEXT:  nop
     71 ; CHECK-NEXT:  nop
     72 ; CHECK-NEXT:  nop
     73 ; CHECK-NEXT:  nop
     74 ; CHECK-NEXT:  nop
     75 ; CHECK-NEXT:  nop
     76 ; CHECK-NEXT:  nop
     77 ; CHECK-NEXT:  nop
     78 ; CHECK-NEXT:  nop
     79 ; CHECK-NEXT:  nop
     80 ; CHECK-MIPS64:  nop
     81 ; CHECK-MIPS64:  nop
     82 ; CHECK-MIPS64:  nop
     83 ; CHECK-MIPS64:  nop
     84 ; CHECK-MIPS64-LABEL: .Ltmp2:
     85 ; CHECK-MIPS32-LABEL: $tmp2:
     86 ; CHECK-MIPS32:  addiu $25, $25, 52
     87 Test:
     88   %cond = icmp eq i32 %i, 0
     89   br i1 %cond, label %IsEqual, label %NotEqual
     90 IsEqual:
     91   ret i32 0
     92 ; CHECK:       .p2align 2
     93 ; CHECK-MIPS64-LABEL: .Lxray_sled_3:
     94 ; CHECK-MIPS32-LABEL: $xray_sled_3:
     95 ; CHECK-MIPS64:  b .Ltmp3
     96 ; CHECK-MIPS32:  b $tmp3
     97 ; CHECK-NEXT:  nop
     98 ; CHECK-NEXT:  nop
     99 ; CHECK-NEXT:  nop
    100 ; CHECK-NEXT:  nop
    101 ; CHECK-NEXT:  nop
    102 ; CHECK-NEXT:  nop
    103 ; CHECK-NEXT:  nop
    104 ; CHECK-NEXT:  nop
    105 ; CHECK-NEXT:  nop
    106 ; CHECK-NEXT:  nop
    107 ; CHECK-NEXT:  nop
    108 ; CHECK-MIPS64:  nop
    109 ; CHECK-MIPS64:  nop
    110 ; CHECK-MIPS64:  nop
    111 ; CHECK-MIPS64:  nop
    112 ; CHECK-MIPS64-LABEL: .Ltmp3:
    113 ; CHECK-MIPS32-LABEL: $tmp3:
    114 ; CHECK-MIPS32:  addiu $25, $25, 52 
    115 NotEqual:
    116   ret i32 1
    117 ; CHECK:       .p2align 2
    118 ; CHECK-MIPS64-LABEL: .Lxray_sled_4:
    119 ; CHECK-MIPS32-LABEL: $xray_sled_4:
    120 ; CHECK-MIPS64:  b .Ltmp4
    121 ; CHECK-MIPS32:  b $tmp4
    122 ; CHECK-NEXT:  nop
    123 ; CHECK-NEXT:  nop
    124 ; CHECK-NEXT:  nop
    125 ; CHECK-NEXT:  nop
    126 ; CHECK-NEXT:  nop
    127 ; CHECK-NEXT:  nop
    128 ; CHECK-NEXT:  nop
    129 ; CHECK-NEXT:  nop
    130 ; CHECK-NEXT:  nop
    131 ; CHECK-NEXT:  nop
    132 ; CHECK-NEXT:  nop
    133 ; CHECK-MIPS64:  nop
    134 ; CHECK-MIPS64:  nop
    135 ; CHECK-MIPS64:  nop
    136 ; CHECK-MIPS64:  nop
    137 ; CHECK-MIPS64-LABEL: .Ltmp4:
    138 ; CHECK-MIPS32-LABEL: $tmp4:
    139 ; CHECK-MIPS32:  addiu $25, $25, 52
    140 }
    141 ; CHECK: .section xray_instr_map,{{.*}}
    142 ; CHECK-MIPS64: .8byte  .Lxray_sled_2
    143 ; CHECK-MIPS64: .8byte  .Lxray_sled_3
    144 ; CHECK-MIPS64: .8byte  .Lxray_sled_4
    145 ; CHECK-MIPS32: .4byte	($xray_sled_2)
    146 ; CHECK-MIPS32: .4byte	($xray_sled_3)
    147 ; CHECK-MIPS32: .4byte	($xray_sled_4)
    148