brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · 4e279ab Raw
118 lines · plain
1; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t.o -filetype=obj -O02; RUN: llvm-dwarfdump -v %t.o | FileCheck %s3;4; Test that on x86_64, the 32-bit subregister esi is emitted as5; subregister of the 64-bit rsi.6;7; rdar://problem/160153148;9; CHECK:  .debug_info contents:10; CHECK:  DW_TAG_variable11; CHECK-NEXT:  DW_AT_location [DW_FORM_data4]	(12; CHECK-NEXT:    [{{.*}}, {{.*}}): DW_OP_reg4 RSI)13; CHECK-NEXT:  DW_AT_name [DW_FORM_strp]{{.*}} "a"14;15; struct bar {16;   int a;17;   int b;18; };19;20; void doSomething() __attribute__ ((noinline));21;22; void doSomething(struct bar *b)23; {24;   int a = b->a;25;   printf("%d\n", a); // set breakpoint here26; }27;28; int main()29; {30;   struct bar myBar = { 3, 4 };31;   doSomething(&myBar);32;   return 0;33; }34 35target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"36target triple = "x86_64-apple-macosx10.9.0"37 38%struct.bar = type { i32, i32 }39 40@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 141@main.myBar = private unnamed_addr constant %struct.bar { i32 3, i32 4 }, align 442 43; Function Attrs: noinline nounwind ssp uwtable44define void @doSomething(ptr nocapture readonly %b) #0 !dbg !4 {45entry:46  tail call void @llvm.dbg.value(metadata ptr %b, metadata !15, metadata !DIExpression()), !dbg !2547  %0 = load i32, ptr %b, align 4, !dbg !26, !tbaa !2748  tail call void @llvm.dbg.value(metadata i32 %0, metadata !16, metadata !DIExpression()), !dbg !2649  %call = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %0) #4, !dbg !3250  ret void, !dbg !3351}52 53; Function Attrs: nounwind readnone54declare void @llvm.dbg.declare(metadata, metadata, metadata) #155 56; Function Attrs: nounwind57declare i32 @printf(ptr nocapture readonly, ...) #258 59; Function Attrs: nounwind ssp uwtable60define i32 @main() #3 !dbg !17 {61entry:62  %myBar = alloca i64, align 8, !dbg !3463  tail call void @llvm.dbg.declare(metadata ptr %myBar, metadata !21, metadata !DIExpression()), !dbg !3464  store i64 17179869187, ptr %myBar, align 8, !dbg !3465  call void @doSomething(ptr %myBar), !dbg !3566  ret i32 0, !dbg !3667}68 69; Function Attrs: nounwind readnone70declare void @llvm.dbg.value(metadata, metadata, metadata) #171 72attributes #0 = { noinline nounwind ssp uwtable }73attributes #1 = { nounwind readnone }74attributes #2 = { nounwind }75attributes #3 = { nounwind ssp uwtable }76attributes #4 = { nounwind }77 78!llvm.dbg.cu = !{!0}79!llvm.module.flags = !{!22, !23}80!llvm.ident = !{!24}81 82!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)83!1 = !DIFile(filename: "subregisters.c", directory: "")84!2 = !{}85!4 = distinct !DISubprogram(name: "doSomething", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 11, file: !1, scope: !5, type: !6, retainedNodes: !14)86!5 = !DIFile(filename: "subregisters.c", directory: "")87!6 = !DISubroutineType(types: !7)88!7 = !{null, !8}89!8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)90!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", line: 3, size: 64, align: 32, file: !1, elements: !10)91!10 = !{!11, !13}92!11 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 4, size: 32, align: 32, file: !1, scope: !9, baseType: !12)93!12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)94!13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 5, size: 32, align: 32, offset: 32, file: !1, scope: !9, baseType: !12)95!14 = !{!15, !16}96!15 = !DILocalVariable(name: "b", line: 10, arg: 1, scope: !4, file: !5, type: !8)97!16 = !DILocalVariable(name: "a", line: 12, scope: !4, file: !5, type: !12)98!17 = distinct !DISubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 17, file: !1, scope: !5, type: !18, retainedNodes: !20)99!18 = !DISubroutineType(types: !19)100!19 = !{!12}101!20 = !{!21}102!21 = !DILocalVariable(name: "myBar", line: 18, scope: !17, file: !5, type: !9)103!22 = !{i32 2, !"Dwarf Version", i32 2}104!23 = !{i32 1, !"Debug Info Version", i32 3}105!24 = !{!"clang version 3.5 "}106!25 = !DILocation(line: 10, scope: !4)107!26 = !DILocation(line: 12, scope: !4)108!27 = !{!28, !29, i64 0}109!28 = !{!"bar", !29, i64 0, !29, i64 4}110!29 = !{!"int", !30, i64 0}111!30 = !{!"omnipotent char", !31, i64 0}112!31 = !{!"Simple C/C++ TBAA"}113!32 = !DILocation(line: 13, scope: !4)114!33 = !DILocation(line: 14, scope: !4)115!34 = !DILocation(line: 18, scope: !17)116!35 = !DILocation(line: 19, scope: !17)117!36 = !DILocation(line: 20, scope: !17)118