brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · 86caddf Raw
97 lines · plain
1# UNSUPPORTED: system-windows2# This test is unsupported on windows because it creates paths3# longer than MAX_PATH4 5# Recreate the folder structure in a temp directory we can remove later.6RUN: rm -rf %t7RUN: mkdir -p %t/Inputs %t/tempdir8RUN: cp %p/../Inputs/basic.macho.x86_64 %t/Inputs9RUN: cp %p/../Inputs/basic1.macho.x86_64.o %t/Inputs10RUN: cp %p/../Inputs/basic2.macho.x86_64.o %t/Inputs11RUN: cp %p/../Inputs/basic3.macho.x86_64.o %t/Inputs12 13# Verify all the files are present.14RUN: dsymutil -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s15 16# Make sure we don't crash with an empty TMPDIR.17RUN: env TMPDIR="" dsymutil -o -f -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&118 19# Make sure we don't leave around a temporary directory.20RUN: env TMPDIR="%t/tempdir" dsymutil -o - -f %t/Inputs/basic.macho.x86_6421RUN: not ls %t/tempdir/dsymutil-*22 23# Create a reproducer.24RUN: rm -rf %t.repro25RUN: 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=REPRODUCER26RUN: llvm-dwarfdump -a %t.generate | FileCheck %s27 28RUN: rm -rf %t.diags29RUN: 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=REPRODUCER30RUN: ls %t.diags | grep 'dsymutil-' | count 131 32# Remove the input files and verify that was successful.33RUN: rm -rf %t34RUN: not dsymutil -f -o %t.error -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=ERROR35 36RUN: not dsymutil --linker parallel -f -o %t.error -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=ERROR37 38# Use the reproducer.39RUN: dsymutil -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s40RUN: dsymutil --linker parallel -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s41 42# Using a reproducer takes precedence.43RUN: dsymutil -gen-reproducer -use-reproducer %t.repro -f -o - -oso-prepend-path=%t %t/Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s44 45RUN: 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 %s46 47CHECK: .debug_info48CHECK:  DW_TAG_compile_unit49CHECK-NEXT:    DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")50CHECK-NEXT:    DW_AT_language (DW_LANG_C99)51CHECK-NEXT:    DW_AT_name ("basic1.c")52CHECK-NEXT:    DW_AT_stmt_list (0x00000000)53CHECK-NEXT:    DW_AT_comp_dir ("/Inputs")54CHECK-NEXT:    DW_AT_low_pc (0x0000000100000ea0)55CHECK:    DW_TAG_subprogram56CHECK-NEXT:    DW_AT_name ("main")57CHECK-NEXT:      DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")58CHECK-NEXT:      DW_AT_decl_line (23)59CHECK-NEXT:      DW_AT_prototyped (0x01)60CHECK-NEXT:      DW_AT_type (0x0000006361CHECK-NEXT:      DW_AT_external (0x01)62CHECK-NEXT:      DW_AT_accessibility (DW_ACCESS_public)63CHECK-NEXT:      DW_AT_low_pc (0x0000000100000ea0)64CHECK-NEXT:      DW_AT_high_pc (0x0000000100000ec4)65CHECK-NEXT:      DW_AT_frame_base (DW_OP_reg6 RBP)66CHECK:      DW_TAG_formal_parameter67CHECK-NEXT:        DW_AT_name ("argc")68CHECK-NEXT:        DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")69CHECK-NEXT:        DW_AT_decl_line (23)70CHECK-NEXT:        DW_AT_type (0x0000006371CHECK-NEXT:        DW_AT_location (DW_OP_fbreg -8)72CHECK:      DW_TAG_formal_parameter73CHECK-NEXT:        DW_AT_name ("argv")74CHECK-NEXT:        DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")75CHECK-NEXT:        DW_AT_decl_line (23)76CHECK-NEXT:        DW_AT_type (0x0000006a77CHECK-NEXT:        DW_AT_location (DW_OP_fbreg -16)78CHECK:      NULL79CHECK:    DW_TAG_base_type80CHECK-NEXT:      DW_AT_name ("int")81CHECK-NEXT:      DW_AT_encoding (DW_ATE_signed)82CHECK-NEXT:      DW_AT_byte_size (0x04)83CHECK:    DW_TAG_pointer_type84CHECK-NEXT:      DW_AT_type (0x0000006f85CHECK:    DW_TAG_pointer_type86CHECK-NEXT:      DW_AT_type (0x0000007487CHECK:    DW_TAG_const_type88CHECK-NEXT:      DW_AT_type (0x0000007989CHECK:    DW_TAG_base_type90CHECK-NEXT:      DW_AT_name ("char")91CHECK-NEXT:      DW_AT_encoding (DW_ATE_signed_char)92CHECK-NEXT:      DW_AT_byte_size (0x01)93CHECK:      NULL94 95REPRODUCER: Reproducer written96ERROR: error: cannot parse the debug map97