brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.6 KiB · 8642785 Raw
115 lines · plain
1; RUN: llc < %s -filetype=obj | llvm-dwarfdump -v -debug-info - | FileCheck %s2; RUN: llc < %s -filetype=obj -regalloc=basic | llvm-dwarfdump -v -debug-info -  | FileCheck %s3target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"4target triple = "x86_64-apple-darwin10.0.0"5 6; Check debug info for variable z_s7; CHECK: DW_TAG_subprogram8; CHECK: DW_TAG_subprogram9; CHECK: DW_TAG_variable10; CHECK: DW_TAG_variable11; CHECK-NEXT:   DW_AT_location12; CHECK-NOT: DW_{{TAG|AT}}13; CHECK:   DW_AT_name {{.*}} "z_s"14; CHECK-NEXT:   DW_AT_decl_file15; CHECK-NEXT:   DW_AT_decl_line16; CHECK-NEXT:   DW_AT_type{{.*}}{[[TYPE:.*]]}17; CHECK: [[TYPE]]:18; CHECK-NEXT: DW_AT_name {{.*}} "int"19 20 21@.str1 = private unnamed_addr constant [14 x i8] c"m=%u, z_s=%d\0A\00"22@str = internal constant [21 x i8] c"Failing test vector:\00"23 24define i64 @gcd(i64 %a, i64 %b) nounwind readnone optsize noinline ssp !dbg !0 {25entry:26  tail call void @llvm.dbg.value(metadata i64 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !1827  tail call void @llvm.dbg.value(metadata i64 %b, i64 0, metadata !11, metadata !DIExpression()), !dbg !1928  br label %while.body, !dbg !2029 30while.body:                                       ; preds = %while.body, %entry31  %b.addr.0 = phi i64 [ %b, %entry ], [ %rem, %while.body ]32  %a.addr.0 = phi i64 [ %a, %entry ], [ %b.addr.0, %while.body ]33  %rem = srem i64 %a.addr.0, %b.addr.0, !dbg !2134  %cmp = icmp eq i64 %rem, 0, !dbg !2335  br i1 %cmp, label %if.then, label %while.body, !dbg !2336 37if.then:                                          ; preds = %while.body38  tail call void @llvm.dbg.value(metadata i64 %rem, i64 0, metadata !12, metadata !DIExpression()), !dbg !2139  ret i64 %b.addr.0, !dbg !2340}41 42define i32 @main() nounwind optsize ssp !dbg !6 {43entry:44  %call = tail call i32 @rand() nounwind optsize, !dbg !2445  tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !14, metadata !DIExpression()), !dbg !2446  %cmp = icmp ugt i32 %call, 21, !dbg !2547  br i1 %cmp, label %cond.true, label %cond.end, !dbg !2548 49cond.true:                                        ; preds = %entry50  %call1 = tail call i32 @rand() nounwind optsize, !dbg !2551  br label %cond.end, !dbg !2552 53cond.end:                                         ; preds = %entry, %cond.true54  %cond = phi i32 [ %call1, %cond.true ], [ %call, %entry ], !dbg !2555  tail call void @llvm.dbg.value(metadata i32 %cond, i64 0, metadata !17, metadata !DIExpression()), !dbg !2556  %conv = sext i32 %cond to i64, !dbg !2657  %conv5 = zext i32 %call to i64, !dbg !2658  %call6 = tail call i64 @gcd(i64 %conv, i64 %conv5) optsize, !dbg !2659  %cmp7 = icmp eq i64 %call6, 060  br i1 %cmp7, label %return, label %if.then, !dbg !2661 62if.then:                                          ; preds = %cond.end63  %puts = tail call i32 @puts(ptr @str)64  %call12 = tail call i32 (ptr, ...) @printf(ptr @.str1, i32 %call, i32 %cond) nounwind optsize, !dbg !2665  ret i32 1, !dbg !2766 67return:                                           ; preds = %cond.end68  ret i32 0, !dbg !2769}70 71declare i32 @rand() optsize72 73declare i32 @printf(ptr nocapture, ...) nounwind optsize74 75declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone76 77declare i32 @puts(ptr nocapture) nounwind78 79!llvm.dbg.cu = !{!2}80!llvm.module.flags = !{!33}81 82!0 = distinct !DISubprogram(name: "gcd", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !31, scope: !1, type: !3, retainedNodes: !29)83!1 = !DIFile(filename: "rem_small.c", directory: "/private/tmp")84!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124117)", isOptimized: true, emissionKind: FullDebug, file: !31, enums: !32, retainedTypes: !32, imports:  null)85!3 = !DISubroutineType(types: !4)86!4 = !{!5}87!5 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)88!6 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, file: !31, scope: !1, type: !7, retainedNodes: !30)89!7 = !DISubroutineType(types: !8)90!8 = !{!9}91!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)92!10 = !DILocalVariable(name: "a", line: 5, arg: 1, scope: !0, file: !1, type: !5)93!11 = !DILocalVariable(name: "b", line: 5, arg: 2, scope: !0, file: !1, type: !5)94!12 = !DILocalVariable(name: "c", line: 6, scope: !13, file: !1, type: !5)95!13 = distinct !DILexicalBlock(line: 5, column: 52, file: !31, scope: !0)96!14 = !DILocalVariable(name: "m", line: 26, scope: !15, file: !1, type: !16)97!15 = distinct !DILexicalBlock(line: 25, column: 12, file: !31, scope: !6)98!16 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)99!17 = !DILocalVariable(name: "z_s", line: 27, scope: !15, file: !1, type: !9)100!18 = !DILocation(line: 5, column: 41, scope: !0)101!19 = !DILocation(line: 5, column: 49, scope: !0)102!20 = !DILocation(line: 7, column: 5, scope: !13)103!21 = !DILocation(line: 8, column: 9, scope: !22)104!22 = distinct !DILexicalBlock(line: 7, column: 14, file: !31, scope: !13)105!23 = !DILocation(line: 9, column: 9, scope: !22)106!24 = !DILocation(line: 26, column: 38, scope: !15)107!25 = !DILocation(line: 27, column: 38, scope: !15)108!26 = !DILocation(line: 28, column: 9, scope: !15)109!27 = !DILocation(line: 30, column: 1, scope: !15)110!29 = !{!10, !11, !12}111!30 = !{!14, !17}112!31 = !DIFile(filename: "rem_small.c", directory: "/private/tmp")113!32 = !{}114!33 = !{i32 1, !"Debug Info Version", i32 3}115