2011-10-28 13:29:47 +08:00
; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=LINUX
; RUN: llc -mtriple=x86_64-darwin < %s | FileCheck %s --check-prefix=DARWIN
2011-10-27 14:44:11 +08:00
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/X86/stringpool.ll"
2011-10-27 14:44:11 +08:00
2016-12-22 08:45:21 +08:00
@yyyy = common global i32 0 , align 4 , !dbg !0
2011-10-27 14:44:11 +08:00
2016-12-22 08:45:21 +08:00
!llvm.dbg.cu = ! { !4 }
!llvm.module.flags = ! { !7 }
2011-10-27 14:44:11 +08:00
2017-08-31 02:06:51 +08:00
!0 = !DIGlobalVariableExpression ( var: !1 , expr: !DIExpression ( ) )
2016-12-22 08:45:21 +08:00
!1 = !DIGlobalVariable ( name: "yyyy" , scope: null , file: !2 , line: 1 , type: !3 , isLocal: false , isDefinition: true )
!2 = !DIFile ( filename: "z.c" , directory: "/home/nicholas" )
!3 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!4 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , file: !2 , producer: "clang version 3.1 (trunk 143009)" , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !5 , retainedTypes: !5 , globals: !6 , imports: !5 )
!5 = ! { }
2013-09-21 07:22:52 +08:00
; Verify that "yyyy" ended up in the stringpool.
; LINUX: .section .debug_str,"MS",@progbits,1
; LINUX: yyyy
; DARWIN: .section __DWARF,__debug_str,regular,debug
2015-05-25 00:14:59 +08:00
; DARWIN: .asciz "yyyy" ## string offset=[[YYYY:[0-9]+]]
2013-09-21 07:22:52 +08:00
2011-10-28 13:29:47 +08:00
; Verify that we refer to 'yyyy' with a relocation.
2012-12-27 10:14:01 +08:00
; LINUX: .long .Linfo_string3 # DW_AT_name
2013-10-29 13:49:41 +08:00
; LINUX-NEXT: .long {{[0-9]+}} # DW_AT_type
2012-08-24 09:14:27 +08:00
; LINUX-NEXT: # DW_AT_external
2011-10-27 14:44:11 +08:00
; LINUX-NEXT: .byte 1 # DW_AT_decl_file
2011-10-28 13:29:47 +08:00
; LINUX-NEXT: .byte 1 # DW_AT_decl_line
2011-10-27 14:44:11 +08:00
; LINUX-NEXT: .byte 9 # DW_AT_location
; LINUX-NEXT: .byte 3
2011-10-28 13:29:47 +08:00
; LINUX-NEXT: .quad yyyy
2011-10-27 14:44:11 +08:00
2015-05-25 00:14:59 +08:00
; Verify that we refer to 'yyyy' with a direct offset.
; DARWIN: .long [[YYYY]]
2013-10-29 13:49:41 +08:00
; DARWIN-NEXT: .long {{[0-9]+}} ## DW_AT_type
2013-09-05 06:21:24 +08:00
; DARWIN-NEXT: ## DW_AT_external
2011-10-27 14:44:11 +08:00
; DARWIN-NEXT: .byte 1 ## DW_AT_decl_file
2011-10-28 13:29:47 +08:00
; DARWIN-NEXT: .byte 1 ## DW_AT_decl_line
2011-10-27 14:44:11 +08:00
; DARWIN-NEXT: .byte 9 ## DW_AT_location
; DARWIN-NEXT: .byte 3
2011-10-28 13:29:47 +08:00
; DARWIN-NEXT: .quad _yyyy
2016-12-22 08:45:21 +08:00
!6 = ! { !0 }
!7 = ! { i32 1 , !"Debug Info Version" , i32 3 }