1 // Check that lld-link rejects duplicate resources, unless
2 // /force or /force:multipleres is passed.
3 // The input was generated with the following command, using the original Windows
5 // > rc /fo id.res /nologo id.rc
6 // > rc /fo name.res /nologo name.rc
10 RUN: cp %S/Inputs/id.res %t.dir/id1.res
11 RUN: cp %S/Inputs/id.res %t.dir/id2.res
12 RUN: cp %S/Inputs/id.res.o %t.dir/id1.o
13 RUN: cp %S/Inputs/id.res.o %t.dir/id2.o
15 RUN: not lld-link /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.res 2>&1 | \
16 RUN: FileCheck -check-prefix=ERR %s
17 RUN: not lld-link /lldmingw /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.o 2>&1 | \
18 RUN: FileCheck -check-prefix=ERR %s
19 RUN: not lld-link /lldmingw /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.o %t.dir/id2.o 2>&1 | \
20 RUN: FileCheck -check-prefix=ERR %s
21 ERR: error: duplicate resource: type STRINGTABLE (ID 6)/name ID 3/language 1033, in {{.*}}id1.{{res|o}} and in {{.*}}id2.{{res|o}}
23 RUN: lld-link /force /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.res 2>&1 | \
24 RUN: FileCheck -check-prefix=WARN %s
25 RUN: lld-link /force:multipleres /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.res %t.dir/id2.res 2>&1 | \
26 RUN: FileCheck -check-prefix=WARN %s
27 RUN: lld-link /lldmingw /force:multipleres /machine:x64 /nodefaultlib /noentry /dll %t.dir/id1.o %t.dir/id2.o 2>&1 | \
28 RUN: FileCheck -check-prefix=WARN %s
29 WARN: warning: duplicate resource: type STRINGTABLE (ID 6)/name ID 3/language 1033, in {{.*}}id1.{{res|o}} and in {{.*}}id2.{{res|o}}