2015-02-18 19:32:05 +00:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck %s
2014-11-12 20:21:20 +00:00
; This LL file was generated by running clang on the following code:
; D:\src.cpp:
; 1 namespace foo {
; 2 int bar(int x) {
; 3 return x * 2;
; 4 }
; 5 }
; CHECK: ProcStart {
; FIXME: The display name should in fact be "foo::bar", see PR21528
; CHECK-NEXT: DisplayName: ?bar@foo@@YAHH@Z
; CHECK-NEXT: Section: ?bar@foo@@YAHH@Z
; Function Attrs: nounwind
define i32 @"\01?bar@foo@@YAHH@Z" ( i32 %x ) #0 {
entry:
%x.addr = alloca i32 , align 4
store i32 %x , i32 * %x.addr , align 4
2015-02-27 21:17:42 +00:00
%0 = load i32 , i32 * %x.addr , align 4 , !dbg !11
2014-11-12 20:21:20 +00:00
%mul = mul nsw i32 %0 , 2 , !dbg !11
ret i32 %mul , !dbg !11
}
attributes #0 = { nounwind "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "false" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "no-realign-stack" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !8 , !9 }
!llvm.ident = ! { !10 }
2015-08-03 17:26:41 +00:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.6.0 " , isOptimized: false , emissionKind: 2 , file: !1 , enums: !2 , retainedTypes: !2 , subprograms: !3 , globals: !2 , imports: !2 )
2015-04-29 16:38:44 +00:00
!1 = !DIFile ( filename: "<stdin>" , directory: "D:\5C" )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!2 = ! { }
!3 = ! { !4 }
2015-08-28 20:26:49 +00:00
!4 = distinct !DISubprogram ( name: "bar" , line: 2 , isLocal: false , isDefinition: true , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 2 , file: !5 , scope: !6 , type: !7 , function: i32 ( i32 ) * @"\01?bar@foo@@YAHH@Z" , variables: !2 )
2015-04-29 16:38:44 +00:00
!5 = !DIFile ( filename: "src.cpp" , directory: "D:\5C" )
!6 = !DIFile ( filename: "src.cpp" , directory: "D:C" )
!7 = !DISubroutineType ( types: !2 )
2015-08-05 22:26:20 +00:00
!8 = ! { i32 2 , !"CodeView" , i32 1 }
2015-03-03 17:24:31 +00:00
!9 = ! { i32 2 , !"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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!10 = ! { !"clang version 3.6.0 " }
2015-04-29 16:38:44 +00:00
!11 = !DILocation ( line: 3 , scope: !4 )