summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2018-04-03 22:50:16 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2018-04-03 22:50:16 +0000
commit0c194461b5acf968e1eba0e029382cc2ca6b1383 (patch)
tree7c0c260469e200472b61b724266c7f10fb58678b /clang/test
parentd9189d1e76dd0d2640b13b5c2aa4cfb47ea7d808 (diff)
downloadbcm5719-llvm-0c194461b5acf968e1eba0e029382cc2ca6b1383.tar.gz
bcm5719-llvm-0c194461b5acf968e1eba0e029382cc2ca6b1383.zip
[ObjC] Use the name specified by objc_runtime_name instead of the class
identifier. This patch fixes a few places in CGObjCMac.cpp where the class identifier was used instead of the name specified by objc_runtime_name. rdar://problem/37910822 Differential Revision: https://reviews.llvm.org/D45101 llvm-svn: 329128
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenObjC/objc-runtime-name.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/objc-runtime-name.m b/clang/test/CodeGenObjC/objc-runtime-name.m
new file mode 100644
index 00000000000..228525fc55c
--- /dev/null
+++ b/clang/test/CodeGenObjC/objc-runtime-name.m
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -triple i386-apple-macosx10.13.0 -fobjc-runtime=macosx-fragile-10.13.0 -fobjc-subscripting-legacy-runtime -emit-llvm -o - %s | FileCheck %s
+
+// Check that the runtime name is emitted and used instead of the class
+// identifier.
+
+// CHECK: module asm {{.*}}objc_class_name_XYZ=0
+// CHECK: module asm {{.*}}globl .objc_class_name_XYZ
+// CHECK: module asm {{.*}}lazy_reference .objc_class_name_XYZ
+
+// CHECK: @[[OBJC_CLASS_NAME:.*]] = private unnamed_addr constant [4 x i8] c"XYZ{{.*}}, section "__TEXT,__cstring,cstring_literals",
+// CHECK: = private global {{.*}} bitcast ([4 x i8]* @[[OBJC_CLASS_NAME]] to {{.*}}), section "__OBJC,__cls_refs,literal_pointers,no_dead_strip"
+
+__attribute__((objc_root_class,objc_runtime_name("XYZ")))
+@interface A
++(void)m1;
+@end
+
+@implementation A
++(void)m1 {}
+@end
+
+void test(void) {
+ [A m1];
+}
OpenPOWER on IntegriCloud