method on 'super' receiver in a category implementation.
Other simpler cases were working by accident.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61880
91177308-0d34-0410-b5e6-
96231b3b80d8
// if know when we entered/exitted an implementation block.
// Check for an existing forward reference.
- if (llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name)) {
+ // Previously, metaclass with internal linkage may have been defined.
+ // pass 'true' as 2nd argument so it is returned.
+ if (llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true)) {
assert(GV->getType()->getElementType() == ObjCTypes.ClassTy &&
"Forward metaclass reference has incorrect type.");
return GV;
--- /dev/null
+// RUN: clang -emit-llvm -o %t %s
+
+@interface BASE
++ (int) BaseMeth;
+@end
+
+@interface Child: BASE
+@end
+
+@interface Child (Categ)
++ (int) flushCache2;
+@end
+
+@implementation Child @end
+
+@implementation Child (Categ)
++ (int) flushCache2 { [super BaseMeth]; }
+@end
+