1 ; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC 2 ; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static -disable-fp-elim < %s | FileCheck %s -check-prefix=STATIC-FP 3 ; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC 4 ; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic -disable-fp-elim < %s | FileCheck %s -check-prefix=PIC-FP 5 6 ; Generated using clang -O0 -emit-llvm -S -target mipsel-unknown-linux -g test.c -o test.ll 7 ; test.c: 8 ; 9 ; void hello_world(void) { 10 ; printf("Hello, World!\n"); 11 ; } 12 13 @.str = private unnamed_addr constant [15 x i8] c"Hello, World!\0A\00", align 1 14 15 define void @hello_world() #0 !dbg !4 { 16 entry: 17 ; STATIC: addiu $sp, $sp, -{{[0-9]+}} 18 ; STATIC: sw $ra, {{[0-9]+}}($sp) 19 ; STATIC: .loc 1 2 3 prologue_end 20 ; STATIC: lui $[[R0:[0-9]+]], %hi($.str) 21 22 ; STATIC-FP: addiu $sp, $sp, -{{[0-9]+}} 23 ; STATIC-FP: sw $ra, {{[0-9]+}}($sp) 24 ; STATIC-FP: sw $fp, {{[0-9]+}}($sp) 25 ; STATIC-FP: move $fp, $sp 26 ; STATIC-FP: .loc 1 2 3 prologue_end 27 ; STATIC-FP: lui $[[R0:[0-9]+]], %hi($.str) 28 29 ; PIC: lui $[[R0:[0-9]+]], %hi(_gp_disp) 30 ; PIC: addiu $[[R0]], $[[R0]], %lo(_gp_disp) 31 ; PIC: addiu $sp, $sp, -{{[0-9]+}} 32 ; PIC: sw $ra, {{[0-9]+}}($sp) 33 ; PIC: addu $[[R1:[0-9]+]], $[[R0]], $25 34 ; PIC: .loc 1 2 3 prologue_end 35 ; PIC: lw $[[R2:[0-9]+]], %got($.str)($[[R1]]) 36 37 ; PIC-FP: lui $[[R0:[0-9]+]], %hi(_gp_disp) 38 ; PIC-FP: addiu $[[R0]], $[[R0]], %lo(_gp_disp) 39 ; PIC-FP: addiu $sp, $sp, -{{[0-9]+}} 40 ; PIC-FP: sw $ra, {{[0-9]+}}($sp) 41 ; PIC-FP: sw $fp, {{[0-9]+}}($sp) 42 ; PIC-FP: move $fp, $sp 43 ; PIC-FP: addu $[[R1:[0-9]+]], $[[R0]], $25 44 ; PIC-FP: .loc 1 2 3 prologue_end 45 ; PIC-FP: lw $[[R2:[0-9]+]], %got($.str)($[[R1]]) 46 47 %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)), !dbg !10 48 ret void, !dbg !11 49 } 50 51 declare i32 @printf(i8*, ...) 52 53 attributes #0 = { nounwind } 54 55 !llvm.dbg.cu = !{!0} 56 !llvm.module.flags = !{!7, !8} 57 !llvm.ident = !{!9} 58 59 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) 60 !1 = !DIFile(filename: "test.c", directory: "/tmp") 61 !2 = !{} 62 !3 = !{!4} 63 !4 = distinct !DISubprogram(name: "hello_world", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2) 64 !5 = !DISubroutineType(types: !6) 65 !6 = !{null} 66 !7 = !{i32 2, !"Dwarf Version", i32 4} 67 !8 = !{i32 2, !"Debug Info Version", i32 3} 68 !9 = !{!"clang version 3.8.0"} 69 !10 = !DILocation(line: 2, column: 3, scope: !4) 70 !11 = !DILocation(line: 3, column: 1, scope: !4) 71