| 1 |
# UNSUPPORTED: system-windows |
| 2 |
# This test is unsupported on windows because it creates paths |
| 3 |
# longer than MAX_PATH |
| 4 |
|
| 5 |
# Recreate the folder structure in a temp directory we can remove later. |
| 6 |
RUN: rm -rf %t |
| 7 |
RUN: mkdir -p %t/Inputs %t/tempdir |
| 8 |
RUN: cp %p/../Inputs/basic.macho.x86_64 %t/Inputs |
| 9 |
RUN: cp %p/../Inputs/basic1.macho.x86_64.o %t/Inputs |
| 10 |
RUN: cp %p/../Inputs/basic2.macho.x86_64.o %t/Inputs |
| 11 |
RUN: cp %p/../Inputs/basic3.macho.x86_64.o %t/Inputs |
| 12 |
|
| 13 |
# Verify all the files are present. |
| 14 |
RUN: dsymutil -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s |
| 15 |
|
| 16 |
# Make sure we don't crash with an empty TMPDIR. |
| 17 |
RUN: env TMPDIR="" dsymutil -o -f -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 |
| 18 |
|
| 19 |
# Make sure we don't leave around a temporary directory. |
| 20 |
RUN: env TMPDIR="%t/tempdir" dsymutil -o - -f %t/Inputs/basic.macho.x86_64 |
| 21 |
RUN: not ls %t/tempdir/dsymutil-* |
| 22 |
|
| 23 |
# Create a reproducer. |
| 24 |
RUN: rm -rf %t.repro |
| 25 |
RUN: env DSYMUTIL_REPRODUCER_PATH=%t.repro dsymutil -gen-reproducer -f -o %t.generate -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefixes=REPRODUCER |
| 26 |
RUN: llvm-dwarfdump -a %t.generate | FileCheck %s |
| 27 |
|
| 28 |
RUN: rm -rf %t.diags |
| 29 |
RUN: env LLVM_DIAGNOSTIC_DIR=%t.diags dsymutil -gen-reproducer -f -o %t.generate -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefixes=REPRODUCER |
| 30 |
RUN: ls %t.diags | grep 'dsymutil-' | count 1 |
| 31 |
|
| 32 |
# Remove the input files and verify that was successful. |
| 33 |
RUN: rm -rf %t |
| 34 |
RUN: not dsymutil -f -o %t.error -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=ERROR |
| 35 |
|
| 36 |
RUN: not dsymutil --linker parallel -f -o %t.error -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=ERROR |
| 37 |
|
| 38 |
# Use the reproducer. |
| 39 |
RUN: dsymutil -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s |
| 40 |
RUN: dsymutil --linker parallel -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s |
| 41 |
|
| 42 |
# Using a reproducer takes precedence. |
| 43 |
RUN: dsymutil -gen-reproducer -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s |
| 44 |
|
| 45 |
RUN: dsymutil --linker parallel -gen-reproducer -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s |
| 46 |
|
| 47 |
CHECK: .debug_info |
| 48 |
CHECK: DW_TAG_compile_unit |
| 49 |
CHECK-NEXT: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)") |
| 50 |
CHECK-NEXT: DW_AT_language (DW_LANG_C99) |
| 51 |
CHECK-NEXT: DW_AT_name ("basic1.c") |
| 52 |
CHECK-NEXT: DW_AT_stmt_list (0x00000000) |
| 53 |
CHECK-NEXT: DW_AT_comp_dir ("/Inputs") |
| 54 |
CHECK-NEXT: DW_AT_low_pc (0x0000000100000ea0) |
| 55 |
CHECK: DW_TAG_subprogram |
| 56 |
CHECK-NEXT: DW_AT_name ("main") |
| 57 |
CHECK-NEXT: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c") |
| 58 |
CHECK-NEXT: DW_AT_decl_line (23) |
| 59 |
CHECK-NEXT: DW_AT_prototyped (0x01) |
| 60 |
CHECK-NEXT: DW_AT_type (0x00000063 |
| 61 |
CHECK-NEXT: DW_AT_external (0x01) |
| 62 |
CHECK-NEXT: DW_AT_accessibility (DW_ACCESS_public) |
| 63 |
CHECK-NEXT: DW_AT_low_pc (0x0000000100000ea0) |
| 64 |
CHECK-NEXT: DW_AT_high_pc (0x0000000100000ec4) |
| 65 |
CHECK-NEXT: DW_AT_frame_base (DW_OP_reg6 RBP) |
| 66 |
CHECK: DW_TAG_formal_parameter |
| 67 |
CHECK-NEXT: DW_AT_name ("argc") |
| 68 |
CHECK-NEXT: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c") |
| 69 |
CHECK-NEXT: DW_AT_decl_line (23) |
| 70 |
CHECK-NEXT: DW_AT_type (0x00000063 |
| 71 |
CHECK-NEXT: DW_AT_location (DW_OP_fbreg -8) |
| 72 |
CHECK: DW_TAG_formal_parameter |
| 73 |
CHECK-NEXT: DW_AT_name ("argv") |
| 74 |
CHECK-NEXT: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c") |
| 75 |
CHECK-NEXT: DW_AT_decl_line (23) |
| 76 |
CHECK-NEXT: DW_AT_type (0x0000006a |
| 77 |
CHECK-NEXT: DW_AT_location (DW_OP_fbreg -16) |
| 78 |
CHECK: NULL |
| 79 |
CHECK: DW_TAG_base_type |
| 80 |
CHECK-NEXT: DW_AT_name ("int") |
| 81 |
CHECK-NEXT: DW_AT_encoding (DW_ATE_signed) |
| 82 |
CHECK-NEXT: DW_AT_byte_size (0x04) |
| 83 |
CHECK: DW_TAG_pointer_type |
| 84 |
CHECK-NEXT: DW_AT_type (0x0000006f |
| 85 |
CHECK: DW_TAG_pointer_type |
| 86 |
CHECK-NEXT: DW_AT_type (0x00000074 |
| 87 |
CHECK: DW_TAG_const_type |
| 88 |
CHECK-NEXT: DW_AT_type (0x00000079 |
| 89 |
CHECK: DW_TAG_base_type |
| 90 |
CHECK-NEXT: DW_AT_name ("char") |
| 91 |
CHECK-NEXT: DW_AT_encoding (DW_ATE_signed_char) |
| 92 |
CHECK-NEXT: DW_AT_byte_size (0x01) |
| 93 |
CHECK: NULL |
| 94 |
|
| 95 |
REPRODUCER: Reproducer written |
| 96 |
ERROR: error: cannot parse the debug map |