1# REQUIRES: x86
2
3# Tests handling of several comdats with "largest" selection type that each
4# has an associative comdat.
5
6# Create obj files.
7# RUN: sed -e s/TYPE/.byte/  -e s/SIZE/1/ %s | llvm-mc -triple x86_64-pc-win32 -filetype=obj -o %t.1.obj
8# RUN: sed -e s/TYPE/.short/ -e s/SIZE/2/ %s | llvm-mc -triple x86_64-pc-win32 -filetype=obj -o %t.2.obj
9# RUN: sed -e s/TYPE/.long/  -e s/SIZE/4/ %s | llvm-mc -triple x86_64-pc-win32 -filetype=obj -o %t.4.obj
10
11        .section .text$ac, "", associative, symbol
12assocsym:
13        .long SIZE
14
15        .section .text$nm, "", largest, symbol
16        .globl symbol
17symbol:
18        TYPE SIZE
19
20# Pass the obj files in different orders and check that only the associative
21# comdat of the largest obj file makes it into the output, independent of
22# the order of the obj files on the command line.
23
24# FIXME: Make these pass when /opt:noref is passed.
25
26# RUN: lld-link /include:symbol /dll /noentry /nodefaultlib %t.1.obj %t.2.obj %t.4.obj /out:%t.exe
27# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=ALL124 %s
28# ALL124: Contents of section .text:
29# ALL124:   180001000 04000000 04000000 ....
30
31# RUN: lld-link /include:symbol /dll /noentry /nodefaultlib %t.4.obj %t.2.obj %t.1.obj /out:%t.exe
32# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=ALL421 %s
33# ALL421: Contents of section .text:
34# ALL421:   180001000 04000000 04000000 ....
35
36# RUN: lld-link /include:symbol /dll /noentry /nodefaultlib %t.2.obj %t.4.obj %t.1.obj /out:%t.exe
37# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=ALL241 %s
38# ALL241: Contents of section .text:
39# ALL241:   180001000 04000000 04000000 ....
40
41# RUN: lld-link /include:symbol /dll /noentry /nodefaultlib %t.2.obj %t.1.obj /out:%t.exe
42# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=JUST21 %s
43# JUST21: Contents of section .text:
44# JUST21:   180001000 02000000 0200 ....
45
46