1; Ensures that the compiler doesn't assert when DWARF aranges are enabled in the presence of 2; `available_externally` constants. 3 4; Generated from the following C++ source: 5; 6; template <typename T> 7; struct Baz { 8; static constexpr int boo = int(-1); 9; }; 10; 11; extern template struct Baz<char>; 12; 13; void bar(const int& a); 14; 15; void foo() { 16; bar(Baz<char>::boo); 17; } 18; 19; Compiled with: 20; 21; $ clang -cc1 -triple=x86_64-unknown-linux-gnu -debug-info-kind=standalone \ 22; -mllvm -generate-arange-section -std=c++17 foo.cpp 23 24; RUN: llc --generate-arange-section < %s 25 26; ModuleID = 'reduced2.cpp' 27source_filename = "reduced2.cpp" 28target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 29target triple = "x86_64-unknown-linux-gnu" 30 31@_ZN3BazIcE3booE = available_externally constant i32 -1, align 4, !dbg !0 32 33; Function Attrs: mustprogress noinline nounwind optnone 34define dso_local void @_Z3foov() #0 !dbg !17 { 35entry: 36 call void @_Z3barRKi(ptr noundef nonnull align 4 dereferenceable(4) @_ZN3BazIcE3booE), !dbg !21 37 ret void, !dbg !22 38} 39 40declare void @_Z3barRKi(ptr noundef nonnull align 4 dereferenceable(4)) #1 41 42attributes #0 = { mustprogress noinline nounwind optnone "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 43attributes #1 = { "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 44 45!llvm.dbg.cu = !{!2} 46!llvm.module.flags = !{!14, !15} 47!llvm.ident = !{!16} 48 49!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 50!1 = distinct !DIGlobalVariable(name: "boo", linkageName: "_ZN3BazIcE3booE", scope: !2, file: !5, line: 3, type: !6, isLocal: false, isDefinition: true, declaration: !8) 51!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 15.0.0 (https://github.com/llvm/llvm-project.git 2f52a868225755ebfa5242992d3a650ac6aadce7)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None) 52!3 = !DIFile(filename: "<stdin>", directory: "/Users/pcwalton/Downloads") 53!4 = !{!0} 54!5 = !DIFile(filename: "reduced2.cpp", directory: "/Users/pcwalton/Downloads") 55!6 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !7) 56!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 57!8 = !DIDerivedType(tag: DW_TAG_member, name: "boo", scope: !9, file: !5, line: 3, baseType: !6, flags: DIFlagStaticMember, extraData: i32 -1) 58!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Baz<char>", file: !5, line: 6, size: 8, flags: DIFlagTypePassByValue, elements: !10, templateParams: !11, identifier: "_ZTS3BazIcE") 59!10 = !{!8} 60!11 = !{!12} 61!12 = !DITemplateTypeParameter(name: "T", type: !13) 62!13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) 63!14 = !{i32 2, !"Debug Info Version", i32 3} 64!15 = !{i32 1, !"wchar_size", i32 4} 65!16 = !{!"clang version 15.0.0 (https://github.com/llvm/llvm-project.git 2f52a868225755ebfa5242992d3a650ac6aadce7)"} 66!17 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !5, file: !5, line: 10, type: !18, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !20) 67!18 = !DISubroutineType(types: !19) 68!19 = !{null} 69!20 = !{} 70!21 = !DILocation(line: 11, column: 3, scope: !17) 71!22 = !DILocation(line: 12, column: 1, scope: !17) 72