[llvm-jitlink] Use -num-threads=0 for regression tests relying on debug output.

ORC and JITLink debugging output write the dbgs() raw_ostream, which isn't
thread-safe. Use -num-threads=0 to force single-threaded linking for tests that
produce debugging output.

The llvm-jitlink tool is updated to suggest -num-threads=0 when debugging
output is enabled.
This commit is contained in:
Lang Hames 2025-01-08 13:51:53 +11:00
parent dde5546b79
commit bfb0a518e7
36 changed files with 143 additions and 116 deletions

View File

@ -1821,17 +1821,10 @@ ExecutionSession::lookup(const JITDylibSearchOrder &SearchOrder,
RegisterDependenciesFunction RegisterDependencies) { RegisterDependenciesFunction RegisterDependencies) {
#if LLVM_ENABLE_THREADS #if LLVM_ENABLE_THREADS
// In the threaded case we use promises to return the results. // In the threaded case we use promises to return the results.
std::promise<SymbolMap> PromisedResult; std::promise<MSVCPExpected<SymbolMap>> PromisedResult;
Error ResolutionError = Error::success();
auto NotifyComplete = [&](Expected<SymbolMap> R) { auto NotifyComplete = [&](Expected<SymbolMap> R) {
if (R) PromisedResult.set_value(std::move(R));
PromisedResult.set_value(std::move(*R));
else {
ErrorAsOutParameter _(ResolutionError);
ResolutionError = R.takeError();
PromisedResult.set_value(SymbolMap());
}
}; };
#else #else
@ -1848,18 +1841,11 @@ ExecutionSession::lookup(const JITDylibSearchOrder &SearchOrder,
#endif #endif
// Perform the asynchronous lookup. // Perform the asynchronous lookup.
lookup(K, SearchOrder, std::move(Symbols), RequiredState, NotifyComplete, lookup(K, SearchOrder, std::move(Symbols), RequiredState,
RegisterDependencies); std::move(NotifyComplete), RegisterDependencies);
#if LLVM_ENABLE_THREADS #if LLVM_ENABLE_THREADS
auto ResultFuture = PromisedResult.get_future(); return PromisedResult.get_future().get();
auto Result = ResultFuture.get();
if (ResolutionError)
return std::move(ResolutionError);
return std::move(Result);
#else #else
if (ResolutionError) if (ResolutionError)
return std::move(ResolutionError); return std::move(ResolutionError);

View File

@ -1,16 +1,18 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=armv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_armv7.o %s # RUN: llvm-mc -triple=armv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_armv7.o %s
# RUN: llvm-objdump -s --section=.rodata %t_armv7.o | FileCheck --check-prefix=CHECK-OBJ %s # RUN: llvm-objdump -s --section=.rodata %t_armv7.o | FileCheck --check-prefix=CHECK-OBJ %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-page-size 4096 %t_armv7.o -debug-only=jitlink 2>&1 \ # RUN: -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN: -slab-page-size 4096 %t_armv7.o 2>&1 \
# RUN: | FileCheck --check-prefix=CHECK-LG %s # RUN: | FileCheck --check-prefix=CHECK-LG %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \ # RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN: -slab-page-size 4096 %t_armv7.o -check %s # RUN: -slab-page-size 4096 %t_armv7.o -check %s
# RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s # RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s
# RUN: llvm-objdump -s --section=.rodata %t_thumbv7.o | FileCheck --check-prefix=CHECK-OBJ %s # RUN: llvm-objdump -s --section=.rodata %t_thumbv7.o | FileCheck --check-prefix=CHECK-OBJ %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-page-size 4096 %t_thumbv7.o -debug-only=jitlink 2>&1 \ # RUN: -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN: -slab-page-size 4096 %t_thumbv7.o 2>&1 \
# RUN: | FileCheck --check-prefix=CHECK-LG %s # RUN: | FileCheck --check-prefix=CHECK-LG %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \ # RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
# RUN: -slab-page-size 4096 %t_thumbv7.o -check %s # RUN: -slab-page-size 4096 %t_thumbv7.o -check %s

View File

@ -1,7 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=aarch64-linux-gnu -filetype=obj -o %t %s # RUN: llvm-mc -triple=aarch64-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-jitlink -noexec -phony-externals -debug-only=jitlink %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: FileCheck %s # RUN: -phony-externals %t 2>&1 | FileCheck %s
# #
# Check that splitting of eh-frame sections works. # Check that splitting of eh-frame sections works.
# #

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=arm64-apple-ios -filetype=obj -o %t %s # RUN: llvm-mc -triple=arm64-apple-ios -filetype=obj -o %t %s
# RUN: llvm-jitlink -noexec -debug-only=jitlink %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check that splitting of compact-unwind sections works. # Check that splitting of compact-unwind sections works.
# #

View File

@ -1,7 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=arm64-apple-darwin11 -filetype=obj -o %t %s # RUN: llvm-mc -triple=arm64-apple-darwin11 -filetype=obj -o %t %s
# RUN: llvm-jitlink -noexec -phony-externals -debug-only=jitlink %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: FileCheck %s # RUN: -phony-externals %t 2>&1 | FileCheck %s
# #
# Check that splitting of eh-frame sections works. # Check that splitting of eh-frame sections works.
# #

View File

@ -1,7 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc --triple=loongarch64-linux-gnu --filetype=obj -o %t %s # RUN: llvm-mc -triple=loongarch64-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-jitlink --noexec --phony-externals --debug-only=jitlink %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: FileCheck %s # RUN: -phony-externals %t 2>&1 | FileCheck %s
## Check that splitting of eh-frame sections works. ## Check that splitting of eh-frame sections works.

View File

@ -1,15 +1,15 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=riscv32 -mattr=+relax -filetype=obj -o %t.rv32 %s # RUN: llvm-mc -triple=riscv32 -mattr=+relax -filetype=obj -o %t.rv32 %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s %t.rv32 \ # RUN: -check %s %t.rv32 2>&1 \
# RUN: 2>&1 | FileCheck %s # RUN: | FileCheck %s
# RUN: llvm-mc -triple=riscv64 -mattr=+relax -filetype=obj -o %t.rv64 %s # RUN: llvm-mc -triple=riscv64 -mattr=+relax -filetype=obj -o %t.rv64 %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s %t.rv64 \ # RUN: -check %s %t.rv64 2>&1 \
# RUN: 2>&1 | FileCheck %s # RUN: | FileCheck %s
.text .text

View File

@ -1,43 +1,43 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=riscv32 -mattr=+relax,+c -filetype=obj -o %t.rv32 %s # RUN: llvm-mc -triple=riscv32 -mattr=+relax,+c -filetype=obj -o %t.rv32 %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s %t.rv32 \ # RUN: -check %s %t.rv32 2>&1 \
# RUN: 2>&1 | FileCheck %s # RUN: | FileCheck %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s -check-name=jitlink-check-rv32 %t.rv32 \ # RUN: -check %s -check-name=jitlink-check-rv32 %t.rv32 2>&1 \
# RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32 %s # RUN: | FileCheck -check-prefix=CHECK-RV32 %s
# RUN: llvm-mc -triple=riscv64 -mattr=+relax,+c -filetype=obj -o %t.rv64 %s # RUN: llvm-mc -triple=riscv64 -mattr=+relax,+c -filetype=obj -o %t.rv64 %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s %t.rv64 \ # RUN: -check %s %t.rv64 2>&1 \
# RUN: 2>&1 | FileCheck %s # RUN: | FileCheck %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s -check-name=jitlink-check-rv64 %t.rv64 \ # RUN: -check %s -check-name=jitlink-check-rv64 %t.rv64 2>&1 \
# RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64 %s # RUN: | FileCheck -check-prefix=CHECK-RV64 %s
# RUN: llvm-mc -triple=riscv32 -mattr=+relax,+zca -filetype=obj -o %t.rv32zca %s # RUN: llvm-mc -triple=riscv32 -mattr=+relax,+zca -filetype=obj -o %t.rv32zca %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s %t.rv32zca \ # RUN: -check %s %t.rv32zca 2>&1 \
# RUN: 2>&1 | FileCheck %s # RUN: | FileCheck %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s -check-name=jitlink-check-rv32 %t.rv32zca \ # RUN: -check %s -check-name=jitlink-check-rv32 %t.rv32zca 2>&1 \
# RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32 %s # RUN: | FileCheck -check-prefix=CHECK-RV32 %s
# RUN: llvm-mc -triple=riscv64 -mattr=+relax,+c -filetype=obj -o %t.rv64 %s # RUN: llvm-mc -triple=riscv64 -mattr=+relax,+c -filetype=obj -o %t.rv64 %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s %t.rv64 \ # RUN: -check %s %t.rv64 2>&1 \
# RUN: 2>&1 | FileCheck %s # RUN: | FileCheck %s
# RUN: llvm-jitlink -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \ # RUN: -slab-allocate 100Kb -slab-address 0x1000 -slab-page-size 4096 \
# RUN: -debug-only=jitlink -check %s -check-name=jitlink-check-rv64 %t.rv64 \ # RUN: -check %s -check-name=jitlink-check-rv64 %t.rv64 2>&1 \
# RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64 %s # RUN: | FileCheck -check-prefix=CHECK-RV64 %s
.text .text

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t %s # RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -debug-only=jitlink -num-threads=0 -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Because of the exist of cfi directive, sections like eh_frame section will be emitted # Because of the exist of cfi directive, sections like eh_frame section will be emitted
# in llvm's object code emission phase. Anonymous symbols will also be emitted to indicate # in llvm's object code emission phase. Anonymous symbols will also be emitted to indicate

View File

@ -1,10 +1,12 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o %t %s # RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-jitlink -noexec -phony-externals -debug-only=jitlink %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec -phony-externals \
# RUN: FileCheck %s # RUN: %t 2>&1 \
# RUN: | FileCheck %s
# RUN: llvm-mc -triple=powerpc64-unknown-linux-gnu -filetype=obj -o %t %s # RUN: llvm-mc -triple=powerpc64-unknown-linux-gnu -filetype=obj -o %t %s
# RUN: llvm-jitlink -noexec -phony-externals -debug-only=jitlink %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec -phony-externals \
# RUN: FileCheck %s # RUN: %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check that splitting of eh-frame sections works. # Check that splitting of eh-frame sections works.
# #

View File

@ -4,8 +4,9 @@
# RUN: %t/external_weak.o %S/Inputs/external_weak.s # RUN: %t/external_weak.o %S/Inputs/external_weak.s
# RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o \ # RUN: llvm-mc -triple=powerpc64le-unknown-linux-gnu -filetype=obj -o \
# RUN: %t/external_weak_main.o %S/Inputs/external_weak_main.s # RUN: %t/external_weak_main.o %S/Inputs/external_weak_main.s
# RUN: llvm-jitlink -noexec -debug-only=jitlink %t/external_weak.o \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: %t/external_weak_main.o 2>&1 | FileCheck %s # RUN: %t/external_weak.o %t/external_weak_main.o 2>&1 \
# RUN: | FileCheck %s
# CHECK: Created ELFLinkGraphBuilder for "{{.*}}external_weak_main.o" # CHECK: Created ELFLinkGraphBuilder for "{{.*}}external_weak_main.o"
# CHECK: Creating defined graph symbol for ELF symbol "foo" # CHECK: Creating defined graph symbol for ELF symbol "foo"
# CHECK: External symbols: # CHECK: External symbols:

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check absolute symbol is created with a correct value. # Check absolute symbol is created with a correct value.
# #

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check a weak symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_ANY selection type. # Check a weak symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_ANY selection type.
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...

View File

@ -1,16 +1,19 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check COMDAT associative symbol is emitted as local symbol. # Check COMDAT associative symbol is emitted as local symbol.
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...
# CHECK: 2: Creating defined graph symbol for COFF symbol ".text" in .text (index: 2) # CHECK: 0: Creating defined graph symbol for COFF symbol ".text" in .text (index: 1)
# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000001, linkage: strong, scope: local, dead - <anonymous symbol> # CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000000, linkage: strong, scope: local, dead - .text
# CHECK-NEXT: 4: Exporting COMDAT graph symbol for COFF symbol "func" in section 2 # CHECK-NEXT: 4: Exporting COMDAT graph symbol for COFF symbol "func" in section 2
# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000001, linkage: weak, scope: default, dead - func # CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000000, linkage: weak, scope: default, dead - func
# CHECK-NEXT: 5: Creating defined graph symbol for COFF symbol ".xdata" in .xdata (index: 3) # CHECK-NEXT: 4: Creating defined graph symbol for COFF symbol "func" in .text (index: 2)
# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000000, linkage: strong, scope: local, dead - .xdata # CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000000, linkage: weak, scope: default, dead - func
# CHECK-NEXT: 5: Creating defined graph symbol for COFF symbol ".xdata" in .xdata (index: 3)
# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000000, linkage: strong, scope: local, dead - .xdata
--- !COFF --- !COFF
header: header:

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check a weak symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_EXACT_MATCH selection type. # Check a weak symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_EXACT_MATCH selection type.
# Doesn't check the content validation. # Doesn't check the content validation.
# #

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check a comdat export is done correctly even if second symbol of comdat sequences appear out of order # Check a comdat export is done correctly even if second symbol of comdat sequences appear out of order
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check jitlink handles largest selection type as plain weak symbol. # Check jitlink handles largest selection type as plain weak symbol.
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check a strong symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_NODUPLICATES selection type. # Check a strong symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_NODUPLICATES selection type.
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check a COMDAT symbol with an offset is handled correctly. # Check a COMDAT symbol with an offset is handled correctly.
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# # RUN: | FileCheck %s
#
# Check a weak symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_SAME_SIZE selection type. # Check a weak symbol is created for a COMDAT symbol with IMAGE_COMDAT_SELECT_SAME_SIZE selection type.
# Doesn't check the size validation. # Doesn't check the size validation.
# #

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check a COMDAT any symbol is exported as a weak symbol. # Check a COMDAT any symbol is exported as a weak symbol.
# #

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check a common symbol is created. # Check a common symbol is created.
# #

View File

@ -1,10 +1,10 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj %s -o %t # RUN: yaml2obj %s -o %t
# RUN: llvm-jitlink -noexec -abs __ImageBase=0xfff00000 \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: --debug-only=jitlink \ # RUN: -abs __ImageBase=0xfff00000 -slab-allocate 100Kb \
# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ # RUN: -slab-address 0xfff00000 -slab-page-size 4096 %t 2>&1 \
# RUN: %t 2>&1 | FileCheck %s # RUN: | FileCheck %s
# #
# Check duplicate undefined external symbols are handled correctly. # Check duplicate undefined external symbols are handled correctly.
# #
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...

View File

@ -1,6 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink -abs func=0xcafef00d --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -abs func=0xcafef00d %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check a file debug symbol is skipped. # Check a file debug symbol is skipped.
# #

View File

@ -1,6 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink -abs var=0xcafef00d --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -abs var=0xcafef00d %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check a local symbol is created for a static variable. # Check a local symbol is created for a static variable.
# #

View File

@ -1,6 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink -abs var=0xcafef00d --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -abs var=0xcafef00d %t 2>&1 | \
# RUN: FileCheck %s
# #
# Check a default symbol is aliased as a weak external symbol. # Check a default symbol is aliased as a weak external symbol.
# #

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: yaml2obj -o %t.o %s # RUN: yaml2obj -o %t.o %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec %t.o 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t.o 2>&1 \
# RUN: | FileCheck %s
# #
# Check that debug sections get NoAlloc lifetimes. # Check that debug sections get NoAlloc lifetimes.
# #

View File

@ -2,8 +2,9 @@
# UNSUPPORTED: system-windows # UNSUPPORTED: system-windows
# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \ # RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \
# RUN: -filetype=obj -o %t %s # RUN: -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -abs bar=0x01 \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: -abs _ZTIi=0x02 -noexec %t 2>&1 | FileCheck %s # RUN: -abs bar=0x01 -abs _ZTIi=0x02 %t 2>&1 \
# RUN: | FileCheck %s
# #
# FIXME: This test should run on windows. Investigate spurious # FIXME: This test should run on windows. Investigate spurious
# 'note: command had no output on stdout or stderr' errors, then re-enable. # 'note: command had no output on stdout or stderr' errors, then re-enable.

View File

@ -2,8 +2,9 @@
# UNSUPPORTED: system-windows # UNSUPPORTED: system-windows
# RUN: llvm-mc -triple=x86_64-pc-linux-gnu -large-code-model \ # RUN: llvm-mc -triple=x86_64-pc-linux-gnu -large-code-model \
# RUN: -filetype=obj -o %t %s # RUN: -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec -phony-externals %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: FileCheck %s # RUN: -phony-externals %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check handling of pointer encodings for personality functions when compiling # Check handling of pointer encodings for personality functions when compiling
# with `-mcmodel=large -static`. # with `-mcmodel=large -static`.

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=orc -num-threads=0 -noexec \ # RUN: llvm-jitlink -num-threads=0 -debug-only=orc -noexec \
# RUN: -abs _external_func=0x1 -entry=_foo %t 2>&1 | FileCheck %s # RUN: -abs _external_func=0x1 -entry=_foo %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check that simplification eliminates dependencies on symbols in this unit, # Check that simplification eliminates dependencies on symbols in this unit,
# and correctly propagates dependencies on symbols outside the unit (including # and correctly propagates dependencies on symbols outside the unit (including

View File

@ -1,6 +1,7 @@
# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t.o %s # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t.o %s
# RUN: llvm-jitlink -debug-only=orc -noexec -debugger-support %t.o 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=orc -noexec -debugger-support \
# RUN: FileCheck %s # RUN: %t.o 2>&1 \
# RUN: | FileCheck %s
# #
# REQUIRES: asserts && system-darwin # REQUIRES: asserts && system-darwin
# #

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=x86_64-apple-darwin11 -filetype=obj -o %t %s # RUN: llvm-mc -triple=x86_64-apple-darwin11 -filetype=obj -o %t %s
# RUN: llvm-jitlink -noexec -debug-only=jitlink %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Check that splitting of compact-unwind sections works. # Check that splitting of compact-unwind sections works.
# #

View File

@ -1,6 +1,7 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=x86_64-apple-macos10.9 -filetype=obj -o %t %s # RUN: llvm-mc -triple=x86_64-apple-macos10.9 -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# #
# Verify that PC-begin candidate symbols have been sorted correctly when adding # Verify that PC-begin candidate symbols have been sorted correctly when adding
# PC-begin edges for FDEs. In this test both _main and _X are at address zero, # PC-begin edges for FDEs. In this test both _main and _X are at address zero,

View File

@ -1,7 +1,8 @@
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec -entry hook %t 2>&1 | \ # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec \
# RUN: FileCheck %s # RUN: -entry hook %t 2>&1 \
# RUN: | FileCheck %s
# #
# Verify that we split C string literals on null-terminators, rather than on # Verify that we split C string literals on null-terminators, rather than on
# symbol boundaries. We expect four dead-stripped symbols: l_str.0, l_str.2, # symbol boundaries. We expect four dead-stripped symbols: l_str.0, l_str.2,

View File

@ -4,7 +4,8 @@
# #
# REQUIRES: asserts # REQUIRES: asserts
# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec %t 2>&1 | FileCheck %s # RUN: llvm-jitlink -num-threads=0 -debug-only=jitlink -noexec %t 2>&1 \
# RUN: | FileCheck %s
# CHECK: Creating graph symbols... # CHECK: Creating graph symbols...
# CHECK: Graphifying regular section __DATA,__data... # CHECK: Graphifying regular section __DATA,__data...

View File

@ -1667,6 +1667,12 @@ static Error sanitizeArguments(const Triple &TT, const char *ArgV0) {
inconvertibleErrorCode()); inconvertibleErrorCode());
} }
#ifndef NDEBUG
if (DebugFlag && MaterializationThreads != 0)
errs() << "Warning: debugging output is not thread safe. "
"Use -num-threads=0 to stabilize output.\n";
#endif // NDEBUG
// Only one of -oop-executor and -oop-executor-connect can be used. // Only one of -oop-executor and -oop-executor-connect can be used.
if (!!OutOfProcessExecutor.getNumOccurrences() && if (!!OutOfProcessExecutor.getNumOccurrences() &&
!!OutOfProcessExecutorConnect.getNumOccurrences()) !!OutOfProcessExecutorConnect.getNumOccurrences())