xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/coff-comdat.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple i386-pc-win32 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker$f1 = comdat any
4*9880d681SAndroid Build Coastguard Worker@v1 = global i32 0, comdat($f1)
5*9880d681SAndroid Build Coastguard Workerdefine void @f1() comdat($f1) {
6*9880d681SAndroid Build Coastguard Worker  ret void
7*9880d681SAndroid Build Coastguard Worker}
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker$f2 = comdat exactmatch
10*9880d681SAndroid Build Coastguard Worker@v2 = global i32 0, comdat($f2)
11*9880d681SAndroid Build Coastguard Workerdefine void @f2() comdat($f2) {
12*9880d681SAndroid Build Coastguard Worker  ret void
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker$f3 = comdat largest
16*9880d681SAndroid Build Coastguard Worker@v3 = global i32 0, comdat($f3)
17*9880d681SAndroid Build Coastguard Workerdefine void @f3() comdat($f3) {
18*9880d681SAndroid Build Coastguard Worker  ret void
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker$f4 = comdat noduplicates
22*9880d681SAndroid Build Coastguard Worker@v4 = global i32 0, comdat($f4)
23*9880d681SAndroid Build Coastguard Workerdefine void @f4() comdat($f4) {
24*9880d681SAndroid Build Coastguard Worker  ret void
25*9880d681SAndroid Build Coastguard Worker}
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker$f5 = comdat samesize
28*9880d681SAndroid Build Coastguard Worker@v5 = global i32 0, comdat($f5)
29*9880d681SAndroid Build Coastguard Workerdefine void @f5() comdat($f5) {
30*9880d681SAndroid Build Coastguard Worker  ret void
31*9880d681SAndroid Build Coastguard Worker}
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker$f6 = comdat samesize
34*9880d681SAndroid Build Coastguard Worker@v6 = global i32 0, comdat($f6)
35*9880d681SAndroid Build Coastguard Worker@f6 = global i32 0, comdat($f6)
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker$"\01@f7@0" = comdat any
38*9880d681SAndroid Build Coastguard Workerdefine x86_fastcallcc void @"\01@v7@0"() comdat($"\01@f7@0") {
39*9880d681SAndroid Build Coastguard Worker  ret void
40*9880d681SAndroid Build Coastguard Worker}
41*9880d681SAndroid Build Coastguard Workerdefine x86_fastcallcc void @"\01@f7@0"() comdat($"\01@f7@0") {
42*9880d681SAndroid Build Coastguard Worker  ret void
43*9880d681SAndroid Build Coastguard Worker}
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker$f8 = comdat any
46*9880d681SAndroid Build Coastguard Workerdefine x86_fastcallcc void @v8() comdat($f8) {
47*9880d681SAndroid Build Coastguard Worker  ret void
48*9880d681SAndroid Build Coastguard Worker}
49*9880d681SAndroid Build Coastguard Workerdefine x86_fastcallcc void @f8() comdat($f8) {
50*9880d681SAndroid Build Coastguard Worker  ret void
51*9880d681SAndroid Build Coastguard Worker}
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Worker$vftable = comdat largest
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker@some_name = private unnamed_addr constant [2 x i8*] zeroinitializer, comdat($vftable)
56*9880d681SAndroid Build Coastguard Worker@vftable = alias i8*, getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",discard,_f1
59*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _f1
60*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",same_contents,_f2
61*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _f2
62*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",largest,_f3
63*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _f3
64*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",one_only,_f4
65*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _f4
66*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",same_size,_f5
67*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _f5
68*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",associative,@f7@0
69*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  @v7@0
70*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",discard,@f7@0
71*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  @f7@0
72*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",associative,@f8@0
73*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  @v8@0
74*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .text,"xr",discard,@f8@0
75*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  @f8@0
76*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",associative,_f1
77*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _v1
78*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",associative,_f2
79*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _v2
80*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",associative,_f3
81*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _v3
82*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",associative,_f4
83*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _v4
84*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",associative,_f5
85*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _v5
86*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",associative,_f6
87*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _v6
88*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .bss,"bw",same_size,_f6
89*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _f6
90*9880d681SAndroid Build Coastguard Worker; CHECK: .section        .rdata,"dr",largest,_vftable
91*9880d681SAndroid Build Coastguard Worker; CHECK: .globl  _vftable
92*9880d681SAndroid Build Coastguard Worker; CHECK: _vftable = L_some_name+4
93