brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.6 KiB · 21e54e7 Raw
94 lines · plain
1; RUN: llc -filetype=asm -O0 -mtriple=x86_64-linux-gnu < %s -dwarf-version 2 | FileCheck -check-prefixes=CHECK,ELF-ASM %s2; RUN: llc -filetype=obj -O0 %s -mtriple=x86_64-linux-gnu -o %t-2 -dwarf-version 23; RUN: llvm-dwarfdump -v %t-2 | FileCheck %s -check-prefix=CHECK-DWARF4; RUN: llc -filetype=obj -O0 %s -mtriple=x86_64-linux-gnu -o %t-4 -dwarf-version 25; RUN: llvm-dwarfdump -v %t-4 | FileCheck %s -check-prefix=CHECK-DWARF6 7; RUN: llc -filetype=asm -O0 -mtriple=x86_64-apple-darwin < %s -dwarf-version 2 | FileCheck -check-prefixes=CHECK,DARWIN-ASM2 %s8; RUN: llc -filetype=asm -O0 -mtriple=x86_64-apple-darwin < %s -dwarf-version 4 | FileCheck -check-prefixes=CHECK,DARWIN-ASM4 %s9; RUN: llc -filetype=obj %s -mtriple=x86_64-apple-darwin -o %t2-2 -dwarf-version 210; RUN: llvm-dwarfdump -v %t2-2 | FileCheck %s -check-prefix=CHECK-DWARF11; RUN: llc -filetype=obj %s -mtriple=x86_64-apple-darwin -o %t2-4 -dwarf-version 412; RUN: llvm-dwarfdump -v %t2-4 | FileCheck %s -check-prefix=CHECK-DWARF13 14; RUN: llc -filetype=asm -O0 -mtriple=x86_64-pc-win32 < %s -dwarf-version 2 | FileCheck -check-prefixes=CHECK,COFF-ASM %s15; RUN: llc -filetype=asm -O0 -mtriple=x86_64-pc-win32 < %s -dwarf-version 4 | FileCheck -check-prefixes=CHECK,COFF-ASM %s16; RUN: llc -filetype=obj -O0 %s -mtriple=x86_64-pc-win32 -o %t3-2 -dwarf-version 217; RUN: llvm-dwarfdump -v %t3-2 | FileCheck %s -check-prefix=CHECK-DWARF218; RUN: llc -filetype=obj -O0 %s -mtriple=x86_64-pc-win32 -o %t3-4 -dwarf-version 419; RUN: llvm-dwarfdump -v %t3-4 | FileCheck %s -check-prefix=CHECK-DWARF20 21; Testing case generated from:22; clang++ tu1.cpp tu2.cpp -g -emit-llvm -c23; llvm-link tu1.bc tu2.bc -o tu12.ll -S24; cat hdr.h25; struct foo {26; };27; cat tu1.cpp28; #include "hdr.h"29; foo f;30; cat tu2.cpp31; #include "hdr.h"32; foo g;33 34; Make sure we use relocation for ref_addr on non-darwin platforms.35; CHECK: DW_TAG_compile_unit36; CHECK: DW_TAG_variable37; ELF-ASM: .long [[TYPE:.*]] # DW_AT_type38; DARWIN-ASM2: .long [[TYPE:.*]] ## DW_AT_type39; DARWIN-ASM4: .long [[TYPE:.*]] ## DW_AT_type40; COFF-ASM: .long [[TYPE:.*]] # DW_AT_type41; CHECK: DW_TAG_structure_type42; CHECK: cu_begin143; CHECK: DW_TAG_compile_unit44; CHECK-NOT: DW_TAG_structure_type45; This variable's type is in the 1st CU.46; CHECK: DW_TAG_variable47; Make sure this is relocatable.48; and test that we don't create the labels to emit a correct COFF relocation49; ELF-ASM: .quad .debug_info+[[TYPE]] # DW_AT_type50; COFF-ASM: .secrel32 .debug_info+[[TYPE]] # DW_AT_type51; DARWIN-ASM2: .quad [[TYPE]] ## DW_AT_type52; DARWIN-ASM4: .long [[TYPE]] ## DW_AT_type53; CHECK-NOT: DW_TAG_structure_type54; CHECK: .section55 56; CHECK-DWARF: DW_TAG_compile_unit57; CHECK-DWARF: 0x[[ADDR:.*]]: DW_TAG_structure_type58; CHECK-DWARF: DW_TAG_compile_unit59; CHECK-DWARF: DW_TAG_variable60; CHECK-DWARF: DW_AT_type [DW_FORM_ref_addr] {{.*}}[[ADDR]]61 62; CHECK-DWARF2: DW_TAG_compile_unit63; CHECK-DWARF2: DW_TAG_variable64; CHECK-DWARF2: DW_AT_type [DW_FORM_ref4] {{.*}} => {[[ADDR:.*]]}65; CHECK-DWARF2: [[ADDR]]: DW_TAG_structure_type66 67source_filename = "test/DebugInfo/X86/ref_addr_relocation.ll"68 69%struct.foo = type { i8 }70 71@f = global %struct.foo zeroinitializer, align 1, !dbg !072@g = global %struct.foo zeroinitializer, align 1, !dbg !673 74!llvm.dbg.cu = !{!9, !12}75!llvm.module.flags = !{!14, !15}76 77!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())78!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)79!2 = !DIFile(filename: "tu1.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")80!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !4, line: 1, size: 8, align: 8, elements: !5, identifier: "_ZTS3foo")81!4 = !DIFile(filename: "./hdr.h", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")82!5 = !{}83!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())84!7 = !DIGlobalVariable(name: "g", scope: null, file: !8, line: 2, type: !3, isLocal: false, isDefinition: true)85!8 = !DIFile(filename: "tu2.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr")86!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !10, globals: !11, imports: !5)87!10 = !{!3}88!11 = !{!0}89!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !8, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !10, globals: !13, imports: !5)90!13 = !{!6}91!14 = !{i32 2, !"Dwarf Version", i32 2}92!15 = !{i32 1, !"Debug Info Version", i32 3}93 94