[llvm] 0405e64 - [test] Reorganize test/Linker/comdat*.ll
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 28 10:11:21 PDT 2021
Author: Fangrui Song
Date: 2021-08-28T10:11:08-07:00
New Revision: 0405e6448355167f7815a01852e1446c8762001b
URL: https://github.com/llvm/llvm-project/commit/0405e6448355167f7815a01852e1446c8762001b
DIFF: https://github.com/llvm/llvm-project/commit/0405e6448355167f7815a01852e1446c8762001b.diff
LOG: [test] Reorganize test/Linker/comdat*.ll
Added:
llvm/test/Linker/comdat-any.ll
llvm/test/Linker/comdat-incompatible-kinds.ll
llvm/test/Linker/comdat-largest.ll
llvm/test/Linker/comdat-nodeduplicate.ll
llvm/test/Linker/comdat-nonprevailing-decl.ll
llvm/test/Linker/comdat-refer-to-discarded.ll
llvm/test/Linker/comdat-samesize.ll
llvm/test/Linker/comdat-size-err.ll
llvm/test/Linker/comdat-unneeded.ll
Modified:
Removed:
llvm/test/Linker/Inputs/comdat11.ll
llvm/test/Linker/Inputs/comdat13.ll
llvm/test/Linker/Inputs/comdat14.ll
llvm/test/Linker/Inputs/comdat15.ll
llvm/test/Linker/Inputs/comdat16.ll
llvm/test/Linker/Inputs/comdat2.ll
llvm/test/Linker/Inputs/comdat3.ll
llvm/test/Linker/Inputs/comdat4.ll
llvm/test/Linker/Inputs/comdat5.ll
llvm/test/Linker/Inputs/comdat8.ll
llvm/test/Linker/comdat10.ll
llvm/test/Linker/comdat11.ll
llvm/test/Linker/comdat12.ll
llvm/test/Linker/comdat13.ll
llvm/test/Linker/comdat14.ll
llvm/test/Linker/comdat15.ll
llvm/test/Linker/comdat16.ll
llvm/test/Linker/comdat2.ll
llvm/test/Linker/comdat4.ll
llvm/test/Linker/comdat5.ll
llvm/test/Linker/comdat6.ll
llvm/test/Linker/comdat7.ll
llvm/test/Linker/comdat8.ll
llvm/test/Linker/comdat9.ll
################################################################################
diff --git a/llvm/test/Linker/Inputs/comdat11.ll b/llvm/test/Linker/Inputs/comdat11.ll
deleted file mode 100644
index 5b7f74cf0b24..000000000000
--- a/llvm/test/Linker/Inputs/comdat11.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-$foo = comdat any
- at foo = global i8 1, comdat
-define void @zed() {
- call void @bar()
- ret void
-}
-define void @bar() comdat($foo) {
- ret void
-}
diff --git a/llvm/test/Linker/Inputs/comdat13.ll b/llvm/test/Linker/Inputs/comdat13.ll
deleted file mode 100644
index 85515210ed7e..000000000000
--- a/llvm/test/Linker/Inputs/comdat13.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-$foo = comdat any
- at foo = internal global i8 1, comdat
-define i8* @zed() {
- call void @bax()
- ret i8* @foo
-}
-define internal void @bax() comdat($foo) {
- ret void
-}
diff --git a/llvm/test/Linker/Inputs/comdat14.ll b/llvm/test/Linker/Inputs/comdat14.ll
deleted file mode 100644
index 5e79fbcdacc1..000000000000
--- a/llvm/test/Linker/Inputs/comdat14.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-$c = comdat any
-
- at v2 = weak dllexport global i32 0, comdat ($c)
-define i32* @f2() {
- ret i32* @v2
-}
-
- at v3 = weak alias i32, i32* @v2
-define i32* @f3() {
- ret i32* @v3
-}
-
diff --git a/llvm/test/Linker/Inputs/comdat15.ll b/llvm/test/Linker/Inputs/comdat15.ll
deleted file mode 100644
index 5d2d41bba6aa..000000000000
--- a/llvm/test/Linker/Inputs/comdat15.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-$a1 = comdat any
- at baz = private global i32 42, comdat($a1)
- at a1 = internal alias i32, i32* @baz
-define i32* @abc() {
- ret i32* @a1
-}
diff --git a/llvm/test/Linker/Inputs/comdat16.ll b/llvm/test/Linker/Inputs/comdat16.ll
deleted file mode 100644
index 7644e0e1ce9b..000000000000
--- a/llvm/test/Linker/Inputs/comdat16.ll
+++ /dev/null
@@ -1,26 +0,0 @@
-$c2 = comdat any
-$c1 = comdat any
-
-; This is only present in this file. The linker will keep $c1 from the first
-; file and this will be undefined.
- at will_be_undefined = global i32 1, comdat($c1)
- at use = global i32* @will_be_undefined
-
- at v1 = weak_odr global i32 41, comdat($c2)
-define weak_odr protected i32 @f1(i8* %this) comdat($c2) {
-bb20:
- store i8* %this, i8** null
- br label %bb21
-bb21:
- ret i32 41
-}
-
- at r21 = global i32* @v1
- at r22 = global i32(i8*)* @f1
-
- at a21 = alias i32, i32* @v1
- at a22 = alias i16, bitcast (i32* @v1 to i16*)
-
- at a23 = alias i32(i8*), i32(i8*)* @f1
- at a24 = alias i16, bitcast (i32(i8*)* @f1 to i16*)
- at a25 = alias i16, i16* @a24
diff --git a/llvm/test/Linker/Inputs/comdat2.ll b/llvm/test/Linker/Inputs/comdat2.ll
deleted file mode 100644
index ed2af6239cd8..000000000000
--- a/llvm/test/Linker/Inputs/comdat2.ll
+++ /dev/null
@@ -1,2 +0,0 @@
-$foo = comdat largest
- at foo = global i64 43, comdat($foo)
diff --git a/llvm/test/Linker/Inputs/comdat3.ll b/llvm/test/Linker/Inputs/comdat3.ll
deleted file mode 100644
index db066c2591f4..000000000000
--- a/llvm/test/Linker/Inputs/comdat3.ll
+++ /dev/null
@@ -1,2 +0,0 @@
-$foo = comdat nodeduplicate
- at foo = global i64 43, comdat($foo)
diff --git a/llvm/test/Linker/Inputs/comdat4.ll b/llvm/test/Linker/Inputs/comdat4.ll
deleted file mode 100644
index 5b4b812c7747..000000000000
--- a/llvm/test/Linker/Inputs/comdat4.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
-target triple = "i686-pc-windows-msvc"
-
-$foo = comdat samesize
- at foo = global i64 42, comdat($foo)
diff --git a/llvm/test/Linker/Inputs/comdat5.ll b/llvm/test/Linker/Inputs/comdat5.ll
deleted file mode 100644
index 236faaee0ae0..000000000000
--- a/llvm/test/Linker/Inputs/comdat5.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
-
-$foo = comdat largest
-
- at zed = external constant i8
- at some_name = private unnamed_addr constant [2 x i8*] [i8* @zed, i8* bitcast (void ()* @bar to i8*)], comdat($foo)
- at foo = alias i8*, getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
-
-declare void @bar() unnamed_addr
diff --git a/llvm/test/Linker/Inputs/comdat8.ll b/llvm/test/Linker/Inputs/comdat8.ll
deleted file mode 100644
index fbf099cb9aef..000000000000
--- a/llvm/test/Linker/Inputs/comdat8.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-$c1 = comdat largest
-
- at some_name = private unnamed_addr constant i32 42, comdat($c1)
- at c1 = alias i32, i32* @some_name
diff --git a/llvm/test/Linker/comdat-any.ll b/llvm/test/Linker/comdat-any.ll
new file mode 100644
index 000000000000..36935383b0c0
--- /dev/null
+++ b/llvm/test/Linker/comdat-any.ll
@@ -0,0 +1,136 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: llvm-link -S %t/1.ll %t/1-aux.ll -o - | FileCheck %s
+; RUN: llvm-link -S %t/2.ll %t/2-aux.ll -o - | FileCheck %s --check-prefix=CHECK2
+
+;; A private linkage variable can be copied.
+; RUN: llvm-link -S %t/3.ll %t/3-aux.ll -o - | FileCheck %s --check-prefix=CHECK3
+
+;--- 1.ll
+; CHECK: @foo = global i8 0, comdat
+
+; CHECK: define void @zed() {
+; CHECK: call void @bar()
+; CHECK: ret void
+; CHECK: }
+
+; CHECK: declare void @bar()
+
+$foo = comdat any
+ at foo = global i8 0, comdat
+
+;--- 1-aux.ll
+$foo = comdat any
+ at foo = global i8 1, comdat
+define void @zed() {
+ call void @bar()
+ ret void
+}
+define void @bar() comdat($foo) {
+ ret void
+}
+
+;--- 2.ll
+$c1 = comdat any
+
+ at v1 = weak_odr global i32 42, comdat($c1)
+define weak_odr i32 @f1(i8*) comdat($c1) {
+bb10:
+ br label %bb11
+bb11:
+ ret i32 42
+}
+
+ at r11 = global i32* @v1
+ at r12 = global i32 (i8*)* @f1
+
+ at a11 = alias i32, i32* @v1
+ at a12 = alias i16, bitcast (i32* @v1 to i16*)
+
+ at a13 = alias i32 (i8*), i32 (i8*)* @f1
+ at a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
+ at a15 = alias i16, i16* @a14
+
+; CHECK2: $c1 = comdat any
+; CHECK2: $c2 = comdat any
+
+; CHECK2-DAG: @will_be_undefined = external global i32
+
+; CHECK2-DAG: @v1 = weak_odr global i32 42, comdat($c1)
+
+; CHECK2-DAG: @r11 = global i32* @v1{{$}}
+; CHECK2-DAG: @r12 = global i32 (i8*)* @f1{{$}}
+
+; CHECK2-DAG: @r21 = global i32* @v1{{$}}
+; CHECK2-DAG: @r22 = global i32 (i8*)* @f1{{$}}
+
+; CHECK2-DAG: @v1.1 = internal global i32 41, comdat($c2)
+
+; CHECK2-DAG: @a11 = alias i32, i32* @v1{{$}}
+; CHECK2-DAG: @a12 = alias i16, bitcast (i32* @v1 to i16*)
+
+; CHECK2-DAG: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
+; CHECK2-DAG: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
+
+; CHECK2-DAG: @a21 = alias i32, i32* @v1.1{{$}}
+; CHECK2-DAG: @a22 = alias i16, bitcast (i32* @v1.1 to i16*)
+
+; CHECK2-DAG: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}}
+; CHECK2-DAG: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*)
+
+; CHECK2: define weak_odr protected i32 @f1(i8* %0) comdat($c1) {
+; CHECK2-NEXT: bb10:
+; CHECK2-NEXT: br label %bb11{{$}}
+; CHECK2: bb11:
+; CHECK2-NEXT: ret i32 42
+; CHECK2-NEXT: }
+
+; CHECK2: define internal i32 @f1.2(i8* %this) comdat($c2) {
+; CHECK2-NEXT: bb20:
+; CHECK2-NEXT: store i8* %this, i8** null
+; CHECK2-NEXT: br label %bb21
+; CHECK2: bb21:
+; CHECK2-NEXT: ret i32 41
+; CHECK2-NEXT: }
+
+;--- 2-aux.ll
+$c2 = comdat any
+$c1 = comdat any
+
+; This is only present in this file. The linker will keep $c1 from the first
+; file and this will be undefined.
+ at will_be_undefined = global i32 1, comdat($c1)
+ at use = global i32* @will_be_undefined
+
+ at v1 = weak_odr global i32 41, comdat($c2)
+define weak_odr protected i32 @f1(i8* %this) comdat($c2) {
+bb20:
+ store i8* %this, i8** null
+ br label %bb21
+bb21:
+ ret i32 41
+}
+
+ at r21 = global i32* @v1
+ at r22 = global i32(i8*)* @f1
+
+ at a21 = alias i32, i32* @v1
+ at a22 = alias i16, bitcast (i32* @v1 to i16*)
+
+ at a23 = alias i32(i8*), i32(i8*)* @f1
+ at a24 = alias i16, bitcast (i32(i8*)* @f1 to i16*)
+ at a25 = alias i16, i16* @a24
+
+;--- 3.ll
+; CHECK3: @bar = global i32 0, comdat($a1)
+; CHECK3: @baz = private global i32 42, comdat($a1)
+; CHECK3: @a1 = internal alias i32, i32* @baz
+$a1 = comdat any
+ at bar = global i32 0, comdat($a1)
+
+;--- 3-aux.ll
+$a1 = comdat any
+ at baz = private global i32 42, comdat($a1)
+ at a1 = internal alias i32, i32* @baz
+define i32* @abc() {
+ ret i32* @a1
+}
diff --git a/llvm/test/Linker/comdat2.ll b/llvm/test/Linker/comdat-incompatible-kinds.ll
similarity index 100%
rename from llvm/test/Linker/comdat2.ll
rename to llvm/test/Linker/comdat-incompatible-kinds.ll
diff --git a/llvm/test/Linker/comdat-largest.ll b/llvm/test/Linker/comdat-largest.ll
new file mode 100644
index 000000000000..975bf375e9ae
--- /dev/null
+++ b/llvm/test/Linker/comdat-largest.ll
@@ -0,0 +1,57 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: llvm-link %t/1.ll -S -o - | FileCheck %s --check-prefix=CHECK1
+;; The source doesn't have comdat.
+; RUN: llvm-link %t/2.ll -S -o - | FileCheck %s --check-prefix=CHECK2
+
+;; The leader is an alias.
+; RUN: llvm-link %t/3.ll %t/3-aux.ll -S -o - | FileCheck %s
+; RUN: llvm-link %t/3-aux.ll %t/3.ll -S -o - | FileCheck %s
+
+;--- 1.ll
+$c = comdat any
+ at a = alias void (), void ()* @f
+define internal void @f() comdat($c) {
+ ret void
+}
+
+; CHECK1-DAG: $c = comdat any
+; CHECK1-DAG: @a = alias void (), void ()* @f
+; CHECK1-DAG: define internal void @f() comdat($c)
+
+$f2 = comdat largest
+define linkonce_odr void @f2() comdat($f2) {
+ ret void
+}
+define void @f3() comdat($f2) {
+ ret void
+}
+
+; CHECK1-DAG: $f2 = comdat largest
+; CHECK1-DAG: define linkonce_odr void @f2()
+
+;--- 2.ll
+$c = comdat largest
+
+; CHECK2: @c = global i32 0, comdat
+ at c = global i32 0, comdat
+
+;--- 3.ll
+target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+
+$foo = comdat largest
+ at foo = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @bar to i8*)], comdat($foo)
+
+; CHECK: @foo = alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
+
+declare void @bar() unnamed_addr
+
+;--- 3-aux.ll
+target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+
+$foo = comdat largest
+
+ at zed = external constant i8
+ at some_name = private unnamed_addr constant [2 x i8*] [i8* @zed, i8* bitcast (void ()* @bar to i8*)], comdat($foo)
+ at foo = alias i8*, getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
+
+declare void @bar() unnamed_addr
diff --git a/llvm/test/Linker/comdat-nodeduplicate.ll b/llvm/test/Linker/comdat-nodeduplicate.ll
new file mode 100644
index 000000000000..ae59909e9250
--- /dev/null
+++ b/llvm/test/Linker/comdat-nodeduplicate.ll
@@ -0,0 +1,11 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: not llvm-link %t/1.ll %t/1-aux.ll -S -o - 2>&1 | FileCheck %s
+
+;--- 1.ll
+$foo = comdat nodeduplicate
+ at foo = global i64 43, comdat($foo)
+; CHECK: Linking COMDATs named 'foo': nodeduplicate has been violated!
+
+;--- 1-aux.ll
+$foo = comdat nodeduplicate
+ at foo = global i64 43, comdat($foo)
diff --git a/llvm/test/Linker/comdat-nonprevailing-decl.ll b/llvm/test/Linker/comdat-nonprevailing-decl.ll
new file mode 100644
index 000000000000..4eca915534ce
--- /dev/null
+++ b/llvm/test/Linker/comdat-nonprevailing-decl.ll
@@ -0,0 +1,25 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: llvm-link -S %t/1.ll %t/1-aux.ll -o - | FileCheck %s
+
+;--- 1.ll
+$c = comdat any
+
+ at v = global i32 0, comdat ($c)
+
+; CHECK: @v = global i32 0, comdat($c)
+; CHECK: @v3 = external global i32
+; CHECK: @v2 = external dllexport global i32
+
+;--- 1-aux.ll
+$c = comdat any
+
+ at v2 = weak dllexport global i32 0, comdat ($c)
+define i32* @f2() {
+ ret i32* @v2
+}
+
+ at v3 = weak alias i32, i32* @v2
+define i32* @f3() {
+ ret i32* @v3
+}
+
diff --git a/llvm/test/Linker/comdat13.ll b/llvm/test/Linker/comdat-refer-to-discarded.ll
similarity index 66%
rename from llvm/test/Linker/comdat13.ll
rename to llvm/test/Linker/comdat-refer-to-discarded.ll
index d1e382a2f278..9250469df1bb 100644
--- a/llvm/test/Linker/comdat13.ll
+++ b/llvm/test/Linker/comdat-refer-to-discarded.ll
@@ -1,6 +1,8 @@
-; RUN: llvm-link -S %s %p/Inputs/comdat13.ll -o - | FileCheck %s
+; RUN: rm -rf %t && split-file %s %t
+; RUN: llvm-link -S %t/1.ll %t/1-aux.ll -o - | FileCheck %s
-; In Inputs/comdat13.ll a function not in the $foo comdat (zed) references an
+;--- 1.ll
+; In 1-aux.ll a function not in the $foo comdat (zed) references an
; internal function in the comdat $foo.
; The IR would be ilegal on ELF ("relocation refers to discarded section"),
; but COFF linkers seem to just duplicate the comdat.
@@ -28,3 +30,14 @@ define i8* @bar() {
; CHECK: define internal void @bax() comdat($foo) {
; CHECK-NEXT: ret void
; CHECK-NEXT: }
+
+;--- 1-aux.ll
+$foo = comdat any
+ at foo = internal global i8 1, comdat
+define i8* @zed() {
+ call void @bax()
+ ret i8* @foo
+}
+define internal void @bax() comdat($foo) {
+ ret void
+}
diff --git a/llvm/test/Linker/comdat-samesize.ll b/llvm/test/Linker/comdat-samesize.ll
new file mode 100644
index 000000000000..b117f9308b3e
--- /dev/null
+++ b/llvm/test/Linker/comdat-samesize.ll
@@ -0,0 +1,17 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: not llvm-link %t/
diff -size.ll %t/
diff -size-aux.ll -S -o - 2>&1 | FileCheck %s --check-prefix=DIFF_SIZE
+
+;---
diff -size.ll
+; DIFF_SIZE: Linking COMDATs named 'foo': SameSize violated!
+target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+target triple = "i686-pc-windows-msvc"
+
+$foo = comdat samesize
+ at foo = global i32 42, comdat($foo)
+
+;---
diff -size-aux.ll
+target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+target triple = "i686-pc-windows-msvc"
+
+$foo = comdat samesize
+ at foo = global i64 42, comdat($foo)
diff --git a/llvm/test/Linker/comdat-size-err.ll b/llvm/test/Linker/comdat-size-err.ll
new file mode 100644
index 000000000000..0222e84620fd
--- /dev/null
+++ b/llvm/test/Linker/comdat-size-err.ll
@@ -0,0 +1,24 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: not llvm-link %t/non-variable.ll %t/non-variable.ll -S -o - 2>&1 | FileCheck %s --check-prefix=NONVARIABLE
+; RUN: not llvm-link %t/no-base-object.ll %t/no-base-object-aux.ll -S -o - 2>&1 | FileCheck %s --check-prefix=NOSIZE
+
+;--- non-variable.ll
+; NONVARIABLE: GlobalVariable required for data dependent selection!
+$c1 = comdat largest
+
+define void @c1() comdat($c1) {
+ ret void
+}
+
+;--- no-base-object.ll
+; NOSIZE: COMDAT key involves incomputable alias size.
+$c1 = comdat largest
+
+ at some_name = unnamed_addr constant i32 42, comdat($c1)
+ at c1 = alias i8, inttoptr (i32 1 to i8*)
+
+;--- no-base-object-aux.ll
+$c1 = comdat largest
+
+ at some_name = private unnamed_addr constant i32 42, comdat($c1)
+ at c1 = alias i32, i32* @some_name
diff --git a/llvm/test/Linker/comdat12.ll b/llvm/test/Linker/comdat-unneeded.ll
similarity index 100%
rename from llvm/test/Linker/comdat12.ll
rename to llvm/test/Linker/comdat-unneeded.ll
diff --git a/llvm/test/Linker/comdat10.ll b/llvm/test/Linker/comdat10.ll
deleted file mode 100644
index 8a32c4267393..000000000000
--- a/llvm/test/Linker/comdat10.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: llvm-link %s /dev/null -S -o - | FileCheck %s
-
-$c = comdat largest
-
-; CHECK: @c = global i32 0, comdat
- at c = global i32 0, comdat
diff --git a/llvm/test/Linker/comdat11.ll b/llvm/test/Linker/comdat11.ll
deleted file mode 100644
index dbade4104fe3..000000000000
--- a/llvm/test/Linker/comdat11.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: llvm-link -S %s %p/Inputs/comdat11.ll -o - | FileCheck %s
-
-$foo = comdat any
- at foo = global i8 0, comdat
-
-; CHECK: @foo = global i8 0, comdat
-
-; CHECK: define void @zed() {
-; CHECK: call void @bar()
-; CHECK: ret void
-; CHECK: }
-
-; CHECK: declare void @bar()
diff --git a/llvm/test/Linker/comdat14.ll b/llvm/test/Linker/comdat14.ll
deleted file mode 100644
index 1a1ba47aa017..000000000000
--- a/llvm/test/Linker/comdat14.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-link -S %s %p/Inputs/comdat14.ll -o - | FileCheck %s
-
-$c = comdat any
-
- at v = global i32 0, comdat ($c)
-
-; CHECK: @v = global i32 0, comdat($c)
-; CHECK: @v3 = external global i32
-; CHECK: @v2 = external dllexport global i32
diff --git a/llvm/test/Linker/comdat15.ll b/llvm/test/Linker/comdat15.ll
deleted file mode 100644
index cf900263105a..000000000000
--- a/llvm/test/Linker/comdat15.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-link -S %s %p/Inputs/comdat15.ll -o - | FileCheck %s
-
-$a1 = comdat any
- at bar = global i32 0, comdat($a1)
-
-; CHECK: @bar = global i32 0, comdat($a1)
-; CHECK: @baz = private global i32 42, comdat($a1)
-; CHECK: @a1 = internal alias i32, i32* @baz
-
diff --git a/llvm/test/Linker/comdat16.ll b/llvm/test/Linker/comdat16.ll
deleted file mode 100644
index f7143228dd97..000000000000
--- a/llvm/test/Linker/comdat16.ll
+++ /dev/null
@@ -1,63 +0,0 @@
-; RUN: llvm-link -S -o - %s %p/Inputs/comdat16.ll | FileCheck %s
-
-$c1 = comdat any
-
- at v1 = weak_odr global i32 42, comdat($c1)
-define weak_odr i32 @f1(i8*) comdat($c1) {
-bb10:
- br label %bb11
-bb11:
- ret i32 42
-}
-
- at r11 = global i32* @v1
- at r12 = global i32 (i8*)* @f1
-
- at a11 = alias i32, i32* @v1
- at a12 = alias i16, bitcast (i32* @v1 to i16*)
-
- at a13 = alias i32 (i8*), i32 (i8*)* @f1
- at a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
- at a15 = alias i16, i16* @a14
-
-; CHECK: $c1 = comdat any
-; CHECK: $c2 = comdat any
-
-; CHECK-DAG: @will_be_undefined = external global i32
-
-; CHECK-DAG: @v1 = weak_odr global i32 42, comdat($c1)
-
-; CHECK-DAG: @r11 = global i32* @v1{{$}}
-; CHECK-DAG: @r12 = global i32 (i8*)* @f1{{$}}
-
-; CHECK-DAG: @r21 = global i32* @v1{{$}}
-; CHECK-DAG: @r22 = global i32 (i8*)* @f1{{$}}
-
-; CHECK-DAG: @v1.1 = internal global i32 41, comdat($c2)
-
-; CHECK-DAG: @a11 = alias i32, i32* @v1{{$}}
-; CHECK-DAG: @a12 = alias i16, bitcast (i32* @v1 to i16*)
-
-; CHECK-DAG: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
-; CHECK-DAG: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
-
-; CHECK-DAG: @a21 = alias i32, i32* @v1.1{{$}}
-; CHECK-DAG: @a22 = alias i16, bitcast (i32* @v1.1 to i16*)
-
-; CHECK-DAG: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}}
-; CHECK-DAG: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*)
-
-; CHECK: define weak_odr protected i32 @f1(i8* %0) comdat($c1) {
-; CHECK-NEXT: bb10:
-; CHECK-NEXT: br label %bb11{{$}}
-; CHECK: bb11:
-; CHECK-NEXT: ret i32 42
-; CHECK-NEXT: }
-
-; CHECK: define internal i32 @f1.2(i8* %this) comdat($c2) {
-; CHECK-NEXT: bb20:
-; CHECK-NEXT: store i8* %this, i8** null
-; CHECK-NEXT: br label %bb21
-; CHECK: bb21:
-; CHECK-NEXT: ret i32 41
-; CHECK-NEXT: }
diff --git a/llvm/test/Linker/comdat4.ll b/llvm/test/Linker/comdat4.ll
deleted file mode 100644
index c0af43a516b5..000000000000
--- a/llvm/test/Linker/comdat4.ll
+++ /dev/null
@@ -1,5 +0,0 @@
-; RUN: not llvm-link %s %p/Inputs/comdat3.ll -S -o - 2>&1 | FileCheck %s
-
-$foo = comdat nodeduplicate
- at foo = global i64 43, comdat($foo)
-; CHECK: Linking COMDATs named 'foo': nodeduplicate has been violated!
diff --git a/llvm/test/Linker/comdat5.ll b/llvm/test/Linker/comdat5.ll
deleted file mode 100644
index 759688ee47ea..000000000000
--- a/llvm/test/Linker/comdat5.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: not llvm-link %s %p/Inputs/comdat4.ll -S -o - 2>&1 | FileCheck %s
-target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
-target triple = "i686-pc-windows-msvc"
-
-$foo = comdat samesize
- at foo = global i32 42, comdat($foo)
-; CHECK: Linking COMDATs named 'foo': SameSize violated!
diff --git a/llvm/test/Linker/comdat6.ll b/llvm/test/Linker/comdat6.ll
deleted file mode 100644
index 3dcc9e3b29d7..000000000000
--- a/llvm/test/Linker/comdat6.ll
+++ /dev/null
@@ -1,10 +0,0 @@
-; RUN: llvm-link %s %p/Inputs/comdat5.ll -S -o - | FileCheck %s
-; RUN: llvm-link %p/Inputs/comdat5.ll %s -S -o - | FileCheck %s
-target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
-
-$foo = comdat largest
- at foo = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @bar to i8*)], comdat($foo)
-
-; CHECK: @foo = alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
-
-declare void @bar() unnamed_addr
diff --git a/llvm/test/Linker/comdat7.ll b/llvm/test/Linker/comdat7.ll
deleted file mode 100644
index ef938a706bf8..000000000000
--- a/llvm/test/Linker/comdat7.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: not llvm-link %s %s -S -o - 2>&1 | FileCheck %s
-
-$c1 = comdat largest
-
-define void @c1() comdat($c1) {
- ret void
-}
-; CHECK: GlobalVariable required for data dependent selection!
diff --git a/llvm/test/Linker/comdat8.ll b/llvm/test/Linker/comdat8.ll
deleted file mode 100644
index f7aa3117de1e..000000000000
--- a/llvm/test/Linker/comdat8.ll
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: not llvm-link %s %p/Inputs/comdat8.ll -S -o - 2>&1 | FileCheck %s
-
-$c1 = comdat largest
-
- at some_name = unnamed_addr constant i32 42, comdat($c1)
- at c1 = alias i8, inttoptr (i32 1 to i8*)
-
-; CHECK: COMDAT key involves incomputable alias size.
diff --git a/llvm/test/Linker/comdat9.ll b/llvm/test/Linker/comdat9.ll
deleted file mode 100644
index 6f177e64bbe7..000000000000
--- a/llvm/test/Linker/comdat9.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: llvm-link %s -S -o - | FileCheck %s
-
-$c = comdat any
- at a = alias void (), void ()* @f
-define internal void @f() comdat($c) {
- ret void
-}
-
-; CHECK-DAG: $c = comdat any
-; CHECK-DAG: @a = alias void (), void ()* @f
-; CHECK-DAG: define internal void @f() comdat($c)
-
-$f2 = comdat largest
-define linkonce_odr void @f2() comdat($f2) {
- ret void
-}
-define void @f3() comdat($f2) {
- ret void
-}
-
-; CHECK-DAG: $f2 = comdat largest
-; CHECK-DAG: define linkonce_odr void @f2()
More information about the llvm-commits
mailing list