Files
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

108 lines
3.4 KiB
Objective-C

// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -fobjc-arc -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s
typedef struct {
int x[12];
} Big;
@protocol P
- (Big) foo;
- (Big) fooConsuming: (__attribute__((ns_consumed)) id) arg;
- (_Complex float) complex;
@end
@interface SuperClass
- (Big) foo;
@end
@implementation TestClass : SuperClass
// Check that we don't do a nil check when messaging self in ARC
// (which forbids reassigning self)
// CHECK-LABEL: define{{.*}} void @_i_TestClass__test_self_send(
// CHECK-NOT: icmp
// CHECK: @objc_msg_lookup_sender
- (void) test_self_send {
Big big = [self foo];
}
// Check that we don't do a nil test when messaging super.
// CHECK-LABEL: define{{.*}} void @_i_TestClass__test_super_send(
// CHECK-NOT: icmp
// CHECK: @objc_msg_lookup_super
- (void) test_super_send {
Big big = [super foo];
}
@end
// CHECK-LABEL: define{{.*}} void @test_loop_zeroing(
// CHECK: [[P:%.*]] = alloca ptr,
// CHECK: [[BIG:%.*]] = alloca %struct.Big,
// CHECK: br label %for.cond
//
// CHECK: for.cond:
// CHECK-NEXT: [[RECEIVER:%.*]] = load ptr, ptr [[P]],
// CHECK-NEXT: [[ISNIL:%.*]] = icmp eq ptr [[RECEIVER]], null
// CHECK-NEXT: br i1 [[ISNIL]], label %nilReceiverCleanup, label %msgSend
//
// CHECK: msgSend:
// CHECK: @objc_msg_lookup_sender
// CHECK: call void {{%.*}}({{.*}} [[BIG]],
// CHECK: br label %continue
//
// CHECK: nilReceiverCleanup:
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 4 [[BIG]], i8 0, i64 48, i1 false)
// CHECK-NEXT: br label %continue
//
// CHECK: continue:
// CHECK-NEXT: br label %for.cond
void test_loop_zeroing(id<P> p) {
for (;;) {
Big big = [p foo];
}
}
// CHECK-LABEL: define{{.*}} void @test_zeroing_and_consume(
// CHECK: [[P:%.*]] = alloca ptr,
// CHECK: [[Q:%.*]] = alloca ptr,
// CHECK: [[BIG:%.*]] = alloca %struct.Big,
// CHECK: br label %for.cond
//
// CHECK: for.cond:
// CHECK-NEXT: [[RECEIVER:%.*]] = load ptr, ptr [[P]],
// CHECK-NEXT: [[Q_LOAD:%.*]] = load ptr, ptr [[Q]],
// CHECK-NEXT: [[Q_RETAIN:%.*]] = call ptr @llvm.objc.retain(ptr [[Q_LOAD]])
// CHECK-NEXT: [[ISNIL:%.*]] = icmp eq ptr [[RECEIVER]], null
// CHECK-NEXT: br i1 [[ISNIL]], label %nilReceiverCleanup, label %msgSend
//
// CHECK: msgSend:
// CHECK: @objc_msg_lookup_sender
// CHECK: call void {{%.*}}({{.*}} [[BIG]],
// CHECK: br label %continue
//
// CHECK: nilReceiverCleanup:
// CHECK-NEXT: call void @llvm.objc.release(ptr [[Q_RETAIN]])
// CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 4 [[BIG]], i8 0, i64 48, i1 false)
// CHECK-NEXT: br label %continue
//
// CHECK: continue:
// CHECK-NEXT: br label %for.cond
void test_zeroing_and_consume(id<P> p, id q) {
for (;;) {
Big big = [p fooConsuming: q];
}
}
// CHECK-LABEL: define{{.*}} void @test_complex(
// CHECK: [[P:%.*]] = alloca ptr,
// CHECK: [[RECEIVER:%.*]] = load ptr, ptr [[P]],
// CHECK-NEXT: [[ISNIL:%.*]] = icmp eq ptr [[RECEIVER]], null
// CHECK-NEXT: br i1 [[ISNIL]], label %continue, label %msgSend
// CHECK: msgSend:
// CHECK: @objc_msg_lookup_sender
// CHECK: br label %continue
// CHECK: continue:
// CHECK-NEXT: phi float
// CHECK-NEXT: phi float
void test_complex(id<P> p) {
_Complex float f = [p complex];
}