1// 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
2
3// Check that the runtime name is emitted and used instead of the class
4// identifier.
5
6// CHECK: module asm {{.*}}objc_class_name_XYZ=0
7// CHECK: module asm {{.*}}globl .objc_class_name_XYZ
8// CHECK: module asm {{.*}}lazy_reference .objc_class_name_XYZ
9
10// CHECK: @[[OBJC_CLASS_NAME:.*]] = private unnamed_addr constant [4 x i8] c"XYZ{{.*}}, section "__TEXT,__cstring,cstring_literals",
11// CHECK: = private global {{.*}} bitcast ([4 x i8]* @[[OBJC_CLASS_NAME]] to {{.*}}), section "__OBJC,__cls_refs,literal_pointers,no_dead_strip"
12
13__attribute__((objc_root_class,objc_runtime_name("XYZ")))
14@interface A
15+(void)m1;
16@end
17
18@implementation A
19+(void)m1 {}
20@end
21
22void test(void) {
23  [A m1];
24}
25