Reid Kleckner | 9c65821 | 2014-04-10 22:58:43 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs -filetype=asm | FileCheck %s -check-prefix=ARM-linux |
| 2 | ; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -filetype=obj |
Oliver Stannard | b14c625 | 2014-04-02 16:10:33 +0000 | [diff] [blame] | 3 | |
| 4 | !llvm.dbg.cu = !{!0} |
| 5 | !llvm.module.flags = !{!9, !10} |
| 6 | !llvm.ident = !{!11} |
| 7 | |
Reid Kleckner | 9c65821 | 2014-04-10 22:58:43 +0000 | [diff] [blame] | 8 | define void @test_basic() #0 { |
Oliver Stannard | b14c625 | 2014-04-02 16:10:33 +0000 | [diff] [blame] | 9 | %mem = alloca i32, i32 10 |
| 10 | call void @dummy_use (i32* %mem, i32 10) |
| 11 | ret void |
| 12 | |
| 13 | ; ARM-linux: test_basic: |
| 14 | |
| 15 | ; ARM-linux: push {r4, r5} |
| 16 | ; ARM-linux: .cfi_def_cfa_offset 8 |
| 17 | ; ARM-linux: .cfi_offset r5, -4 |
| 18 | ; ARM-linux: .cfi_offset r4, -8 |
| 19 | ; ARM-linux-NEXT: mrc p15, #0, r4, c13, c0, #3 |
| 20 | ; ARM-linux-NEXT: mov r5, sp |
| 21 | ; ARM-linux-NEXT: ldr r4, [r4, #4] |
| 22 | ; ARM-linux-NEXT: cmp r4, r5 |
| 23 | ; ARM-linux-NEXT: blo .LBB0_2 |
| 24 | |
| 25 | ; ARM-linux: mov r4, #48 |
| 26 | ; ARM-linux-NEXT: mov r5, #0 |
| 27 | ; ARM-linux-NEXT: stmdb sp!, {lr} |
| 28 | ; ARM-linux: .cfi_def_cfa_offset 12 |
| 29 | ; ARM-linux: .cfi_offset lr, -12 |
| 30 | ; ARM-linux-NEXT: bl __morestack |
| 31 | ; ARM-linux-NEXT: ldm sp!, {lr} |
| 32 | ; ARM-linux-NEXT: pop {r4, r5} |
| 33 | ; ARM-linux: .cfi_def_cfa_offset 0 |
| 34 | ; ARM-linux-NEXT: bx lr |
| 35 | |
| 36 | ; ARM-linux: pop {r4, r5} |
| 37 | ; ARM-linux: .cfi_def_cfa_offset 0 |
| 38 | ; ARM-linux .cfi_same_value r4 |
| 39 | ; ARM-linux .cfi_same_value r5 |
| 40 | } |
| 41 | |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame^] | 42 | !0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
| 43 | !1 = !DIFile(filename: "var.c", directory: "/tmp") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 44 | !2 = !{} |
| 45 | !3 = !{!4} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame^] | 46 | !4 = !DISubprogram(name: "test_basic", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: void ()* @test_basic, variables: !2) |
| 47 | !5 = !DIFile(filename: "var.c", directory: "/tmp") |
| 48 | !6 = !DISubroutineType(types: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 49 | !7 = !{!8, !8} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame^] | 50 | !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 51 | !9 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 52 | !10 = !{i32 1, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 53 | !11 = !{!"clang version 3.5 "} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame^] | 54 | !12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "count", line: 5, arg: 1, scope: !4, file: !5, type: !8) |
| 55 | !13 = !DILocation(line: 5, scope: !4) |
| 56 | !14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "vl", line: 6, scope: !4, file: !5, type: !15) |
| 57 | !15 = !DIDerivedType(tag: DW_TAG_typedef, name: "va_list", line: 30, file: !16, baseType: !17) |
| 58 | !16 = !DIFile(filename: "/linux-x86_64-high/gcc_4.7.2/dbg/llvm/bin/../lib/clang/3.5/include/stdarg.h", directory: "/tmp") |
| 59 | !17 = !DIDerivedType(tag: DW_TAG_typedef, name: "__builtin_va_list", line: 6, file: !1, baseType: !18) |
| 60 | !18 = !DICompositeType(tag: DW_TAG_structure_type, name: "__va_list", line: 6, size: 32, align: 32, file: !1, elements: !19) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 61 | !19 = !{!20} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame^] | 62 | !20 = !DIDerivedType(tag: DW_TAG_member, name: "__ap", line: 6, size: 32, align: 32, file: !1, scope: !18, baseType: !21) |
| 63 | !21 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: null) |
| 64 | !22 = !DILocation(line: 6, scope: !4) |
| 65 | !23 = !DILocation(line: 7, scope: !4) |
| 66 | !24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "test_basic", line: 8, scope: !4, file: !5, type: !8) |
| 67 | !25 = !DILocation(line: 8, scope: !4) |
| 68 | !26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 9, scope: !27, file: !5, type: !8) |
| 69 | !27 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !4) |
| 70 | !28 = !DILocation(line: 9, scope: !27) |
| 71 | !29 = !DILocation(line: 10, scope: !30) |
| 72 | !30 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !27) |
| 73 | !31 = !DILocation(line: 11, scope: !30) |
| 74 | !32 = !DILocation(line: 12, scope: !4) |
| 75 | !33 = !DILocation(line: 13, scope: !4) |
Oliver Stannard | b14c625 | 2014-04-02 16:10:33 +0000 | [diff] [blame] | 76 | |
| 77 | ; Just to prevent the alloca from being optimized away |
| 78 | declare void @dummy_use(i32*, i32) |
Reid Kleckner | 9c65821 | 2014-04-10 22:58:43 +0000 | [diff] [blame] | 79 | |
| 80 | attributes #0 = { "split-stack" } |