70 lines · plain
1; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC2; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static -frame-pointer=all < %s | FileCheck %s -check-prefix=STATIC-FP3; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC4; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic -frame-pointer=all < %s | FileCheck %s -check-prefix=PIC-FP5 6; Generated using clang -O0 -emit-llvm -S -target mipsel-unknown-linux -g test.c -o test.ll7; 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 114 15define void @hello_world() #0 !dbg !4 {16entry:17; STATIC: addiu $sp, $sp, -{{[0-9]+}}18; STATIC: sw $ra, {{[0-9]+}}($sp)19; STATIC: .loc 1 2 3 prologue_end20; 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, $sp26; STATIC-FP: .loc 1 2 3 prologue_end27; 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]+|gp]], $[[R0]], $2534; PIC: .loc 1 2 3 prologue_end35; 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, $sp43; PIC-FP: addu $[[R1:[0-9]+|gp]], $[[R0]], $2544; PIC-FP: .loc 1 2 3 prologue_end45; PIC-FP: lw $[[R2:[0-9]+]], %got($.str)($[[R1]])46 47 %call = call i32 (ptr, ...) @printf(ptr @.str), !dbg !1048 ret void, !dbg !1149}50 51declare i32 @printf(ptr, ...)52 53attributes #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: FullDebug, enums: !2)60!1 = !DIFile(filename: "test.c", directory: "/tmp")61!2 = !{}62!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, retainedNodes: !2)63!5 = !DISubroutineType(types: !6)64!6 = !{null}65!7 = !{i32 2, !"Dwarf Version", i32 4}66!8 = !{i32 2, !"Debug Info Version", i32 3}67!9 = !{!"clang version 3.8.0"}68!10 = !DILocation(line: 2, column: 3, scope: !4)69!11 = !DILocation(line: 3, column: 1, scope: !4)70