From: Christopher Lamb Date: Tue, 18 Dec 2007 03:49:35 +0000 (+0000) Subject: Don't forget to print address space qualifiers when printing out the type table!... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=ef989a275c1191f583178c6934f3594e7a9fd3a6 Don't forget to print address space qualifiers when printing out the type table! Thanks to Gordon Henriksen for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45147 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index e35b14fbc1a..090276b7ffa 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -808,7 +808,10 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { if (STy->isPacked()) Out << '>'; } else if (const PointerType *PTy = dyn_cast(Ty)) { - printType(PTy->getElementType()) << '*'; + printType(PTy->getElementType()); + if (unsigned AddressSpace = PTy->getAddressSpace()) + Out << " addrspace(" << AddressSpace << ")"; + Out << '*'; } else if (const ArrayType *ATy = dyn_cast(Ty)) { Out << '[' << ATy->getNumElements() << " x "; printType(ATy->getElementType()) << ']'; diff --git a/test/Bindings/Ocaml/vmcore.ml b/test/Bindings/Ocaml/vmcore.ml index 33a1980f2f4..65d8a316e9c 100644 --- a/test/Bindings/Ocaml/vmcore.ml +++ b/test/Bindings/Ocaml/vmcore.ml @@ -114,7 +114,7 @@ let test_types () = end; begin group "qualified_pointer"; - (* XXX: grep {QualPtrTy.*i8.*3.*\*} < %t.ll + (* RUN: grep {QualPtrTy.*i8.*3.*\*} < %t.ll *) let ty = qualified_pointer_type i8_type 3 in insist (define_type_name "QualPtrTy" ty m);