summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-05 17:25:12 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-05 17:25:12 +0000
commit6bcc22ce579050e48713c1a619b9d2c22312d2de (patch)
tree144149dc86946059319b5f0f2e30e5063f96612c /llvm/test
parentfc899e6f747ee34224d4ce937ad69e685030a769 (diff)
downloadbcm5719-llvm-6bcc22ce579050e48713c1a619b9d2c22312d2de.tar.gz
bcm5719-llvm-6bcc22ce579050e48713c1a619b9d2c22312d2de.zip
For PR1077:
Split this test case into three cases. globalredefinition.ll just tests that a global can be forward referenced. globalredefinition2.ll tests that llvm-upgrade will warn about renaming duplicate global variables. globalredefinition3.ll tests that llvm-as will generate an error on duplicate global variables. This last test is currently XFAIL because the restriction is not implemented yet. llvm-svn: 32910
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Feature/globalredefinition.ll4
-rw-r--r--llvm/test/Feature/globalredefinition2.ll6
-rw-r--r--llvm/test/Feature/globalredefinition3.ll9
3 files changed, 15 insertions, 4 deletions
diff --git a/llvm/test/Feature/globalredefinition.ll b/llvm/test/Feature/globalredefinition.ll
index e7b37eedc6d..642c093d163 100644
--- a/llvm/test/Feature/globalredefinition.ll
+++ b/llvm/test/Feature/globalredefinition.ll
@@ -4,12 +4,8 @@
; Test forward references and redefinitions of globals
-%Y = global void()* %X
-
%A = global int* %B
%B = global int 7
-%B = global int 7
-
declare void %X()
diff --git a/llvm/test/Feature/globalredefinition2.ll b/llvm/test/Feature/globalredefinition2.ll
new file mode 100644
index 00000000000..4e14b005334
--- /dev/null
+++ b/llvm/test/Feature/globalredefinition2.ll
@@ -0,0 +1,6 @@
+; Test that redefinitions of globals produces an error in llvm-upgrade
+; RUN: llvm-upgrade < %s -o /dev/null -f 2>&1 | \
+; RUN: grep "Global variable '%B' was renamed to '"
+
+%B = global int 7
+%B = global int 7
diff --git a/llvm/test/Feature/globalredefinition3.ll b/llvm/test/Feature/globalredefinition3.ll
new file mode 100644
index 00000000000..e89ca077448
--- /dev/null
+++ b/llvm/test/Feature/globalredefinition3.ll
@@ -0,0 +1,9 @@
+; When PR1067 is fixed, this should not be XFAIL any more.
+; RUN: llvm-as < %s -o /dev/null -f 2>&1 | \
+; RUN: grep 'Cannot redefine'
+; XFAIL: *
+
+; Test forward references and redefinitions of globals
+
+%B = global i32 7
+%B = global i32 7
OpenPOWER on IntegriCloud