|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2024 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; Test generates DWARF with class enum (adds DW_AT_enum_class field) |
| 10 | + |
| 11 | +; REQUIRES: regkeys, oneapi-readelf, llvm-14-plus |
| 12 | + |
| 13 | +; RUN: llvm-as %s -o %t |
| 14 | +; RUN: ocloc compile -llvm_input -file %t -device dg2 -options "-g -cl-opt-disable -igc_opts 'ElfDumpEnable=1, DumpUseShorterName=0, DebugDumpNamePrefix=%t_'" |
| 15 | +; RUN: oneapi-readelf --debug-dump %t_OCL_simd32_foo.elf | FileCheck %s |
| 16 | + |
| 17 | +; CHECK: DW_TAG_enumeration_type |
| 18 | +; CHECK: DW_AT_type : {{.*}} |
| 19 | +; CHECK: DW_AT_enum_class : {{.*}} |
| 20 | +; CHECK: DW_AT_name : {{.*}} |
| 21 | +; CHECK: DW_AT_byte_size : {{.*}} |
| 22 | + |
| 23 | +@a = addrspace(1) global i64 0, align 8, !dbg !0 |
| 24 | + |
| 25 | +; Function Attrs: nounwind |
| 26 | +define spir_kernel void @foo() #0 !dbg !17 { |
| 27 | +entry: |
| 28 | + %b = alloca i32, align 4 |
| 29 | + call void @llvm.dbg.value(metadata i32* %b, metadata !20, metadata !22), !dbg !23 |
| 30 | + store i32 0, i32* %b, align 4, !dbg !23 |
| 31 | + ret void, !dbg !24 |
| 32 | +} |
| 33 | + |
| 34 | +; Function Attrs: nounwind readnone |
| 35 | +declare void @llvm.dbg.value(metadata, metadata, metadata) #1 |
| 36 | + |
| 37 | +attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 38 | +attributes #1 = { nounwind readnone } |
| 39 | + |
| 40 | +!llvm.dbg.cu = !{!8} |
| 41 | +!llvm.module.flags = !{!15, !16} |
| 42 | + |
| 43 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 44 | +!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true) |
| 45 | +!2 = !DIFile(filename: "enum.cpp", directory: "/tmp") |
| 46 | +!3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "x", file: !2, line: 1, size: 64, align: 64, baseType: !21, flags: DIFlagEnumClass, elements: !4) |
| 47 | +!4 = !{!5, !6, !7} |
| 48 | +!5 = !DIEnumerator(name: "A", value: 0) |
| 49 | +!6 = !DIEnumerator(name: "B", value: 20) |
| 50 | +!7 = !DIEnumerator(name: "C", value: 60) |
| 51 | +!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 14.0.5", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, globals: !14) |
| 52 | +!9 = !{!3, !10} |
| 53 | +!10 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "y", file: !2, line: 2, size: 32, align: 32, baseType: !21, flags: DIFlagEnumClass, elements: !11) |
| 54 | +!11 = !{!12} |
| 55 | +!12 = !DIEnumerator(name: "D", value: 0) |
| 56 | +!13 = !{} |
| 57 | +!14 = !{!0} |
| 58 | +!15 = !{i32 2, !"Dwarf Version", i32 4} |
| 59 | +!16 = !{i32 1, !"Debug Info Version", i32 3} |
| 60 | +!17 = distinct !DISubprogram(name: "foo", scope: !2, file: !2, line: 3, type: !18, flags: DIFlagPrototyped, unit: !8, retainedNodes: !13) |
| 61 | +!18 = !DISubroutineType(types: !19) |
| 62 | +!19 = !{null} |
| 63 | +!20 = !DILocalVariable(name: "b", scope: !17, file: !2, line: 4, type: !21) |
| 64 | +!21 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 65 | +!22 = !DIExpression() |
| 66 | +!23 = !DILocation(line: 4, scope: !17) |
| 67 | +!24 = !DILocation(line: 5, scope: !17) |
0 commit comments