summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-10-25 14:50:44 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-10-25 14:50:44 +0000
commit9ccc7ad62d319127670e70e8082a6018987ed25a (patch)
treee607ea44ab9d3dbf88c1549dd40ca9ccc89e5e74 /clang/test
parent5c3c9707c32923e5acae0f7d2253e60da4e89096 (diff)
downloadbcm5719-llvm-9ccc7ad62d319127670e70e8082a6018987ed25a.tar.gz
bcm5719-llvm-9ccc7ad62d319127670e70e8082a6018987ed25a.zip
CodeGen: mark protocols as common data
This allows for the coalescing of the protocol declarations. When the protocols are declared in headers, multiple definitions of the protocol would be emitted. Marking them as common data indicates that any one can be selected. llvm-svn: 285073
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenObjC/protocol-comdat.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/protocol-comdat.m b/clang/test/CodeGenObjC/protocol-comdat.m
new file mode 100644
index 00000000000..65e1b9fa2c8
--- /dev/null
+++ b/clang/test/CodeGenObjC/protocol-comdat.m
@@ -0,0 +1,20 @@
+// RUN: %clang -cc1 -triple thumbv7--windows-itanium -fobjc-runtime=ios -emit-llvm -o - %s -Wno-objc-root-class | FileCheck %s
+
+@protocol P
+- (void) method;
+@end
+
+@interface I<P>
+@end
+
+@implementation I
+- (void) method { }
+@end
+
+
+// CHECK: $"\01l_OBJC_PROTOCOL_$_P" = comdat any
+// CHECK: $"\01l_OBJC_LABEL_PROTOCOL_$_P" = comdat any
+
+// CHECK: @"\01l_OBJC_PROTOCOL_$_P" = {{.*}}, comdat
+// CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, comdat
+
OpenPOWER on IntegriCloud