blob: 52c89eac76f4058dfa019bae12b6fd0718947003 [file] [log] [blame]
David Blaikieee11f222014-04-12 05:35:59 +00001; REQUIRES: object-emission
2
3; RUN: %llc_dwarf -dwarf-version=2 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=V2 %s
4; RUN: %llc_dwarf -dwarf-version=3 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=V3 %s
5
6; CHECK: DW_AT_name {{.*}} "dst"
7; V2: DW_AT_type {{.*}} {[[PTR:0x.*]]}
8; V3: DW_AT_type {{.*}} {[[RESTRICT:0x.*]]}
9; V3: [[RESTRICT]]: {{.*}}DW_TAG_restrict_type
10; V3-NEXT: DW_AT_type {{.*}} {[[PTR:0x.*]]}
11; CHECK: [[PTR]]: {{.*}}DW_TAG_pointer_type
12; CHECK-NOT: DW_AT_type
13
14; Generated with clang from:
15; void foo(void* __restrict__ dst) {
16; }
17
18
19; Function Attrs: nounwind uwtable
20define void @_Z3fooPv(i8* noalias %dst) #0 {
21entry:
22 %dst.addr = alloca i8*, align 8
23 store i8* %dst, i8** %dst.addr, align 8
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000024 call void @llvm.dbg.declare(metadata i8** %dst.addr, metadata !13, metadata !{!"0x102"}), !dbg !14
David Blaikieee11f222014-04-12 05:35:59 +000025 ret void, !dbg !15
26}
27
28; Function Attrs: nounwind readnone
Adrian Prantl87b7eb92014-10-01 18:55:02 +000029declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
David Blaikieee11f222014-04-12 05:35:59 +000030
31attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
32attributes #1 = { nounwind readnone }
33
34!llvm.dbg.cu = !{!0}
35!llvm.module.flags = !{!10, !11}
36!llvm.ident = !{!12}
37
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000038!0 = !{!"0x11\004\00clang version 3.5.0 \000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/restrict.c] [DW_LANG_C_plus_plus]
39!1 = !{!"restrict.c", !"/tmp/dbginfo"}
40!2 = !{}
41!3 = !{!4}
42!4 = !{!"0x2e\00foo\00foo\00_Z3fooPv\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i8*)* @_Z3fooPv, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
43!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/tmp/dbginfo/restrict.c]
44!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
45!7 = !{null, !8}
46!8 = !{!"0x37\00\000\000\000\000\000", null, null, !9} ; [ DW_TAG_restrict_type ] [line 0, size 0, align 0, offset 0] [from ]
47!9 = !{!"0xf\00\000\0064\0064\000\000", null, null, null} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
48!10 = !{i32 2, !"Dwarf Version", i32 4}
49!11 = !{i32 1, !"Debug Info Version", i32 2}
50!12 = !{!"clang version 3.5.0 "}
51!13 = !{!"0x101\00dst\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [dst] [line 1]
52!14 = !{i32 1, i32 0, !4, null}
53!15 = !{i32 2, i32 0, !4, null}