| 1 |
; REQUIRES: object-emission |
| 2 |
|
| 3 |
; RUN: llvm-as < %s -o %t.bc |
| 4 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 5 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll |
| 6 |
|
| 7 |
; RUN: llc -mtriple=%triple -filetype=obj -O0 < %t.ll > %t |
| 8 |
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s |
| 9 |
|
| 10 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 11 |
target triple = "spir64-unknown-unknown" |
| 12 |
; CHECK: DW_TAG_ptr_to_member_type |
| 13 |
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]} |
| 14 |
; CHECK: [[TYPE]]: DW_TAG_base_type |
| 15 |
; IR generated from clang -g with the following source: |
| 16 |
; struct Foo { |
| 17 |
; int e; |
| 18 |
; }; |
| 19 |
; int Foo:*x = 0; |
| 20 |
|
| 21 |
source_filename = "test/DebugInfo/Generic/tu-member-pointer.ll" |
| 22 |
|
| 23 |
@x = global i64 -1, align 8, !dbg !0 |
| 24 |
|
| 25 |
!llvm.dbg.cu = !{!6} |
| 26 |
!llvm.module.flags = !{!10, !11} |
| 27 |
|
| 28 |
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 29 |
!1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true) |
| 30 |
!2 = !DIFile(filename: "foo.cpp", directory: ".") |
| 31 |
!3 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !4, extraData: !5) |
| 32 |
!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 33 |
!5 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !2, line: 1, flags: DIFlagFwdDecl, identifier: "_ZTS3Foo") |
| 34 |
!6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !7, retainedTypes: !8, globals: !9, imports: !7) |
| 35 |
!7 = !{} |
| 36 |
!8 = !{!5} |
| 37 |
!9 = !{!0} |
| 38 |
!10 = !{i32 2, !"Dwarf Version", i32 2} |
| 39 |
!11 = !{i32 1, !"Debug Info Version", i32 3} |
| 40 |
|