|
| 1 | +; RUN: llc -O0 %s -filetype=obj -o %t.o |
| 2 | +; RUN: llvm-dwarfdump --verify %t.o |
| 3 | + |
| 4 | +; $ cat ptr.cpp |
| 5 | +; int glbl = 42; |
| 6 | +; constexpr int *r = &glbl; |
| 7 | +; template<int *ref> |
| 8 | +; int x; |
| 9 | +; int main() { |
| 10 | +; x<r> = 3; |
| 11 | +; } |
| 12 | + |
| 13 | +source_filename = "ptr.cpp" |
| 14 | +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128-Fn32" |
| 15 | +target triple = "arm64-apple-macosx15.0.0" |
| 16 | + |
| 17 | +@glbl = global i32 42, align 4, !dbg !0 |
| 18 | +@r = constant ptr @glbl, align 8, !dbg !5 |
| 19 | +@_Z1xIL_Z4glblEE = linkonce_odr global i32 0, align 4, !dbg !9 |
| 20 | + |
| 21 | +; Function Attrs: mustprogress noinline norecurse nounwind optnone ssp uwtable(sync) |
| 22 | +define noundef i32 @main() #0 !dbg !21 { |
| 23 | +entry: |
| 24 | + store i32 3, ptr @_Z1xIL_Z4glblEE, align 4, !dbg !24 |
| 25 | + ret i32 0, !dbg !25 |
| 26 | +} |
| 27 | + |
| 28 | +attributes #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,+complxnum,+crc,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz" } |
| 29 | + |
| 30 | +!llvm.module.flags = !{!14, !15, !16, !17, !18, !19} |
| 31 | +!llvm.dbg.cu = !{!2} |
| 32 | +!llvm.linker.options = !{} |
| 33 | +!llvm.ident = !{!20} |
| 34 | + |
| 35 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 36 | +!1 = distinct !DIGlobalVariable(name: "glbl", scope: !2, file: !3, line: 1, type: !8, isLocal: false, isDefinition: true) |
| 37 | +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.0.0git", 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") |
| 38 | +!3 = !DIFile(filename: "ptr.cpp", directory: "/tmp", checksumkind: CSK_MD5, checksum: "b7b99c5692b757c3b50d0e841713927c") |
| 39 | +!4 = !{!0, !5, !9} |
| 40 | +!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression()) |
| 41 | +!6 = distinct !DIGlobalVariable(name: "r", scope: !2, file: !3, line: 2, type: !7, isLocal: false, isDefinition: true) |
| 42 | +!7 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !8, size: 64) |
| 43 | +!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 44 | +!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression()) |
| 45 | +!10 = distinct !DIGlobalVariable(name: "x", linkageName: "_Z1xIL_Z4glblEE", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true, templateParams: !11) |
| 46 | +!11 = !{!12} |
| 47 | +!12 = !DITemplateValueParameter(name: "ref", type: !7, value: ptr @glbl) |
| 48 | +!14 = !{i32 7, !"Dwarf Version", i32 5} |
| 49 | +!15 = !{i32 2, !"Debug Info Version", i32 3} |
| 50 | +!16 = !{i32 1, !"wchar_size", i32 4} |
| 51 | +!17 = !{i32 8, !"PIC Level", i32 2} |
| 52 | +!18 = !{i32 7, !"uwtable", i32 1} |
| 53 | +!19 = !{i32 7, !"frame-pointer", i32 1} |
| 54 | +!20 = !{! "clang version 19.0.0git ([email protected]:llvm/llvm-project.git 5d15f606da4cb4346465956d935a2842f8e86200)"} |
| 55 | +!21 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 5, type: !22, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2) |
| 56 | +!22 = !DISubroutineType(types: !23) |
| 57 | +!23 = !{!8} |
| 58 | +!24 = !DILocation(line: 6, column: 8, scope: !21) |
| 59 | +!25 = !DILocation(line: 7, column: 1, scope: !21) |
0 commit comments