assert(false && "Should never jump to an attribute block");
return QualType();
- case pch::TYPE_EXT_QUAL:
- // FIXME: Deserialize ExtQualType
- assert(false && "Cannot deserialize qualified types yet");
- return QualType();
+ case pch::TYPE_EXT_QUAL: {
+ assert(Record.size() == 3 &&
+ "Incorrect encoding of extended qualifier type");
+ QualType Base = GetType(Record[0]);
+ QualType::GCAttrTypes GCAttr = (QualType::GCAttrTypes)Record[1];
+ unsigned AddressSpace = Record[2];
+
+ QualType T = Base;
+ if (GCAttr != QualType::GCNone)
+ T = Context.getObjCGCQualType(T, GCAttr);
+ if (AddressSpace)
+ T = Context.getAddrSpaceQualType(T, AddressSpace);
+ return T;
+ }
case pch::TYPE_FIXED_WIDTH_INT: {
assert(Record.size() == 2 && "Incorrect encoding of fixed-width int type");
// RUN: clang-cc -emit-pch -fblocks -o %t %S/types.h &&
// RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s
-// FIXME: TYPE_EXT_QUAL
+typedef int INT;
+INT int_value;
+
+__attribute__((address_space(1))) int int_as_one;
+
+// TYPE_EXT_QUAL
+ASInt *as_int_ptr1 = &int_value; // expected-error{{different address spaces}} \
+ // FIXME: expected-warning{{discards qualifiers}}
+ASInt *as_int_ptr2 = &int_as_one;
+
// FIXME: TYPE_FIXED_WIDTH_INT
// TYPE_COMPLEX
Cfloat *Cfloat_ptr = &Cfloat_val;
// TYPE_POINTER
-typedef int INT;
-INT int_value;
int_ptr int_value_ptr = &int_value;
// TYPE_BLOCK_POINTER
/* Used with the types.c test */
-// FIXME: TYPE_EXT_QUAL
+// TYPE_EXT_QUAL
+typedef __attribute__((address_space(1))) int ASInt;
+
// FIXME: TYPE_FIXED_WIDTH_INT
// TYPE_COMPLEX