For PR1077:
authorReid Spencer <rspencer@reidspencer.com>
Fri, 5 Jan 2007 17:25:12 +0000 (17:25 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 5 Jan 2007 17:25:12 +0000 (17:25 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32910 91177308-0d34-0410-b5e6-96231b3b80d8

test/Feature/globalredefinition.ll
test/Feature/globalredefinition2.ll [new file with mode: 0644]
test/Feature/globalredefinition3.ll [new file with mode: 0644]

index e7b37eedc6d8cdaaac849f606dafc7f1779b0eec..642c093d163c945436b851baee3fc50e4fabba7a 100644 (file)
@@ -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 (file)
index 0000000..4e14b00
--- /dev/null
@@ -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 (file)
index 0000000..e89ca07
--- /dev/null
@@ -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