brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.9 KiB · 39d718a Raw
89 lines · plain
1; RUN: llc %s -o - | FileCheck %s2 3;; Check single location variables of various types with a constant value are4;; emitted with a DW_AT_const_value attribute.5 6;; DW_ATE_complex_float7;; Modified from C source input:8;; #include <complex.h>9;; void f() { double complex r1; }10; CHECK: .Ldebug_info_start0:11; CHECK:      .byte [[#]]                  # Abbrev {{.*}} DW_TAG_variable12; CHECK-NEXT: .byte 0                      # DW_AT_const_value13; CHECK-NEXT: .byte [[r1_str_idx:[0-9]+]]  # DW_AT_name14 15;; DW_ATE_float16;; from (at -Os):17;; void foo() {18;;   float a = 3.14;19;;   *(int *)&a = 0;20;; }21; CHECK:      .byte [[#]]                  # Abbrev {{.*}} DW_TAG_variable22; CHECK-NEXT: .byte 0                      # DW_AT_const_value23; CHECK-NEXT: .byte [[a_str_idx:[0-9]+]]   # DW_AT_name24 25;; DW_ATE_signed (i128)26; CHECK:      .byte [[#]]                  # Abbrev {{.*}} DW_TAG_variable27; CHECK-NEXT: .byte 16                     # DW_AT_const_value28; CHECK-NEXT: .byte 4229; CHECK-COUNT-15: .byte 030; CHECK-NEXT: .byte [[MAX_str_idx:[0-9]+]] # DW_AT_name31 32;; DW_ATE_signed (i32)33; CHECK:      .byte [[#]]                  # Abbrev {{.*}} DW_TAG_variable34; CHECK-NEXT: .byte 42                     # DW_AT_const_value35; CHECK-NEXT: .byte [[i_str_idx:[0-9]+]]   # DW_AT_name36 37; CHECK: .Linfo_string[[r1_str_idx]]:38; CHECK-NEXT: .asciz "r1"39; CHECK: .Linfo_string[[a_str_idx]]:40; CHECK-NEXT: .asciz "a"41; CHECK: .Linfo_string[[MAX_str_idx]]:42; CHECK-NEXT: .asciz "MAX"43; CHECK: .Linfo_string[[i_str_idx]]:44; CHECK-NEXT: .asciz "i"45 46target triple = "x86_64-unknown-linux-gnu"47 48define dso_local void @f() local_unnamed_addr !dbg !10 {49entry:50  ;; DW_ATE_complex_float51  call void @llvm.dbg.value(metadata i8 0, metadata !14, metadata !DIExpression()), !dbg !1752  ;; DW_ATE_float53  call void @llvm.dbg.declare(metadata ptr undef, metadata !20, metadata !DIExpression()), !dbg !1754  call void @llvm.dbg.value(metadata i32 1078523331, metadata !20, metadata !DIExpression()), !dbg !1755  call void @llvm.dbg.value(metadata i32 0, metadata !20, metadata !DIExpression()), !dbg !1756  ;; DW_ATE_signed57  call void @llvm.dbg.value(metadata i128 42 , metadata !22, metadata !DIExpression()), !dbg !1758  ;; DW_ATE_signed59  call void @llvm.dbg.value(metadata i32 42, metadata !25, metadata !DIExpression()), !dbg !1760  ret void, !dbg !1761}62 63declare void @llvm.dbg.value(metadata, metadata, metadata)64declare void @llvm.dbg.declare(metadata, metadata, metadata)65 66!llvm.dbg.cu = !{!0}67!llvm.module.flags = !{!2, !3}68!llvm.ident = !{!9}69 70!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 17.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)71!1 = !DIFile(filename: "test.c", directory: "/")72!2 = !{i32 7, !"Dwarf Version", i32 5}73!3 = !{i32 2, !"Debug Info Version", i32 3}74!9 = !{!"clang version 17.0.0"}75!10 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !11, scopeLine: 2, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13)76!11 = !DISubroutineType(types: !12)77!12 = !{null}78!13 = !{!14}79!14 = !DILocalVariable(name: "r1", scope: !10, file: !1, line: 3, type: !15)80!15 = !DIBasicType(name: "complex", size: 128, encoding: DW_ATE_complex_float)81!17 = !DILocation(line: 0, scope: !10)82!20 = !DILocalVariable(name: "a", scope: !10, file: !1, line: 3, type: !21)83!21 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)84!22 = !DILocalVariable(name: "MAX", line: 29, scope: !10, file: !1, type: !23)85!23 = !DIDerivedType(tag: DW_TAG_typedef, name: "ti_int", line: 78, file: !1, scope: !1, baseType: !24)86!24 = !DIBasicType(tag: DW_TAG_base_type, size: 128, align: 128, encoding: DW_ATE_signed)87!25 = !DILocalVariable(name: "i", line: 2, scope: !10, file: !1, type: !26)88!26 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)89