Files
TheRock/compiler/amd-llvm/clang/test/CodeGenObjC/protocols.m
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

73 lines
2.1 KiB
Objective-C

// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
// CHECK: @"_OBJC_$_PROTOCOL_METHOD_TYPES_P1" = internal global
// CHECK: @[[PROTO_P1:"_OBJC_PROTOCOL_\$_P1"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P1:"_OBJC_LABEL_PROTOCOL_\$_P1"]] = weak hidden global ptr @[[PROTO_P1]]
// CHECK: @[[PROTO_P2:"_OBJC_PROTOCOL_\$_P2"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P2:"_OBJC_LABEL_PROTOCOL_\$_P2"]] = weak hidden global ptr @[[PROTO_P2]]
// CHECK: @"_OBJC_$_PROTOCOL_REFS_P3" = internal global { i64, [3 x ptr] } { i64 2, [3 x ptr] [ptr @[[PROTO_P1]], ptr @[[PROTO_P2]], ptr null] }
// CHECK: @[[PROTO_P3:"_OBJC_PROTOCOL_\$_P3"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P3:"_OBJC_LABEL_PROTOCOL_\$_P3"]] = weak hidden global ptr @[[PROTO_P3]]
// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P3" = weak hidden global ptr @[[PROTO_P3]]
// CHECK: @[[PROTO_P0:"_OBJC_PROTOCOL_\$_P0"]] = weak hidden
// CHECK: @[[LABEL_PROTO_P0:"_OBJC_LABEL_PROTOCOL_\$_P0"]] = weak hidden global ptr @[[PROTO_P0]]
// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P0" = weak hidden global ptr @[[PROTO_P0]]
// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P1" = weak hidden global ptr @[[PROTO_P1]]
// CHECK: "_OBJC_PROTOCOL_REFERENCE_$_P2" = weak hidden global ptr @[[PROTO_P2]]
void p(const char*, ...);
@interface Root
+(int) maxValue;
-(int) conformsTo: (id) x;
@end
@protocol P0
@end
@protocol P1
+(void) classMethodReq0;
-(void) methodReq0;
@optional
+(void) classMethodOpt1;
-(void) methodOpt1;
@required
+(void) classMethodReq2;
-(void) methodReq2;
@end
@protocol P2
//@property(readwrite) int x;
@end
@protocol P3<P1, P2>
-(id <P1>) print0;
-(void) print1;
@end
void foo(const id a) {
void *p = @protocol(P3);
}
int main(void) {
Protocol *P0 = @protocol(P0);
Protocol *P1 = @protocol(P1);
Protocol *P2 = @protocol(P2);
Protocol *P3 = @protocol(P3);
#define Pbool(X) p(#X ": %s\n", X ? "yes" : "no");
Pbool([P0 conformsTo: P1]);
Pbool([P1 conformsTo: P0]);
Pbool([P1 conformsTo: P2]);
Pbool([P2 conformsTo: P1]);
Pbool([P3 conformsTo: P1]);
Pbool([P1 conformsTo: P3]);
return 0;
}
typedef Root<P1> P1Object;
int test10(void) {
return [P1Object maxValue];
}