brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 9ec7f81 Raw
68 lines · plain
1; RUN: llc -mtriple=mips -relocation-model=pic < %s \2; RUN:   | FileCheck --check-prefixes=CHECK,EB %s3; RUN: llc -mtriple=mipsel -relocation-model=pic < %s \4; RUN:   | FileCheck --check-prefixes=CHECK,EL %s5 6; Simple memory7@g1 = external global i328 9define i32 @f1(i32 %x) nounwind {10entry:11; CHECK-LABEL: f1:12; CHECK: #APP13; CHECK: sw $4, [[OFFSET:[0-9]+]]($sp)14; CHECK: #NO_APP15; CHECK: lw  $[[T1:[0-9]+]], %got(g1)16; CHECK: #APP17; CHECK: lw $[[T3:[0-9]+]], [[OFFSET]]($sp)18; CHECK: #NO_APP19; CHECK: sw  $[[T3]], 0($[[T1]])20 21  %l1 = alloca i32, align 422  call void asm "sw $1, $0", "=*m,r"(ptr elementtype(i32) %l1, i32 %x) nounwind23  %0 = call i32 asm "lw $0, $1", "=r,*m"(ptr elementtype(i32) %l1) nounwind24  store i32 %0, ptr @g1, align 425  ret i32 %026}27 28; CHECK-LABEL: main:29; "D": Second word of a double word. This works for any memory element30; double or single.31; CHECK: #APP32; CHECK: lw ${{[0-9]+}}, 16(${{[0-9]+}})33; CHECK: #NO_APP34 35; No "D": First word of a double word. This works for any memory element36; double or single.37; CHECK: #APP38; CHECK: lw ${{[0-9]+}}, 12(${{[0-9]+}})39; CHECK: #NO_APP40 41; "M": High-order word of a double word.42; CHECK: #APP43; EB:    lw ${{[0-9]+}}, 12(${{[0-9]+}})44; EL:    lw ${{[0-9]+}}, 16(${{[0-9]+}})45; CHECK: #NO_APP46 47; "L": Low-order word of a double word.48; CHECK: #APP49; EB:    lw ${{[0-9]+}}, 16(${{[0-9]+}})50; EL:    lw ${{[0-9]+}}, 12(${{[0-9]+}})51; CHECK: #NO_APP52 53@b = common global [20 x i32] zeroinitializer, align 454 55define void @main() {56entry:57; Second word:58  tail call void asm sideeffect "    lw    $0, ${1:D}", "r,*m,~{$11}"(i32 undef, ptr elementtype(i32) getelementptr inbounds ([20 x i32], ptr @b, i32 0, i32 3))59; First word. Notice, no 'D':60  tail call void asm sideeffect "    lw    $0, ${1}", "r,*m,~{$11}"(i32 undef, ptr elementtype(i32) getelementptr inbounds ([20 x i32], ptr @b, i32 0, i32 3))61 62; High-order part.63  tail call void asm sideeffect "    lw    $0, ${1:M}", "r,*m,~{$11}"(i32 undef, ptr elementtype(i32) getelementptr inbounds ([20 x i32], ptr @b, i32 0, i32 3))64; Low-order part.65  tail call void asm sideeffect "    lw    $0, ${1:L}", "r,*m,~{$11}"(i32 undef, ptr elementtype(i32) getelementptr inbounds ([20 x i32], ptr @b, i32 0, i32 3))66  ret void67}68