summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjC/protocol-comdat.m
blob: 84d620e9714b9f232bbb26276d19743dfa2009d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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

@protocol Q @end
@protocol R @end

@interface I<P>
@end

@implementation I
- (void) method { }
@end

_Bool f(void) {
  return @protocol(Q) == @protocol(R);
}

// CHECK: $"_OBJC_PROTOCOL_$_P" = comdat any
// CHECK: $"_OBJC_LABEL_PROTOCOL_$_P" = comdat any
// CHECK: $"\01l_OBJC_PROTOCOL_REFERENCE_$_Q" = comdat any
// CHECK: $"\01l_OBJC_PROTOCOL_REFERENCE_$_R" = comdat any

// CHECK: @"_OBJC_PROTOCOL_$_P" = {{.*}}, comdat
// CHECK: @"_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, comdat