aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Feature/globalredefinition.ll4
-rw-r--r--test/Feature/globalredefinition2.ll6
-rw-r--r--test/Feature/globalredefinition3.ll9
3 files changed, 15 insertions, 4 deletions
diff --git a/test/Feature/globalredefinition.ll b/test/Feature/globalredefinition.ll
index e7b37eedc6..642c093d16 100644
--- a/test/Feature/globalredefinition.ll
+++ b/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/test/Feature/globalredefinition2.ll b/test/Feature/globalredefinition2.ll
new file mode 100644
index 0000000000..4e14b00533
--- /dev/null
+++ b/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/test/Feature/globalredefinition3.ll b/test/Feature/globalredefinition3.ll
new file mode 100644
index 0000000000..e89ca07744
--- /dev/null
+++ b/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