diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index aba66c85a76..a2de5d99a05 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1003,6 +1003,9 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) { Out << getLLVMName(F->getName(), GlobalPrefix); else Out << "@\"\""; + } else if (const GlobalAlias *GA = dyn_cast(Aliasee)) { + printType(GA->getType()); + Out << " " << getLLVMName(GA->getName(), GlobalPrefix); } else { const ConstantExpr *CE = 0; if ((CE = dyn_cast(Aliasee)) && diff --git a/test/Feature/aliases.ll b/test/Feature/aliases.ll index fc5e7685ca6..d44dff4c43c 100644 --- a/test/Feature/aliases.ll +++ b/test/Feature/aliases.ll @@ -5,11 +5,13 @@ @bar = external global i32 @foo1 = alias i32* @bar @foo2 = alias i32* @bar +@foo3 = alias i32* @foo2 %FunTy = type i32() declare i32 @foo_f() @bar_f = alias weak %FunTy* @foo_f +@bar_ff = alias i32()* @bar_f @bar_i = alias internal i32* @bar