summaryrefslogtreecommitdiffstats
path: root/lld/test/COFF/force-multipleres.test
blob: 944f63f6319d21c9e4570f6530201fb4d7e38e7a (plain)
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
// Check that lld-link rejects duplicate resources, unless
// /force or /force:multipleres is passed.
// The input was generated with the following command, using the original Windows
// rc.exe:
// > rc /fo id.res /nologo id.rc
// > rc /fo name.res /nologo name.rc

RUN: rm -rf %t.dir
RUN: mkdir %t.dir
RUN: cp %S/Inputs/id.res %t.dir/id1.res
RUN: cp %S/Inputs/id.res %t.dir/id2.res
RUN: cp %S/Inputs/id.res.o %t.dir/id1.o
RUN: cp %S/Inputs/id.res.o %t.dir/id2.o

RUN: not lld-link /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.res 2>&1 | \
RUN:     FileCheck -check-prefix=ERR %s
RUN: not lld-link /lldmingw /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.o 2>&1 | \
RUN:     FileCheck -check-prefix=ERR %s
RUN: not lld-link /lldmingw /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.o %t.dir/id2.o 2>&1 | \
RUN:     FileCheck -check-prefix=ERR %s
ERR: error: duplicate resource: type STRINGTABLE (ID 6)/name ID 3/language 1033, in {{.*}}id1.{{res|o}} and in {{.*}}id2.{{res|o}}

RUN: lld-link /force /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.res 2>&1 | \
RUN:     FileCheck -check-prefix=WARN %s
RUN: lld-link /force:multipleres /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.res 2>&1 | \
RUN:     FileCheck -check-prefix=WARN %s
RUN: lld-link /lldmingw /force:multipleres /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.o %t.dir/id2.o 2>&1 | \
RUN:     FileCheck -check-prefix=WARN %s
WARN: warning: duplicate resource: type STRINGTABLE (ID 6)/name ID 3/language 1033, in {{.*}}id1.{{res|o}} and in {{.*}}id2.{{res|o}}
OpenPOWER on IntegriCloud