summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-10-26 18:47:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-10-26 18:47:48 +0000
commite5551ed9cec1ae777c4e4b8852a1d7842c2e1c3d (patch)
treeb1d115aa6a3dc373465e36d381e147ada50e1b03 /test
parent276c43f022fa4a84a7c69b3d68a58e8613f69e47 (diff)
downloadllvm-e5551ed9cec1ae777c4e4b8852a1d7842c2e1c3d.tar.gz
llvm-e5551ed9cec1ae777c4e4b8852a1d7842c2e1c3d.tar.bz2
llvm-e5551ed9cec1ae777c4e4b8852a1d7842c2e1c3d.tar.xz
Change the internalize pass to internalize all symbols when given an empty
list of externals. This makes sense since a shared library with no symbols can still be useful if it has static constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Other/link-opts.ll13
-rw-r--r--test/Transforms/Internalize/2008-05-09-AllButMain.ll9
-rw-r--r--test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll2
3 files changed, 19 insertions, 5 deletions
diff --git a/test/Other/link-opts.ll b/test/Other/link-opts.ll
new file mode 100644
index 0000000000..8e58ac8a56
--- /dev/null
+++ b/test/Other/link-opts.ll
@@ -0,0 +1,13 @@
+;RUN: opt -S -std-link-opts < %s | FileCheck %s
+; Simple test to check that -std-link-opts keeps only the main function.
+
+; CHECK-NOT: define
+; CHECK: define void @main
+; CHECK-NOT: define
+define void @main() {
+ ret void
+}
+
+define void @foo() {
+ ret void
+}
diff --git a/test/Transforms/Internalize/2008-05-09-AllButMain.ll b/test/Transforms/Internalize/2008-05-09-AllButMain.ll
index 1101f997d7..c07abb0c63 100644
--- a/test/Transforms/Internalize/2008-05-09-AllButMain.ll
+++ b/test/Transforms/Internalize/2008-05-09-AllButMain.ll
@@ -1,10 +1,11 @@
-; No arguments means internalize all but main
+; No arguments means internalize everything
; RUN: opt < %s -internalize -S | FileCheck --check-prefix=NOARGS %s
; Internalize all but foo and j
; RUN: opt < %s -internalize -internalize-public-api-list foo -internalize-public-api-list j -S | FileCheck --check-prefix=LIST %s
-; Non existent files should be treated as if they were empty (so internalize all but main)
+; Non existent files should be treated as if they were empty (so internalize
+; everything)
; RUN: opt < %s -internalize -internalize-public-api-file /nonexistent/file 2> /dev/null -S | FileCheck --check-prefix=EMPTYFILE %s
; RUN: opt < %s -S -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file 2> /dev/null | FileCheck --check-prefix=LIST2 %s
@@ -26,9 +27,9 @@
; MERGE: @j = global
@j = global i32 0
-; NOARGS: define void @main
+; NOARGS: define internal void @main
; LIST: define internal void @main
-; EMPTYFILE: define void @main
+; EMPTYFILE: define internal void @main
; LIST2: define internal void @main
; MERGE: define internal void @main
define void @main() {
diff --git a/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll b/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll
index 7b18a04e11..47cf3f0373 100644
--- a/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll
+++ b/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -internalize -S | grep internal | count 3
+; RUN: opt < %s -internalize -internalize-public-api-list main -S | grep internal | count 3
@A = global i32 0
@B = alias i32* @A