xref: /llvm-project/lld/test/COFF/lto-comdat-samesize.ll (revision d07f43641f98a8e0024cf8e94ef98c7c912221d9)
1; REQUIRES: x86
2
3; RUN: split-file %s %t.dir
4; RUN: llvm-as %t.dir/other.ll -o %t.other.bc
5; RUN: llc -filetype=obj -o %t.main.obj %t.dir/main.ll
6
7; RUN: lld-link -out:%t.exe -subsystem:console %t.other.bc %t.main.obj
8
9#--- main.ll
10target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
11target triple = "x86_64-unknown-windows-msvc19.14.0"
12
13$comdatData = comdat samesize
14
15@comdatData = weak_odr dso_local global i32 42, comdat
16
17define dso_local void @mainCRTStartup() {
18entry:
19  tail call void @other()
20  ret void
21}
22
23declare dso_local void @other()
24
25#--- other.ll
26target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
27target triple = "x86_64-unknown-windows-msvc19.14.0"
28
29$comdatData = comdat samesize
30
31@comdatData = weak_odr dso_local global i32 42, comdat
32
33define dso_local void @other() {
34entry:
35  ret void
36}
37