brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · ca61770 Raw
79 lines · plain
1; RUN: llc -filetype=asm -asm-verbose=0 -arm-atomic-cfg-tidy=0 < %s | FileCheck %s2 3; int main()4; {5;     int x = 0;6;     if (x > 0)7;         return x;8;     x = -1; // <== this line should have correct debug location9;     return -1;10; }11 12target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"13target triple = "armv7--linux-gnueabihf"14 15; Function Attrs: nounwind16define i32 @main() !dbg !4 {17entry:18  %retval = alloca i32, align 419  %x = alloca i32, align 420  store i32 0, ptr %retval21  call void @llvm.dbg.declare(metadata ptr %x, metadata !10, metadata !11), !dbg !1222  store i32 0, ptr %x, align 4, !dbg !1223  %0 = load i32, ptr %x, align 4, !dbg !1324  %cmp = icmp sgt i32 %0, 0, !dbg !1525  br i1 %cmp, label %if.then, label %if.end, !dbg !1626 27if.then:                                          ; preds = %entry28  %1 = load i32, ptr %x, align 4, !dbg !1729  store i32 %1, ptr %retval, !dbg !1830  br label %return, !dbg !1831 32if.end:                                           ; preds = %entry33; Materialize the constant.34; CHECK:      .loc    1 035; CHECK-NEXT: mvn     r0, #036 37; The backend performs the store to %retval first, for some reason.38; CHECK-NEXT: .loc    1 7 539; CHECK-NEXT: str     r0, [sp, #4]40  store i32 -1, ptr %x, align 4, !dbg !1941 42; CHECK-NEXT: .loc    1 6 743; CHECK-NEXT: str     r0, [sp]44  store i32 -1, ptr %retval, !dbg !2045  br label %return, !dbg !2046 47return:                                           ; preds = %if.end, %if.then48  %2 = load i32, ptr %retval, !dbg !2149  ret i32 %2, !dbg !2150}51 52; Function Attrs: nounwind readnone53declare void @llvm.dbg.declare(metadata, metadata, metadata)54 55!llvm.dbg.cu = !{!0}56!llvm.module.flags = !{!8, !9}57 58!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, emissionKind: FullDebug)59!1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")60!2 = !{}61!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)62!5 = !DISubroutineType(types: !6)63!6 = !{!7}64!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)65!8 = !{i32 2, !"Dwarf Version", i32 4}66!9 = !{i32 2, !"Debug Info Version", i32 3}67!10 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !7)68!11 = !DIExpression()69!12 = !DILocation(line: 3, column: 9, scope: !4)70!13 = !DILocation(line: 4, column: 9, scope: !14)71!14 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 9)72!15 = !DILocation(line: 4, column: 11, scope: !14)73!16 = !DILocation(line: 4, column: 9, scope: !4)74!17 = !DILocation(line: 5, column: 13, scope: !14)75!18 = !DILocation(line: 5, column: 9, scope: !14)76!19 = !DILocation(line: 6, column: 7, scope: !4)77!20 = !DILocation(line: 7, column: 5, scope: !4)78!21 = !DILocation(line: 8, column: 1, scope: !4)79