2011-04-27 19:59:27 +02:00
; RUN: opt -S -simplifycfg < %s | FileCheck %s
; Radar 9342286
; Assign DebugLoc to trap instruction.
2015-11-05 23:03:56 +01:00
define void @foo ( ) nounwind ssp !dbg !0 {
2011-04-27 19:59:27 +02:00
; CHECK: call void @llvm.trap(), !dbg
store i32 42 , i32 * null , !dbg !5
ret void , !dbg !7
}
2013-07-27 03:26:08 +02:00
!llvm.dbg.cu = ! { !2 }
2013-11-22 22:49:45 +01:00
!llvm.module.flags = ! { !10 }
2011-04-27 19:59:27 +02:00
2016-04-15 17:57:41 +02:00
!0 = distinct !DISubprogram ( name: "foo" , line: 3 , isLocal: false , isDefinition: true , virtualIndex: 6 , isOptimized: false , unit: !2 , file: !8 , scope: !1 , type: !3 )
2015-04-29 18:38:44 +02:00
!1 = !DIFile ( filename: "foo.c" , directory: "/private/tmp" )
2016-04-15 17:57:41 +02:00
!2 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "Apple clang version 3.0 (tags/Apple/clang-206.1) (based on LLVM 3.0svn)" , isOptimized: true , emissionKind: F u l l D e b u g , file: !8 , enums: ! { } , retainedTypes: ! { } )
2015-04-29 18:38:44 +02:00
!3 = !DISubroutineType ( types: !4 )
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-15 20:07:53 +01:00
!4 = ! { null }
2015-04-29 18:38:44 +02:00
!5 = !DILocation ( line: 4 , column: 2 , scope: !6 )
!6 = distinct !DILexicalBlock ( line: 3 , column: 12 , file: !8 , scope: !0 )
!7 = !DILocation ( line: 5 , column: 1 , scope: !6 )
!8 = !DIFile ( filename: "foo.c" , directory: "/private/tmp" )
2015-03-03 18:24:31 +01:00
!10 = ! { i32 1 , !"Debug Info Version" , i32 3 }