2014-08-29 17:00:26 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj < %s \
|
2017-09-12 07:05:20 +08:00
|
|
|
; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V4
|
2014-08-29 17:00:26 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj -dwarf-version=3 < %s \
|
2017-09-12 07:05:20 +08:00
|
|
|
; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V3
|
2012-03-28 02:35:57 +08:00
|
|
|
|
2014-08-29 17:00:26 +08:00
|
|
|
|
|
|
|
; Check that we use DW_AT_low_pc and that it has the right encoding depending
|
|
|
|
; on dwarf version.
|
2012-03-28 02:35:57 +08:00
|
|
|
|
|
|
|
; CHECK: DW_TAG_compile_unit [1]
|
2014-08-29 23:32:15 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2012-03-28 02:35:57 +08:00
|
|
|
; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
|
2014-08-29 23:32:15 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2014-08-29 17:00:26 +08:00
|
|
|
; CHECK-V3: DW_AT_high_pc [DW_FORM_addr]
|
|
|
|
; CHECK-V4: DW_AT_high_pc [DW_FORM_data4]
|
2012-03-28 02:35:57 +08:00
|
|
|
; CHECK: DW_TAG_subprogram [2]
|
2014-08-29 23:32:15 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2014-03-21 03:16:16 +08:00
|
|
|
; CHECK: DW_AT_low_pc [DW_FORM_addr]
|
2014-08-29 23:32:15 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2014-08-29 17:00:26 +08:00
|
|
|
; CHECK-V3: DW_AT_high_pc [DW_FORM_addr]
|
|
|
|
; CHECK-V4: DW_AT_high_pc [DW_FORM_data4]
|
2012-03-28 02:35:57 +08:00
|
|
|
|
2014-03-21 03:16:16 +08:00
|
|
|
; Function Attrs: nounwind uwtable
|
2015-11-06 06:03:56 +08:00
|
|
|
define void @z() #0 !dbg !4 {
|
2012-03-28 02:35:57 +08:00
|
|
|
entry:
|
2014-03-21 03:16:16 +08:00
|
|
|
ret void, !dbg !11
|
2012-03-28 02:35:57 +08:00
|
|
|
}
|
|
|
|
|
2014-03-21 03:16:16 +08:00
|
|
|
attributes #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" }
|
|
|
|
|
2012-03-28 02:35:57 +08:00
|
|
|
!llvm.dbg.cu = !{!0}
|
2014-03-21 03:16:16 +08:00
|
|
|
!llvm.module.flags = !{!8, !9}
|
|
|
|
!llvm.ident = !{!10}
|
2012-03-28 02:35:57 +08:00
|
|
|
|
2016-04-15 23:57:41 +08:00
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
|
2015-04-30 00:38:44 +08:00
|
|
|
!1 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo")
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!2 = !{}
|
2016-04-15 23:57:41 +08:00
|
|
|
!4 = distinct !DISubprogram(name: "z", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
|
2015-04-30 00:38:44 +08:00
|
|
|
!5 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo")
|
|
|
|
!6 = !DISubroutineType(types: !7)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!7 = !{null}
|
|
|
|
!8 = !{i32 2, !"Dwarf Version", i32 4}
|
2015-03-04 01:24:31 +08:00
|
|
|
!9 = !{i32 1, !"Debug Info Version", i32 3}
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!10 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"}
|
2015-04-30 00:38:44 +08:00
|
|
|
!11 = !DILocation(line: 1, scope: !4)
|