diff options
Diffstat (limited to 'test/Object')
-rw-r--r-- | test/Object/Inputs/shared-object-test.elf-i386 | bin | 0 -> 1848 bytes | |||
-rw-r--r-- | test/Object/Inputs/shared-object-test.elf-x86-64 | bin | 0 -> 2760 bytes | |||
-rw-r--r-- | test/Object/Inputs/shared.ll | 33 | ||||
-rw-r--r-- | test/Object/X86/dg.exp | 5 | ||||
-rw-r--r-- | test/Object/X86/lit.local.cfg | 13 | ||||
-rw-r--r-- | test/Object/dg.exp | 3 | ||||
-rw-r--r-- | test/Object/lit.local.cfg | 1 | ||||
-rw-r--r-- | test/Object/nm-shared-object.test | 15 | ||||
-rw-r--r-- | test/Object/readobj-shared-object.test | 59 |
9 files changed, 121 insertions, 8 deletions
diff --git a/test/Object/Inputs/shared-object-test.elf-i386 b/test/Object/Inputs/shared-object-test.elf-i386 Binary files differnew file mode 100644 index 0000000..fb63915 --- /dev/null +++ b/test/Object/Inputs/shared-object-test.elf-i386 diff --git a/test/Object/Inputs/shared-object-test.elf-x86-64 b/test/Object/Inputs/shared-object-test.elf-x86-64 Binary files differnew file mode 100644 index 0000000..92667f5 --- /dev/null +++ b/test/Object/Inputs/shared-object-test.elf-x86-64 diff --git a/test/Object/Inputs/shared.ll b/test/Object/Inputs/shared.ll new file mode 100644 index 0000000..1a62d56 --- /dev/null +++ b/test/Object/Inputs/shared.ll @@ -0,0 +1,33 @@ +; How to make the shared objects from this file: +; +; LDARGS="--unresolved-symbols=ignore-all -soname=libfoo.so --no-as-needed -lc -lm" +; +; X86-32 ELF: +; llc -mtriple=i386-linux-gnu shared.ll -filetype=obj -o tmp32.o -relocation-model=pic +; ld -melf_i386 -shared tmp32.o -o shared-object-test.elf-i386 $LDARGS +; +; X86-64 ELF: +; llc -mtriple=x86_64-linux-gnu shared.ll -filetype=obj -o tmp64.o -relocation-model=pic +; ld -melf_x86_64 -shared tmp64.o -o shared-object-test.elf-x86-64 $LDARGS + +@defined_sym = global i32 1, align 4 + +@tls_sym = thread_local global i32 2, align 4 + +@undef_sym = external global i32 + +@undef_tls_sym = external thread_local global i32 + +@common_sym = common global i32 0, align 4 + +define i32 @global_func() nounwind uwtable { +entry: + ret i32 0 +} + +declare i32 @undef_func(...) + +define internal i32 @local_func() nounwind uwtable { +entry: + ret i32 0 +} diff --git a/test/Object/X86/dg.exp b/test/Object/X86/dg.exp deleted file mode 100644 index 6a91de7..0000000 --- a/test/Object/X86/dg.exp +++ /dev/null @@ -1,5 +0,0 @@ -load_lib llvm.exp - -if { [llvm_supports_target X86] } { - RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{test}]] -} diff --git a/test/Object/X86/lit.local.cfg b/test/Object/X86/lit.local.cfg new file mode 100644 index 0000000..bbffb84 --- /dev/null +++ b/test/Object/X86/lit.local.cfg @@ -0,0 +1,13 @@ +config.suffixes = ['.test'] + +def getRoot(config): + if not config.parent: + return config + return getRoot(config.parent) + +root = getRoot(config) + +targets = set(root.targets_to_build.split()) +if not 'X86' in targets: + config.unsupported = True + diff --git a/test/Object/dg.exp b/test/Object/dg.exp deleted file mode 100644 index be82c51..0000000 --- a/test/Object/dg.exp +++ /dev/null @@ -1,3 +0,0 @@ -load_lib llvm.exp - -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{test}]] diff --git a/test/Object/lit.local.cfg b/test/Object/lit.local.cfg new file mode 100644 index 0000000..df9b335 --- /dev/null +++ b/test/Object/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.test'] diff --git a/test/Object/nm-shared-object.test b/test/Object/nm-shared-object.test new file mode 100644 index 0000000..b361df5 --- /dev/null +++ b/test/Object/nm-shared-object.test @@ -0,0 +1,15 @@ +RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-i386 \ +RUN: | FileCheck %s -check-prefix ELF +RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-x86-64 \ +RUN: | FileCheck %s -check-prefix ELF + +; Note: tls_sym should be 'D' (not '?'), but TLS is not +; yet recognized by ObjectFile. + +ELF: {{[0-9a-f]+}} A __bss_start +ELF: {{[0-9a-f]+}} A _edata +ELF: {{[0-9a-f]+}} A _end +ELF: {{[0-9a-f]+}} B common_sym +ELF: {{[0-9a-f]+}} D defined_sym +ELF: {{[0-9a-f]+}} T global_func +ELF: ? tls_sym diff --git a/test/Object/readobj-shared-object.test b/test/Object/readobj-shared-object.test new file mode 100644 index 0000000..3b5457c --- /dev/null +++ b/test/Object/readobj-shared-object.test @@ -0,0 +1,59 @@ +RUN: llvm-readobj %p/Inputs/shared-object-test.elf-i386 \ +RUN: | FileCheck %s -check-prefix ELF +RUN: llvm-readobj %p/Inputs/shared-object-test.elf-i386 \ +RUN: | FileCheck %s -check-prefix ELF32 + +RUN: llvm-readobj %p/Inputs/shared-object-test.elf-x86-64 \ +RUN: | FileCheck %s -check-prefix ELF +RUN: llvm-readobj %p/Inputs/shared-object-test.elf-x86-64 \ +RUN: | FileCheck %s -check-prefix ELF64 + +ELF64:File Format : ELF64-x86-64 +ELF64:Arch : x86_64 +ELF64:Address Size: 64 bits +ELF64:Load Name : libfoo.so + +ELF32:File Format : ELF32-i386 +ELF32:Arch : i386 +ELF32:Address Size: 32 bits +ELF32:Load Name : libfoo.so + +ELF:Symbols: +ELF: .dynsym DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .dynstr DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .text DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .eh_frame DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .tdata DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .dynamic DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .got.plt DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .data DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: .bss DBG {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} formatspecific +ELF: shared.ll FILE {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} absolute,formatspecific +ELF: local_func FUNC {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} +ELF: _GLOBAL_OFFSET_TABLE_ DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} absolute +ELF: _DYNAMIC DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} absolute +ELF: common_sym DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global +ELF: tls_sym DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,threadlocal +ELF: defined_sym DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global +ELF: __bss_start ? {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,absolute +ELF: _end ? {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,absolute +ELF: global_func FUNC {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global +ELF: _edata ? {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,absolute +ELF: Total: 21 + +ELF:Dynamic Symbols: +ELF: common_sym DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global +ELF: tls_sym DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,threadlocal +ELF: defined_sym DATA {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global +ELF: __bss_start ? {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,absolute +ELF: _end ? {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,absolute +ELF: global_func FUNC {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global +ELF: _edata ? {{[0-9a-f]+}} {{[0-9a-f]+}} {{[0-9a-f]+}} global,absolute +ELF: Total: {{[0-9a-f]+}} + +ELF:Libraries needed: +ELF: libc.so.6 +ELF: libm.so.6 +ELF: Total: 2 + + |