73 lines · plain
1; RUN: llc -O0 %s -filetype=obj -o %t.o2; RUN: llvm-dwarfdump --verify %t.o3 4; $ cat test.cpp5; int glbl = 42;6; constexpr int &r = glbl;7; constexpr int *p = &glbl;8; template<int &ref>9; int x;10; template<int *ref>11; int y;12; int main() {13; x<r> = 3;14; y<p> = 3;15; }16 17source_filename = "test.cpp"18target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128-Fn32"19target triple = "arm64-apple-macosx15.0.0"20 21@glbl = global i32 42, align 4, !dbg !022@r = constant ptr @glbl, align 8, !dbg !523@_Z1xIL_Z4glblEE = linkonce_odr global i32 0, align 4, !dbg !924@_Z1yIXadL_Z4glblEEE = linkonce_odr global i32 0, align 4, !dbg !1325 26; Function Attrs: mustprogress noinline norecurse nounwind optnone ssp uwtable(sync)27define noundef i32 @main() #0 !dbg !26 {28entry:29 store i32 3, ptr @_Z1xIL_Z4glblEE, align 4, !dbg !2930 store i32 3, ptr @_Z1yIXadL_Z4glblEEE, align 4, !dbg !3031 ret i32 0, !dbg !3132}33 34attributes #0 = { mustprogress noinline norecurse nounwind optnone ssp uwtable(sync) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+complxnum,+crc,+dotprod,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a" }35 36!llvm.module.flags = !{!18, !19, !20, !21, !22, !23, !24}37!llvm.dbg.cu = !{!2}38!llvm.linker.options = !{}39!llvm.ident = !{!25}40 41!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())42!1 = distinct !DIGlobalVariable(name: "glbl", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true)43!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.0.0git (git@github.com:llvm/llvm-project.git cf311a1131b9aef3e66b2a20ad49cfc77212754b)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk", sdk: "MacOSX15.0.sdk")44!3 = !DIFile(filename: "test.cpp", directory: "/tmp", checksumkind: CSK_MD5, checksum: "1aea094a645b8409da5183136c5297f0")45!4 = !{!0, !5, !9, !13}46!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression())47!6 = distinct !DIGlobalVariable(name: "r", scope: !2, file: !3, line: 2, type: !7, isLocal: false, isDefinition: true)48!7 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !8, size: 64)49!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)50!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())51!10 = distinct !DIGlobalVariable(name: "x", linkageName: "_Z1xIL_Z4glblEE", scope: !2, file: !3, line: 5, type: !8, isLocal: false, isDefinition: true, templateParams: !11)52!11 = !{!12}53!12 = !DITemplateValueParameter(name: "ref", type: !7, value: ptr @glbl)54!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression())55!14 = distinct !DIGlobalVariable(name: "y", linkageName: "_Z1yIXadL_Z4glblEEE", scope: !2, file: !3, line: 7, type: !8, isLocal: false, isDefinition: true, templateParams: !15)56!15 = !{!16}57!16 = !DITemplateValueParameter(name: "ref", type: !17, value: ptr @glbl)58!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)59!18 = !{i32 2, !"SDK Version", [2 x i32] [i32 15, i32 0]}60!19 = !{i32 7, !"Dwarf Version", i32 5}61!20 = !{i32 2, !"Debug Info Version", i32 3}62!21 = !{i32 1, !"wchar_size", i32 4}63!22 = !{i32 8, !"PIC Level", i32 2}64!23 = !{i32 7, !"uwtable", i32 1}65!24 = !{i32 7, !"frame-pointer", i32 1}66!25 = !{!"clang version 19.0.0git (git@github.com:llvm/llvm-project.git cf311a1131b9aef3e66b2a20ad49cfc77212754b)"}67!26 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 8, type: !27, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2)68!27 = !DISubroutineType(types: !28)69!28 = !{!8}70!29 = !DILocation(line: 9, column: 8, scope: !26)71!30 = !DILocation(line: 10, column: 8, scope: !26)72!31 = !DILocation(line: 11, column: 1, scope: !26)73