llvm-project/lld/test/COFF/multiple-resource-objs.test
Martin Storsjo 08a5a0aa25 [COFF] Check errorCount before committing the output file
This avoids producing an output file if errors appeared late in the
linking process (e.g. while fixing relocations, or as in the test,
while checking for multiple resources). If an output file is produced,
build tools might not retry building it on rebuilds, even if a previous
build failed due to the error return code.

Differential Revision: https://reviews.llvm.org/D66491

llvm-svn: 369445
2019-08-20 21:08:14 +00:00

14 lines
667 B
Plaintext

# RUN: llvm-cvtres /out:%t_resource.obj %S/Inputs/resource.res
# RUN: llvm-cvtres /out:%t_id.obj %S/Inputs/id.res
# RUN: rm -f %t.exe
# RUN: not lld-link /out:%t.exe /dll /noentry %t_id.obj %t_resource.obj 2>&1 | \
# RUN: FileCheck --check-prefix=TWOOBJ %s
# RUN: not test -f %t.exe
TWOOBJ: error: {{.*}}_resource.obj: more than one resource obj file not allowed, already got {{.*}}_id.obj
# RUN: not lld-link /out:%t.exe /dll /noentry %S/Inputs/id.res %t_resource.obj 2>&1 | \
# RUN: FileCheck --check-prefix=OBJRES %s
OBJRES: error: internal .obj file created from .res files: more than one resource obj file not allowed, already got {{.*}}_resource.obj