brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.3 KiB · d240d61 Raw
123 lines · plain
1; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s --check-prefix=ASM2 3; Make sure variables come out in the right order. windbg builds the prototype4; from the order of these records.5 6; C++ source to regenerate:7; $ cat t.cpp8; int f(int a, int b, int c) {9;   int d = 4;10;   int e = 5;11;   return a + b + c + d + e;12; }13; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll14 15; ASM: .short  4414                    # Record kind: S_LOCAL16; ASM: .long   116                     # TypeIndex17; ASM: .short  1                       # Flags18; ASM: .asciz  "a"19; ASM: .cv_def_range20 21; ASM: .short  4414                    # Record kind: S_LOCAL22; ASM: .long   116                     # TypeIndex23; ASM: .short  1                       # Flags24; ASM: .asciz  "b"25; ASM: .cv_def_range26 27; ASM: .short  4414                    # Record kind: S_LOCAL28; ASM: .long   116                     # TypeIndex29; ASM: .short  1                       # Flags30; ASM: .asciz  "c"31; ASM: .cv_def_range32 33; ASM: .short  4414                    # Record kind: S_LOCAL34; ASM: .long   116                     # TypeIndex35; ASM: .short  0                       # Flags36; ASM: .asciz  "d"37; ASM: .cv_def_range38 39; ASM: .short  4414                    # Record kind: S_LOCAL40; ASM: .long   116                     # TypeIndex41; ASM: .short  0                       # Flags42; ASM: .asciz  "e"43; ASM: .cv_def_range44 45 46; ModuleID = 't.cpp'47source_filename = "t.cpp"48target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"49target triple = "x86_64-pc-windows-msvc19.0.23918"50 51; Function Attrs: nounwind uwtable52define i32 @"\01?f@@YAHHHH@Z"(i32 %a, i32 %b, i32 %c) #0 !dbg !7 {53entry:54  %c.addr = alloca i32, align 455  %b.addr = alloca i32, align 456  %a.addr = alloca i32, align 457  %d = alloca i32, align 458  %e = alloca i32, align 459  store i32 %c, ptr %c.addr, align 460  call void @llvm.dbg.declare(metadata ptr %c.addr, metadata !11, metadata !12), !dbg !1361  store i32 %b, ptr %b.addr, align 462  call void @llvm.dbg.declare(metadata ptr %b.addr, metadata !14, metadata !12), !dbg !1563  store i32 %a, ptr %a.addr, align 464  call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !16, metadata !12), !dbg !1765  call void @llvm.dbg.declare(metadata ptr %d, metadata !18, metadata !12), !dbg !1966  store i32 4, ptr %d, align 4, !dbg !1967  call void @llvm.dbg.declare(metadata ptr %e, metadata !20, metadata !12), !dbg !2168  store i32 5, ptr %e, align 4, !dbg !2169  %0 = load i32, ptr %a.addr, align 4, !dbg !2270  %1 = load i32, ptr %b.addr, align 4, !dbg !2371  %add = add nsw i32 %0, %1, !dbg !2472  %2 = load i32, ptr %c.addr, align 4, !dbg !2573  %add1 = add nsw i32 %add, %2, !dbg !2674  %3 = load i32, ptr %d, align 4, !dbg !2775  %add2 = add nsw i32 %add1, %3, !dbg !2876  %4 = load i32, ptr %e, align 4, !dbg !2977  %add3 = add nsw i32 %add2, %4, !dbg !3078  ret i32 %add3, !dbg !3179}80 81; Function Attrs: nounwind readnone82declare void @llvm.dbg.declare(metadata, metadata, metadata) #183 84attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }85attributes #1 = { nounwind readnone }86 87!llvm.dbg.cu = !{!0}88!llvm.module.flags = !{!3, !4, !5}89!llvm.ident = !{!6}90 91!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 273683) (llvm/trunk 273691)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)92!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")93!2 = !{}94!3 = !{i32 2, !"CodeView", i32 1}95!4 = !{i32 2, !"Debug Info Version", i32 3}96!5 = !{i32 1, !"PIC Level", i32 2}97!6 = !{!"clang version 3.9.0 (trunk 273683) (llvm/trunk 273691)"}98!7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAHHHH@Z", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)99!8 = !DISubroutineType(types: !9)100!9 = !{!10, !10, !10, !10}101!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)102!11 = !DILocalVariable(name: "c", arg: 3, scope: !7, file: !1, line: 1, type: !10)103!12 = !DIExpression()104!13 = !DILocation(line: 1, column: 25, scope: !7)105!14 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 1, type: !10)106!15 = !DILocation(line: 1, column: 18, scope: !7)107!16 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 1, type: !10)108!17 = !DILocation(line: 1, column: 11, scope: !7)109!18 = !DILocalVariable(name: "d", scope: !7, file: !1, line: 2, type: !10)110!19 = !DILocation(line: 2, column: 7, scope: !7)111!20 = !DILocalVariable(name: "e", scope: !7, file: !1, line: 3, type: !10)112!21 = !DILocation(line: 3, column: 7, scope: !7)113!22 = !DILocation(line: 4, column: 10, scope: !7)114!23 = !DILocation(line: 4, column: 14, scope: !7)115!24 = !DILocation(line: 4, column: 12, scope: !7)116!25 = !DILocation(line: 4, column: 18, scope: !7)117!26 = !DILocation(line: 4, column: 16, scope: !7)118!27 = !DILocation(line: 4, column: 22, scope: !7)119!28 = !DILocation(line: 4, column: 20, scope: !7)120!29 = !DILocation(line: 4, column: 26, scope: !7)121!30 = !DILocation(line: 4, column: 24, scope: !7)122!31 = !DILocation(line: 4, column: 3, scope: !7)123