brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 9399eb7 Raw
80 lines · plain
1; xfail this test on hexagon because at O2, instructions are bundled in packets2; and DW_OP_lit13 is correctly omitted.3; XFAIL: target=hexagon-{{.*}}4 5; RUN: %llc_dwarf -O2  -dwarf-version 2 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s  --check-prefix=DWARF236; RUN: %llc_dwarf -O2  -dwarf-version 3 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s  --check-prefix=DWARF237; RUN: %llc_dwarf -O2  -dwarf-version 4 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s  --check-prefix=DWARF48 9; This is a test for PR21176.10; DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.11; The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.12; For values < 32 we emit the canonical DW_OP_lit<const>.13 14; Generated with clang -S -emit-llvm -g -O2 test.cpp15 16; extern int func();17;18; int main()19; {20;   volatile int c = 13;21;   c = func();22;   return c;23; }24 25; CHECK: DW_TAG_variable26; CHECK: DW_AT_location27; CHECK-NOT: DW_AT28; DWARF23: DW_OP_lit13{{$}}29; DWARF4: DW_OP_lit13, DW_OP_stack_value{{$}}30 31; Function Attrs: uwtable32define i32 @main() #0 !dbg !4 {33entry:34  %c = alloca i32, align 435  tail call void @llvm.dbg.value(metadata i32 13, metadata !10, metadata !16), !dbg !1736  store volatile i32 13, ptr %c, align 4, !dbg !1837  %call = tail call i32 @_Z4funcv(), !dbg !1938  tail call void @llvm.dbg.value(metadata i32 %call, metadata !10, metadata !16), !dbg !1739  store volatile i32 %call, ptr %c, align 4, !dbg !1940  tail call void @llvm.dbg.value(metadata ptr %c, metadata !10, metadata !21), !dbg !1741  %c.0.c.0. = load volatile i32, ptr %c, align 4, !dbg !2042  ret i32 %c.0.c.0., !dbg !2043}44 45declare i32 @_Z4funcv() #146 47; Function Attrs: nounwind readnone48declare void @llvm.dbg.value(metadata, metadata, metadata) #249 50attributes #0 = { uwtable "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }51attributes #1 = { "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }52attributes #2 = { nounwind readnone }53 54!llvm.dbg.cu = !{!0}55!llvm.module.flags = !{!12, !13}56!llvm.ident = !{!14}57 58!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 223522)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)59!1 = !DIFile(filename: "test.cpp", directory: "/home/kromanova/ngh/ToT_latest/llvm/test/DebugInfo")60!2 = !{}61!4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 4, file: !1, scope: !5, type: !6, retainedNodes: !9)62!5 = !DIFile(filename: "test.cpp", directory: "/home/kromanova/ngh/ToT_latest/llvm/test/DebugInfo")63!6 = !DISubroutineType(types: !7)64!7 = !{!8}65!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)66!9 = !{!10}67!10 = !DILocalVariable(name: "c", line: 5, scope: !4, file: !5, type: !11)68!11 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !8)69!12 = !{i32 2, !"Dwarf Version", i32 2}70!13 = !{i32 2, !"Debug Info Version", i32 3}71!14 = !{!"clang version 3.6.0 (trunk 223522)"}72!15 = !{i32 13}73!16 = !DIExpression()74!17 = !DILocation(line: 5, column: 16, scope: !4)75!18 = !DILocation(line: 5, column: 3, scope: !4)76!19 = !DILocation(line: 6, column: 7, scope: !4)77!20 = !DILocation(line: 7, column: 3, scope: !4)78!21 = !DIExpression(DW_OP_deref)79 80