OSDN Git Service

Add testcase for prev. commit. Minor fixes
authorAnton Korobeynikov <asl@math.spbu.ru>
Sat, 22 Mar 2008 08:37:05 +0000 (08:37 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sat, 22 Mar 2008 08:37:05 +0000 (08:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48686 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp
test/Verifier/aliasing-chain.ll [new file with mode: 0644]

index f6bc4b9..4bcfb1a 100644 (file)
@@ -379,9 +379,9 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) {
   }
 
   const GlobalValue* Aliasee = GA.resolveAliasedGlobal();
+  const GlobalValue* Aliasee = GA.resolveAliasedGlobal();
   Assert1(Aliasee,
-          "Aliasing chain should end with global function or global variable",
-          &GA);
+          "Aliasing chain should end with function or global variable", &GA);
 
   visitGlobalValue(GA);
 }
diff --git a/test/Verifier/aliasing-chain.ll b/test/Verifier/aliasing-chain.ll
new file mode 100644 (file)
index 0000000..53b929b
--- /dev/null
@@ -0,0 +1,6 @@
+; RUN:  not llvm-as -f %s -o /dev/null |& grep {Aliasing chain should end with function or global variable}
+
+; Test that alising chain does not create a cycle
+
+@b1 = alias i32* @c1
+@c1 = alias i32* @b1