Adrian Prantl | 608df02 | 2017-08-30 20:51:20 +0000 | [diff] [blame] | 1 | ; RUN: llc -filetype=asm %s -o - | FileCheck %s |
| 2 | ; Test large integral function arguments passed in multiple registers. |
| 3 | ; |
| 4 | ; Generated from (-Os): |
| 5 | ; |
| 6 | ; signed long long g; |
| 7 | ; void write(signed long long offset); |
| 8 | ; signed long long foo(signed long long offset) { |
| 9 | ; if (offset != g) |
| 10 | ; write(offset); |
| 11 | ; return offset; |
| 12 | ; } |
| 13 | source_filename = "test.ii" |
| 14 | target datalayout = "e-m:o-p:32:32-i64:64-a:0:32-n32-S128" |
| 15 | target triple = "thumbv7k-apple-watchos2.0.0" |
| 16 | |
| 17 | @g = local_unnamed_addr global i64 0, align 8, !dbg !0 |
| 18 | |
| 19 | ; Function Attrs: optsize ssp |
| 20 | define i64 @_Z3foox(i64 returned) local_unnamed_addr #0 !dbg !13 { |
| 21 | tail call void @llvm.dbg.value(metadata i64 %0, metadata !17, metadata !DIExpression()), !dbg !18 |
Puyan Lotfi | 43e94b1 | 2018-01-31 22:04:26 +0000 | [diff] [blame] | 22 | ; CHECK: @DEBUG_VALUE: foo:offset <- [DW_OP_LLVM_fragment 0 32] $r5 |
| 23 | ; CHECK: @DEBUG_VALUE: foo:offset <- [DW_OP_LLVM_fragment 32 32] $r4 |
Adrian Prantl | 608df02 | 2017-08-30 20:51:20 +0000 | [diff] [blame] | 24 | |
| 25 | %2 = load i64, i64* @g, align 8, !dbg !19, !tbaa !21 |
| 26 | %3 = icmp eq i64 %2, %0, !dbg !19 |
| 27 | br i1 %3, label %5, label %4, !dbg !25 |
| 28 | |
| 29 | ; <label>:4: ; preds = %1 |
| 30 | tail call void @_Z5writex(i64 %0) #3, !dbg !26 |
| 31 | br label %5, !dbg !26 |
| 32 | |
| 33 | ; <label>:5: ; preds = %1, %4 |
| 34 | ret i64 %0, !dbg !27 |
| 35 | } |
| 36 | |
| 37 | ; Function Attrs: optsize |
| 38 | declare void @_Z5writex(i64) local_unnamed_addr #1 |
| 39 | |
| 40 | ; Function Attrs: nounwind readnone speculatable |
| 41 | declare void @llvm.dbg.value(metadata, metadata, metadata) #2 |
| 42 | |
| 43 | attributes #0 = { optsize ssp } |
| 44 | attributes #1 = { optsize } |
| 45 | attributes #2 = { nounwind readnone speculatable } |
| 46 | attributes #3 = { optsize } |
| 47 | |
| 48 | !llvm.dbg.cu = !{!2} |
| 49 | !llvm.module.flags = !{!7, !8, !9, !10, !11} |
| 50 | |
| 51 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 52 | !1 = distinct !DIGlobalVariable(name: "g", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) |
| 53 | !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 6.0.0 (trunk 312148) (llvm/trunk 312165)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 54 | !3 = !DIFile(filename: "test.ii", directory: "/") |
| 55 | !4 = !{} |
| 56 | !5 = !{!0} |
| 57 | !6 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed) |
| 58 | !7 = !{i32 2, !"Dwarf Version", i32 4} |
| 59 | !8 = !{i32 2, !"Debug Info Version", i32 3} |
| 60 | !9 = !{i32 1, !"wchar_size", i32 4} |
| 61 | !10 = !{i32 1, !"min_enum_size", i32 4} |
| 62 | !11 = !{i32 7, !"PIC Level", i32 2} |
| 63 | !13 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foox", scope: !3, file: !3, line: 3, type: !14, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !16) |
| 64 | !14 = !DISubroutineType(types: !15) |
| 65 | !15 = !{!6, !6} |
| 66 | !16 = !{!17} |
| 67 | !17 = !DILocalVariable(name: "offset", arg: 1, scope: !13, file: !3, line: 3, type: !6) |
| 68 | !18 = !DILocation(line: 3, scope: !13) |
| 69 | !19 = !DILocation(line: 4, scope: !20) |
| 70 | !20 = distinct !DILexicalBlock(scope: !13, file: !3, line: 4) |
| 71 | !21 = !{!22, !22, i64 0} |
| 72 | !22 = !{!"long long", !23, i64 0} |
| 73 | !23 = !{!"omnipotent char", !24, i64 0} |
| 74 | !24 = !{!"Simple C++ TBAA"} |
| 75 | !25 = !DILocation(line: 4, scope: !13) |
| 76 | !26 = !DILocation(line: 5, scope: !20) |
| 77 | !27 = !DILocation(line: 6, scope: !13) |