| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 |
| ; RUN: opt -S -codegenprepare -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s |
| |
| ; Make sure salvaging an dbg_declare on inttoptr does not crash. |
| define void @test(i64 %arg) { |
| ; CHECK-LABEL: define void @test( |
| ; CHECK-SAME: i64 [[ARG:%.*]]) { |
| ; CHECK-NEXT: #dbg_declare(i64 [[ARG]], [[META4:![0-9]+]], !DIExpression(), [[META6:![0-9]+]]) |
| ; CHECK-NEXT: ret void |
| ; |
| %inttoptr = inttoptr i64 %arg to ptr |
| #dbg_declare(ptr %inttoptr, !4, !DIExpression(), !6) |
| ret void |
| } |
| |
| !llvm.dbg.cu = !{!0} |
| !llvm.module.flags = !{!3} |
| |
| !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 21.0.0git", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !2, globals: !2, splitDebugInlining: false, nameTableKind: None) |
| !1 = !DIFile(filename: "test.cpp", directory: "/home/npopov/repos/llvm-project", checksumkind: CSK_MD5, checksum: "eabd3d442348430f50ca2f8c28d743e9") |
| !2 = !{} |
| !3 = !{i32 2, !"Debug Info Version", i32 3} |
| !4 = !DILocalVariable(name: "c", scope: !5, file: !1, line: 26) |
| !5 = distinct !DISubprogram(name: "n<(lambda at test.cpp:39:14)>", linkageName: "_ZN1m1nIZN1o1pEvEUl1kE_EE5arrayT_i", scope: null, file: !1, line: 25, spFlags: DISPFlagDefinition, unit: !0) |
| !6 = !DILocation(line: 26, column: 11, scope: !5) |
| ;. |
| ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: [[META2:![0-9]+]], globals: [[META2]], splitDebugInlining: false, nameTableKind: None) |
| ; CHECK: [[META1]] = !DIFile(filename: "test.cpp", directory: {{.*}}) |
| ; CHECK: [[META2]] = !{} |
| ; CHECK: [[META4]] = !DILocalVariable(name: "c", scope: [[META5:![0-9]+]], file: [[META1]], line: 26) |
| ; CHECK: [[META5]] = distinct !DISubprogram(name: "n<(lambda at test.cpp:39:14)>", linkageName: "_ZN1m1nIZN1o1pEvEUl1kE_EE5arrayT_i", scope: null, file: [[META1]], line: 25, spFlags: DISPFlagDefinition, unit: [[META0]]) |
| ; CHECK: [[META6]] = !DILocation(line: 26, column: 11, scope: [[META5]]) |
| ;. |