brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 0b66361 Raw
41 lines · plain
1# RUN: rm -rf %t && mkdir -p %t2# RUN: llc -filetype=obj -o %t/foo.o %S/Inputs/foo-initializer.ll3# RUN: llvm-ar crs %t/libFoo.a %t/foo.o4# RUN: llc -filetype=obj -o %t/foo.o %S/Inputs/bar-initializer.ll5# RUN: llvm-ar q %t/libFoo.a %t/foo.o6# RUN: llc -filetype=obj -o %t/main.o %S/Inputs/main-ret-0.ll7# RUN: llvm-jitlink -all_load -show-init-es -noexec %t/main.o -L%t -lFoo \8# RUN:     | FileCheck %s9#10# FIXME: Enable this test on Windows/arm64 once that backend is available.11# UNSUPPORTED: target=aarch64-{{.*}}-windows-{{.*}}12#13# On MinGW targets, when compiling the main() function, it gets14# an implicitly generated call to __main(), which is missing in15# this context.16# XFAIL: target={{.*}}-windows-gnu17#18# Check that synthesized archive member names are unambiguous, even if an19# archive contains multiple files with the same name.20#21# Background: Static achives may contain duplicate member filenames. E.g. we22# can create an archive with initially contaning a single object file 'foo.o',23# then append another copy of 'foo.o' to produce an archive containing two24# consecutive copies:25#26#   % llvm-ar crs libfoo.a foo.o27#   % llvm-ar q libfoo.a foo.o28#   % llvm-ar t libfoo.a29#   foo.o30#   foo.o31#32# In this test we create two different 'foo.o' files, each containing a static33# initializer. Since initializer names are based on the full archive member34# names, failure to give the members unique names will result in a duplicate35# definition error. The `-all_load` option is used to force all member files in36# the archive to be loaded, despite the members not being directly referenced.37#38# CHECK-DAG: main{{.*}}main.o39# CHECK-DAG: initializer_foo_ran{{.*}}libFoo.a[0](foo.o)40# CHECK-DAG: initializer_bar_ran{{.*}}libFoo.a[1](foo.o)41