File: all-load-multifile-archive-with-duplicate-member-filenames.test

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.4-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,236,516 kB
  • sloc: cpp: 7,619,569; ansic: 1,433,956; asm: 1,058,748; python: 252,181; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,585; awk: 3,523; javascript: 2,272; xml: 892; fortran: 770
file content (40 lines) | stat: -rw-r--r-- 1,750 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# RUN: rm -rf %t && mkdir -p %t
# RUN: llc -filetype=obj -o %t/foo.o %S/Inputs/foo-initializer.ll
# RUN: llvm-ar crs %t/libFoo.a %t/foo.o
# RUN: llc -filetype=obj -o %t/foo.o %S/Inputs/bar-initializer.ll
# RUN: llvm-ar q %t/libFoo.a %t/foo.o
# RUN: llc -filetype=obj -o %t/main.o %S/Inputs/main-ret-0.ll
# RUN: llvm-jitlink -all_load -show-init-es -noexec %t/main.o -L%t -lFoo \
# RUN:     | FileCheck %s
#
# FIXME: Enable this test on Windows/arm64 once that backend is available.
# UNSUPPORTED: target=aarch64-{{.*}}-windows-{{.*}}
#
# On MinGW targets, when compiling the main() function, it gets
# an implicitly generated call to __main(), which is missing in
# this context.
# XFAIL: target={{.*}}-windows-gnu
#
# Check that synthesized archive member names are unambiguous, even if an
# archive contains multiple files with the same name.
#
# Background: Static achives may contain duplicate member filenames. E.g. we
# can create an archive with initially contaning a single object file 'foo.o',
# then append another copy of 'foo.o' to produce an archive containing two
# consecutive copies:
#
#   % llvm-ar crs libfoo.a foo.o
#   % llvm-ar q libfoo.a foo.o
#   % llvm-ar t libfoo.a
#   foo.o
#   foo.o
#
# In this test we create two different 'foo.o' files, each containing a static
# initializer. Since initializer names are based on the full archive member
# names, failure to give the members unique names will result in a duplicate
# definition error. The `-all_load` option is used to force all member files in
# the archive to be loaded, despite the members not being directly referenced.
#
# CHECK-DAG: main{{.*}}main.o
# CHECK-DAG: initializer_foo_ran{{.*}}libFoo.a[0](foo.o)
# CHECK-DAG: initializer_bar_ran{{.*}}libFoo.a[1](foo.o)