aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-15 19:03:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-15 19:03:14 +0000
commit33af70f0f003d9765b92621f4fdd801e2b6c0ae7 (patch)
tree7d7f011a9121f1731cfde4f5020233fe6bfb1ee8
parentfe526d2be9faf52a40640ed610baba9bc6cb16d8 (diff)
Add test case for superrefs section (and make spacing consistent).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69198 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGObjCMac.cpp4
-rw-r--r--test/CodeGenObjC/metadata-symbols-64.m16
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 510551d1f1..e1b14913cd 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -4978,7 +4978,7 @@ CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
Name += SelName;
llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
if (!GV) {
- // Build messafe ref table entry.
+ // Build message ref table entry.
std::vector<llvm::Constant*> Values(2);
Values[0] = Fn;
Values[1] = GetMethodVarName(Sel);
@@ -5087,7 +5087,7 @@ llvm::Value *CGObjCNonFragileABIMac::EmitMetaClassRef(CGBuilderTy &Builder,
CGM.getTargetData().getPrefTypeAlignment(
ObjCTypes.ClassnfABIPtrTy));
- Entry->setSection("__DATA,__objc_superrefs,regular,no_dead_strip");
+ Entry->setSection("__DATA, __objc_superrefs, regular, no_dead_strip");
UsedGlobals.push_back(Entry);
return Builder.CreateLoad(Entry, false, "tmp");
diff --git a/test/CodeGenObjC/metadata-symbols-64.m b/test/CodeGenObjC/metadata-symbols-64.m
index 9f7f2f39dd..86e8290329 100644
--- a/test/CodeGenObjC/metadata-symbols-64.m
+++ b/test/CodeGenObjC/metadata-symbols-64.m
@@ -10,6 +10,7 @@
// RUN: grep '@"OBJC_METACLASS_$_A" = global .* section "__DATA, __objc_data", align 8' %t &&
// RUN: grep '@"\\01L_OBJC_CLASSLIST_REFERENCES_$_[0-9]*" = internal global .* section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8' %t &&
+// RUN: grep '@"\\01L_OBJC_CLASSLIST_SUP_REFS_$_[0-9]*" = internal global .* section "__DATA, __objc_superrefs, regular, no_dead_strip", align 8' %t | count 2 &&
// RUN: grep '@"\\01L_OBJC_CLASS_NAME_[0-9]*" = internal global .* section "__TEXT,__cstring,cstring_literals", align 1' %t &&
// RUN: grep '@"\\01L_OBJC_LABEL_CATEGORY_$" = internal global .* section "__DATA, __objc_catlist, regular, no_dead_strip", align 8' %t &&
// RUN: grep '@"\\01L_OBJC_LABEL_CLASS_$" = internal global .* section "__DATA, __objc_classlist, regular, no_dead_strip", align 8' %t &&
@@ -84,8 +85,21 @@ llvm-gcc -m64 -emit-llvm -S -o - metadata-symbols-64.m | \
}
@end
-void *f0() {
+@interface D : A
+@end
+
+@implementation D
++(void) fm2 {
+ [super fm1];
+}
+-(void) im2 {
+ [super im1];
+}
+@end
+
+void *f0(id x) {
[B im0];
[C im1];
+ [D alloc];
}