[mlir][Vector] Fix `vector.shuffle` folder for poison indices (#124863)
[llvm-project.git] / llvm / test / DebugInfo / X86 / subregisters.ll
blob5dc5a8033f1e77523b80806a317692797dc8c5f2
1 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t.o -filetype=obj -O0
2 ; RUN: llvm-dwarfdump -v %t.o | FileCheck %s
4 ; RUN: llc --try-experimental-debuginfo-iterators -mtriple=x86_64-apple-darwin %s -o %t.o -filetype=obj -O0
5 ; RUN: llvm-dwarfdump -v %t.o | FileCheck %s
7 ; Test that on x86_64, the 32-bit subregister esi is emitted as
8 ; subregister of the 64-bit rsi.
10 ; rdar://problem/16015314
12 ; CHECK:  .debug_info contents:
13 ; CHECK:  DW_TAG_variable
14 ; CHECK-NEXT:  DW_AT_location [DW_FORM_data4]   (
15 ; CHECK-NEXT:    [{{.*}}, {{.*}}): DW_OP_reg4 RSI)
16 ; CHECK-NEXT:  DW_AT_name [DW_FORM_strp]{{.*}} "a"
18 ; struct bar {
19 ;   int a;
20 ;   int b;
21 ; };
23 ; void doSomething() __attribute__ ((noinline));
25 ; void doSomething(struct bar *b)
26 ; {
27 ;   int a = b->a;
28 ;   printf("%d\n", a); // set breakpoint here
29 ; }
31 ; int main()
32 ; {
33 ;   struct bar myBar = { 3, 4 };
34 ;   doSomething(&myBar);
35 ;   return 0;
36 ; }
38 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
39 target triple = "x86_64-apple-macosx10.9.0"
41 %struct.bar = type { i32, i32 }
43 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
44 @main.myBar = private unnamed_addr constant %struct.bar { i32 3, i32 4 }, align 4
46 ; Function Attrs: noinline nounwind ssp uwtable
47 define void @doSomething(ptr nocapture readonly %b) #0 !dbg !4 {
48 entry:
49   tail call void @llvm.dbg.value(metadata ptr %b, metadata !15, metadata !DIExpression()), !dbg !25
50   %0 = load i32, ptr %b, align 4, !dbg !26, !tbaa !27
51   tail call void @llvm.dbg.value(metadata i32 %0, metadata !16, metadata !DIExpression()), !dbg !26
52   %call = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %0) #4, !dbg !32
53   ret void, !dbg !33
56 ; Function Attrs: nounwind readnone
57 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
59 ; Function Attrs: nounwind
60 declare i32 @printf(ptr nocapture readonly, ...) #2
62 ; Function Attrs: nounwind ssp uwtable
63 define i32 @main() #3 !dbg !17 {
64 entry:
65   %myBar = alloca i64, align 8, !dbg !34
66   tail call void @llvm.dbg.declare(metadata ptr %myBar, metadata !21, metadata !DIExpression()), !dbg !34
67   store i64 17179869187, ptr %myBar, align 8, !dbg !34
68   call void @doSomething(ptr %myBar), !dbg !35
69   ret i32 0, !dbg !36
72 ; Function Attrs: nounwind readnone
73 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
75 attributes #0 = { noinline nounwind ssp uwtable }
76 attributes #1 = { nounwind readnone }
77 attributes #2 = { nounwind }
78 attributes #3 = { nounwind ssp uwtable }
79 attributes #4 = { nounwind }
81 !llvm.dbg.cu = !{!0}
82 !llvm.module.flags = !{!22, !23}
83 !llvm.ident = !{!24}
85 !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)
86 !1 = !DIFile(filename: "subregisters.c", directory: "")
87 !2 = !{}
88 !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)
89 !5 = !DIFile(filename: "subregisters.c", directory: "")
90 !6 = !DISubroutineType(types: !7)
91 !7 = !{null, !8}
92 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)
93 !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", line: 3, size: 64, align: 32, file: !1, elements: !10)
94 !10 = !{!11, !13}
95 !11 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 4, size: 32, align: 32, file: !1, scope: !9, baseType: !12)
96 !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
97 !13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 5, size: 32, align: 32, offset: 32, file: !1, scope: !9, baseType: !12)
98 !14 = !{!15, !16}
99 !15 = !DILocalVariable(name: "b", line: 10, arg: 1, scope: !4, file: !5, type: !8)
100 !16 = !DILocalVariable(name: "a", line: 12, scope: !4, file: !5, type: !12)
101 !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)
102 !18 = !DISubroutineType(types: !19)
103 !19 = !{!12}
104 !20 = !{!21}
105 !21 = !DILocalVariable(name: "myBar", line: 18, scope: !17, file: !5, type: !9)
106 !22 = !{i32 2, !"Dwarf Version", i32 2}
107 !23 = !{i32 1, !"Debug Info Version", i32 3}
108 !24 = !{!"clang version 3.5 "}
109 !25 = !DILocation(line: 10, scope: !4)
110 !26 = !DILocation(line: 12, scope: !4)
111 !27 = !{!28, !29, i64 0}
112 !28 = !{!"bar", !29, i64 0, !29, i64 4}
113 !29 = !{!"int", !30, i64 0}
114 !30 = !{!"omnipotent char", !31, i64 0}
115 !31 = !{!"Simple C/C++ TBAA"}
116 !32 = !DILocation(line: 13, scope: !4)
117 !33 = !DILocation(line: 14, scope: !4)
118 !34 = !DILocation(line: 18, scope: !17)
119 !35 = !DILocation(line: 19, scope: !17)
120 !36 = !DILocation(line: 20, scope: !17)