summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/extern-void-class-decl.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjC/extern-void-class-decl.m')
-rw-r--r--test/CodeGenObjC/extern-void-class-decl.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenObjC/extern-void-class-decl.m b/test/CodeGenObjC/extern-void-class-decl.m
new file mode 100644
index 0000000000000..c673b005cd5cc
--- /dev/null
+++ b/test/CodeGenObjC/extern-void-class-decl.m
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 %s -emit-llvm -o - | FileCheck %s
+
+// rdar://45077269
+
+extern void OBJC_CLASS_$_f;
+Class c = (Class)&OBJC_CLASS_$_f;
+
+@implementation f @end
+
+// Check that we override the initializer for c, and that OBJC_CLASS_$_f gets
+// the right definition.
+
+// CHECK: @c = global i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_f" to i8*)
+// CHECK: @"OBJC_CLASS_$_f" = global %struct._class_t