2015-02-03 02:31:58 +08:00
; RUN: llc < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
; from (at -Os):
; void foo() {
; float a = 3.14;
; *(int *)&a = 0;
; }
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
; Function Attrs: nounwind optsize readnone uwtable
2015-11-06 06:03:56 +08:00
define void @foo ( ) #0 !dbg !7 {
2015-02-03 02:31:58 +08:00
entry:
tail call void @llvm.dbg.declare ( metadata float * undef , metadata !13 , metadata !19 ) , !dbg !20
tail call void @llvm.dbg.value ( metadata i32 1078523331 , i64 0 , metadata !13 , metadata !19 ) , !dbg !20
tail call void @llvm.dbg.value ( metadata i32 0 , i64 0 , metadata !13 , metadata !19 ) , !dbg !20
; CHECK: DW_AT_const_value [DW_FORM_sdata] (0)
; CHECK-NEXT: DW_AT_name {{.*}}"a"
ret void , !dbg !21
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value ( metadata , i64 , metadata , metadata ) #1
attributes #0 = { nounwind optsize readnone uwtable }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !15 , !16 , !17 }
!llvm.ident = ! { !18 }
2016-04-15 23:57:41 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.7.0 (trunk 227686)" , isOptimized: true , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !3 , globals: !2 , imports: !2 )
2015-04-30 00:38:44 +08:00
!1 = !DIFile ( filename: "foo.c" , directory: "" )
2015-02-03 02:31:58 +08:00
!2 = ! { }
!3 = ! { !4 }
2015-04-30 00:38:44 +08:00
!4 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !5 )
!5 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
2016-04-15 23:57:41 +08:00
!7 = distinct !DISubprogram ( name: "foo" , line: 1 , isLocal: false , isDefinition: true , isOptimized: true , unit: !0 , scopeLine: 1 , file: !8 , scope: !9 , type: !10 , variables: !12 )
2015-04-30 00:38:44 +08:00
!8 = !DIFile ( filename: "foo.c" , directory: "" )
!9 = !DIFile ( filename: "foo.c" , directory: "" )
!10 = !DISubroutineType ( types: !11 )
2015-02-03 02:31:58 +08:00
!11 = ! { null }
!12 = ! { !13 }
2015-08-01 02:58:39 +08:00
!13 = !DILocalVariable ( name: "a" , line: 2 , scope: !7 , file: !9 , type: !14 )
2015-04-30 00:38:44 +08:00
!14 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "float" , size: 32 , align: 32 , encoding: D W _ A T E _ float )
2015-02-03 02:31:58 +08:00
!15 = ! { i32 2 , !"Dwarf Version" , i32 2 }
2015-03-04 01:24:31 +08:00
!16 = ! { i32 2 , !"Debug Info Version" , i32 3 }
2015-02-03 02:31:58 +08:00
!17 = ! { i32 1 , !"PIC Level" , i32 2 }
!18 = ! { !"clang version 3.7.0 (trunk 227686)" }
2015-04-30 00:38:44 +08:00
!19 = !DIExpression ( )
!20 = !DILocation ( line: 2 , column: 9 , scope: !7 )
!21 = !DILocation ( line: 4 , column: 1 , scope: !7 )