| 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 -O0 -filetype=obj < %t.ll > %t |
| 8 |
; RUN: llvm-dwarfdump %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 |
|
| 13 |
; Generated from the following source: |
| 14 |
; extern void func_test1(int, int); |
| 15 |
; namespace my_ns |
| 16 |
; { |
| 17 |
; using ::func_test1; |
| 18 |
; } |
| 19 |
; int main () |
| 20 |
; { |
| 21 |
; return 0; |
| 22 |
; } |
| 23 |
|
| 24 |
; Ensure forward routine declarations with an associated using declaration |
| 25 |
; are resolved properly (temporary node would trigger an assert). |
| 26 |
|
| 27 |
; CHECK: DW_TAG_namespace |
| 28 |
; CHECK: DW_AT_name {{.*}}"my_ns" |
| 29 |
; CHECK: DW_TAG_imported_declaration |
| 30 |
; CHECK: NULL |
| 31 |
; CHECK: DW_TAG_subprogram |
| 32 |
; CHECK: DW_AT_name {{.*}}"func_test1" |
| 33 |
; CHECK: NULL |
| 34 |
|
| 35 |
source_filename = "test/DebugInfo/Generic/func-using-decl.ll" |
| 36 |
|
| 37 |
; Function Attrs: noinline norecurse nounwind optnone uwtable |
| 38 |
define dso_local i32 @main() #0 !dbg !14 { |
| 39 |
entry: |
| 40 |
%retval = alloca i32, align 4 |
| 41 |
store i32 0, i32* %retval, align 4 |
| 42 |
ret i32 0, !dbg !17 |
| 43 |
} |
| 44 |
|
| 45 |
attributes #0 = { noinline norecurse nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 46 |
|
| 47 |
!llvm.dbg.cu = !{!0} |
| 48 |
!llvm.module.flags = !{!10, !11, !12} |
| 49 |
!llvm.ident = !{!13} |
| 50 |
|
| 51 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !3, nameTableKind: None) |
| 52 |
!1 = !DIFile(filename: "func-using-decl.cpp", directory: "/tmp") |
| 53 |
!2 = !{} |
| 54 |
!3 = !{!4} |
| 55 |
!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !6, file: !1, line: 4) |
| 56 |
!5 = !DINamespace(name: "my_ns", scope: null) |
| 57 |
!6 = !DISubprogram(name: "func_test1", linkageName: "_Z10func_test1ii", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) |
| 58 |
!7 = !DISubroutineType(types: !8) |
| 59 |
!8 = !{null, !9, !9} |
| 60 |
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 61 |
!10 = !{i32 2, !"Dwarf Version", i32 4} |
| 62 |
!11 = !{i32 2, !"Debug Info Version", i32 3} |
| 63 |
!12 = !{i32 1, !"wchar_size", i32 4} |
| 64 |
!13 = !{!"clang version 8.0.0"} |
| 65 |
!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !15, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) |
| 66 |
!15 = !DISubroutineType(types: !16) |
| 67 |
!16 = !{!9} |
| 68 |
!17 = !DILocation(line: 8, column: 3, scope: !14) |