Home | History | Annotate | Download | only in llvm2ice_tests
      1 ; Simple test of the store instruction.
      2 
      3 ; REQUIRES: allow_dump
      4 
      5 ; RUN: %p2i -i %s --args --verbose inst -threads=0 | FileCheck %s
      6 
      7 ; RUN: %if --need=target_MIPS32 --need=allow_dump \
      8 ; RUN:   --command %p2i --filetype=asm --assemble \
      9 ; RUN:   --disassemble --target mips32 -i %s --args -O2 \
     10 ; RUN:   -allow-externally-defined-symbols \
     11 ; RUN:   | %if --need=target_MIPS32 --need=allow_dump \
     12 ; RUN:   --command FileCheck --check-prefix MIPS32 %s
     13 
     14 define internal void @store_i64(i32 %addr_arg) {
     15 entry:
     16   %__1 = inttoptr i32 %addr_arg to i64*
     17   store i64 1, i64* %__1, align 1
     18   ret void
     19 
     20 ; CHECK:       Initial CFG
     21 ; CHECK:     entry:
     22 ; CHECK-NEXT:  store i64 1, i64* %addr_arg, align 1
     23 ; CHECK-NEXT:  ret void
     24 }
     25 ; MIPS32-LABEL: store_i64
     26 ; MIPS32: li
     27 ; MIPS32: li
     28 ; MIPS32: sw
     29 ; MIPS32: sw
     30 
     31 define internal void @store_i32(i32 %addr_arg) {
     32 entry:
     33   %__1 = inttoptr i32 %addr_arg to i32*
     34   store i32 1, i32* %__1, align 1
     35   ret void
     36 
     37 ; CHECK:       Initial CFG
     38 ; CHECK:     entry:
     39 ; CHECK-NEXT:  store i32 1, i32* %addr_arg, align 1
     40 ; CHECK-NEXT:  ret void
     41 }
     42 ; MIPS32-LABEL: store_i32
     43 ; MIPS32: li
     44 ; MIPS32: sw
     45 
     46 define internal void @store_i16(i32 %addr_arg) {
     47 entry:
     48   %__1 = inttoptr i32 %addr_arg to i16*
     49   store i16 1, i16* %__1, align 1
     50   ret void
     51 
     52 ; CHECK:       Initial CFG
     53 ; CHECK:     entry:
     54 ; CHECK-NEXT:  store i16 1, i16* %addr_arg, align 1
     55 ; CHECK-NEXT:  ret void
     56 }
     57 ; MIPS32-LABEL: store_i16
     58 ; MIPS32: li
     59 ; MIPS32: sh
     60 
     61 define internal void @store_i8(i32 %addr_arg) {
     62 entry:
     63   %__1 = inttoptr i32 %addr_arg to i8*
     64   store i8 1, i8* %__1, align 1
     65   ret void
     66 
     67 ; CHECK:       Initial CFG
     68 ; CHECK:     entry:
     69 ; CHECK-NEXT:  store i8 1, i8* %addr_arg, align 1
     70 ; CHECK-NEXT:  ret void
     71 }
     72 ; MIPS32-LABEL: store_i8
     73 ; MIPS32: li
     74 ; MIPS32: sb
     75 
     76 define internal void @store_f32(float* %faddr_arg) {
     77 entry:
     78   store float 1.000000e+00, float* %faddr_arg, align 4
     79   ret void
     80 
     81 ; CHECK:       Initial CFG
     82 ; CHECK:     entry:
     83 ; CHECK-NEXT:  store float 1.000000e+00, float* %faddr_arg, align 4
     84 ; CHECK-NEXT:  ret void
     85 }
     86 ; MIPS32-LABEL: store_f32
     87 ; MIPS32: lui
     88 ; MIPS32: lwc1
     89 ; MIPS32: swc1
     90 
     91 define internal void @store_f64(double* %daddr_arg) {
     92 entry:
     93   store double 1.000000e+00, double* %daddr_arg, align 8
     94   ret void
     95 
     96 ; CHECK:       Initial CFG
     97 ; CHECK:     entry:
     98 ; CHECK-NEXT:  store double 1.000000e+00, double* %daddr_arg, align 8
     99 ; CHECK-NEXT:  ret void
    100 }
    101 ; MIPS32-LABEL: store_f64
    102 ; MIPS32: lui
    103 ; MIPS32: ldc1
    104 ; MIPS32: sdc1
    105