1; Verify target-based defaults for "debugger tuning," and the ability to 2; override defaults. 3; We use the DW_AT_APPLE_optimized attribute and the DW_OP_form_tls_address 4; vs. DW_OP_GNU_push_tls_address opcodes to distinguish the debuggers. 5 6; Verify defaults for various targets. 7; RUN: llc -mtriple=x86_64-scei-ps4 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=SCE %s 8; RUN: llc -mtriple=x86_64-sie-ps5 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=SCE %s 9; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=LLDB %s 10; RUN: llc -mtriple=x86_64-pc-freebsd -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=GDB %s 11; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=GDB %s 12 13; We can override defaults. 14; RUN: llc -mtriple=x86_64-scei-ps4 -filetype=obj -debugger-tune=gdb < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=GDB %s 15; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=LLDB %s 16; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=sce < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=SCE %s 17 18; GDB-NOT: DW_AT_APPLE_optimized 19; GDB-NOT: DW_OP_form_tls_address 20 21; LLDB: DW_AT_APPLE_optimized 22; LLDB: DW_OP_form_tls_address 23 24; SCE-NOT: DW_AT_APPLE_optimized 25; SCE-NOT: DW_OP_GNU_push_tls_address 26 27@var = thread_local global i32 0, align 4, !dbg !0 28 29; Function Attrs: norecurse nounwind readnone uwtable 30define void @_Z3funv() local_unnamed_addr #0 !dbg !11 { 31 ret void, !dbg !14 32} 33 34; Function Attrs: norecurse uwtable 35define weak_odr hidden ptr @_ZTW3var() local_unnamed_addr #1 { 36 ret ptr @var 37} 38 39attributes #0 = { norecurse nounwind readnone uwtable } 40attributes #1 = { norecurse uwtable } 41 42!llvm.dbg.cu = !{!2} 43!llvm.module.flags = !{!7, !8, !9} 44!llvm.ident = !{!10} 45 46!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 47!1 = distinct !DIGlobalVariable(name: "var", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true) 48!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 322268) (llvm/trunk 322267)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) 49!3 = !DIFile(filename: "debugger-tune.cpp", directory: "/tmp") 50!4 = !{} 51!5 = !{!0} 52!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 53!7 = !{i32 2, !"Dwarf Version", i32 4} 54!8 = !{i32 2, !"Debug Info Version", i32 3} 55!9 = !{i32 1, !"wchar_size", i32 4} 56!10 = !{!"clang version 7.0.0 (trunk 322268) (llvm/trunk 322267)"} 57!11 = distinct !DISubprogram(name: "fun", linkageName: "_Z3funv", scope: !3, file: !3, line: 2, type: !12, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !4) 58!12 = !DISubroutineType(types: !13) 59!13 = !{null} 60!14 = !DILocation(line: 2, column: 13, scope: !11) 61 62