brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.6 KiB · 950594e Raw
144 lines · plain
1; RUN: llc < %s -mtriple=arm64-windows -filetype=obj -aarch64-enable-atomic-cfg-tidy=0 | llvm-readobj --codeview - | FileCheck %s --check-prefix=OBJ2 3; Generated from:4; volatile int x;5; int getint(void);6; void putint(int);7; static inline int inlineinc(int a) {8;   int b = a + 1;9;   ++x;10;   return b;11; }12; void f(int p) {13;   if (p) {14;     int a = getint();15;     int b = inlineinc(a);16;     putint(b);17;   } else {18;     int c = getint();19;     putint(c);20;   }21; }22 23 24; OBJ:   DefRangeRegisterRelSym {25; OBJ:     Kind: S_DEFRANGE_REGISTER_REL (0x1145)26; OBJ:     BaseRegister: ARM64_SP (0x51)27; OBJ:     HasSpilledUDTMember: No28; OBJ:     OffsetInParent: 029; OBJ:     BasePointerOffset: 1230; OBJ:     LocalVariableAddrRange {31; OBJ:       OffsetStart: .text+0x1432; OBJ:       ISectStart: 0x033; OBJ:       Range: 0x3034; OBJ:     }35; OBJ:   }36 37; ModuleID = 't.cpp'38source_filename = "test/DebugInfo/COFF/register-variables-arm64.ll"39target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"40target triple = "arm64-unknown-windows-msvc19.16.27023"41 42@x = common dso_local global i32 0, align 4, !dbg !043 44define dso_local void @f(i32 %p) !dbg !11 {45entry:46  %p.addr = alloca i32, align 447  %a = alloca i32, align 448  %b = alloca i32, align 449  %c = alloca i32, align 450  store i32 %p, ptr %p.addr, align 451    #dbg_declare(ptr %p.addr, !14, !DIExpression(), !15)52  %0 = load i32, ptr %p.addr, align 4, !dbg !1653  %tobool = icmp ne i32 %0, 0, !dbg !1654  %call = call i32 @getint(), !dbg !1755  br i1 %tobool, label %if.then, label %if.else, !dbg !1656 57if.then:                                          ; preds = %entry58    #dbg_declare(ptr %a, !19, !DIExpression(), !21)59  store i32 %call, ptr %a, align 4, !dbg !2160    #dbg_declare(ptr %b, !22, !DIExpression(), !23)61  %1 = load i32, ptr %a, align 4, !dbg !2362  %call1 = call i32 @inlineinc(i32 %1), !dbg !2363  store i32 %call1, ptr %b, align 4, !dbg !2364  %2 = load i32, ptr %b, align 4, !dbg !2465  br label %if.end, !dbg !2566 67if.else:                                          ; preds = %entry68    #dbg_declare(ptr %c, !26, !DIExpression(), !28)69  store i32 %call, ptr %c, align 4, !dbg !2870  %3 = load i32, ptr %c, align 4, !dbg !2971  br label %if.end, !dbg !3072 73if.end:                                           ; preds = %if.else, %if.then74  %.sink = phi i32 [ %3, %if.else ], [ %2, %if.then ]75  call void @putint(i32 %.sink), !dbg !1776  ret void, !dbg !3177}78 79declare dso_local i32 @getint()80 81define internal i32 @inlineinc(i32 %a) !dbg !32 {82entry:83  %a.addr = alloca i32, align 484  %b = alloca i32, align 485  store i32 %a, ptr %a.addr, align 486    #dbg_declare(ptr %a.addr, !35, !DIExpression(), !36)87    #dbg_declare(ptr %b, !37, !DIExpression(), !38)88  %0 = load i32, ptr %a.addr, align 4, !dbg !3889  %add = add nsw i32 %0, 1, !dbg !3890  store i32 %add, ptr %b, align 4, !dbg !3891  %1 = load volatile i32, ptr @x, align 4, !dbg !3992  %inc = add nsw i32 %1, 1, !dbg !3993  store volatile i32 %inc, ptr @x, align 4, !dbg !3994  %2 = load i32, ptr %b, align 4, !dbg !4095  ret i32 %2, !dbg !4096}97 98declare dso_local void @putint(i32)99 100!llvm.dbg.cu = !{!2}101!llvm.module.flags = !{!8, !9, !10}102 103!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())104!1 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)105!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 9.0.0 (trunk 361867) (llvm/trunk 361866)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)106!3 = !DIFile(filename: "t.c", directory: "S:\\LLVM\\svn\\sbr\\bin", checksumkind: CSK_MD5, checksum: "734c448e95a6204a439a847ed063e5ce")107!4 = !{}108!5 = !{!0}109!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)110!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)111!8 = !{i32 2, !"CodeView", i32 1}112!9 = !{i32 2, !"Debug Info Version", i32 3}113!10 = !{i32 1, !"wchar_size", i32 2}114!11 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 9, type: !12, scopeLine: 9, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)115!12 = !DISubroutineType(types: !13)116!13 = !{null, !7}117!14 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !7)118!15 = !DILocation(line: 9, scope: !11)119!16 = !DILocation(line: 10, scope: !11)120!17 = !DILocation(line: 0, scope: !18)121!18 = distinct !DILexicalBlock(scope: !11, file: !3, line: 10)122!19 = !DILocalVariable(name: "a", scope: !20, file: !3, line: 11, type: !7)123!20 = distinct !DILexicalBlock(scope: !18, file: !3, line: 10)124!21 = !DILocation(line: 11, scope: !20)125!22 = !DILocalVariable(name: "b", scope: !20, file: !3, line: 12, type: !7)126!23 = !DILocation(line: 12, scope: !20)127!24 = !DILocation(line: 13, scope: !20)128!25 = !DILocation(line: 14, scope: !20)129!26 = !DILocalVariable(name: "c", scope: !27, file: !3, line: 15, type: !7)130!27 = distinct !DILexicalBlock(scope: !18, file: !3, line: 14)131!28 = !DILocation(line: 15, scope: !27)132!29 = !DILocation(line: 16, scope: !27)133!30 = !DILocation(line: 17, scope: !27)134!31 = !DILocation(line: 18, scope: !11)135!32 = distinct !DISubprogram(name: "inlineinc", scope: !3, file: !3, line: 4, type: !33, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !4)136!33 = !DISubroutineType(types: !34)137!34 = !{!7, !7}138!35 = !DILocalVariable(name: "a", arg: 1, scope: !32, file: !3, line: 4, type: !7)139!36 = !DILocation(line: 4, scope: !32)140!37 = !DILocalVariable(name: "b", scope: !32, file: !3, line: 5, type: !7)141!38 = !DILocation(line: 5, scope: !32)142!39 = !DILocation(line: 6, scope: !32)143!40 = !DILocation(line: 7, scope: !32)144