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