Files
TheRock/compiler/amd-llvm/clang/test/DebugInfo/ObjC/block-line.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

89 lines
2.9 KiB
Objective-C

// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -emit-llvm -fblocks -fobjc-arc -debug-info-kind=limited -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
typedef unsigned int NSUInteger;
typedef long NSInteger;
typedef signed char BOOL;
#define nil ((void*) 0)
#define YES ((BOOL)1)
#define NO ((BOOL)0)
@interface NSObject
- (id)init;
@end
@interface NSError : NSObject
@end
@interface NSString : NSObject
@end
@interface NSString (NSStringExtensionMethods)
- (void)enumerateLinesUsingBlock:(void (^)(NSString *line, BOOL *stop))block;
@end
@interface NSData : NSObject
@end
@interface NSData (ASBase64)
- (NSString *)encodedString:(NSInteger)position;
- (NSData *)compressedData;
@end
typedef void (^TDataCompletionBlock)(NSData *data, NSError *error);
@interface TMap : NSObject
- (NSString *)identifier;
- (NSString *)name;
+ (TMap *)mapForID:(NSString *)identifier;
- (void)dataWithCompletionBlock:(TDataCompletionBlock)block;
@end
typedef enum : NSUInteger {
TOK = 100,
TError = 125,
} TResponseCode;
@interface TConnection : NSObject
- (void)sendString:(NSString *)string;
- (void)sendFormat:(NSString *)format, ...;
- (void)sendResponseCode:(TResponseCode)responseCode dataFollows:(BOOL)flag
format:(NSString *)format, ...;
@end
@interface TServer : NSObject
@end
@implementation TServer
- (void)serverConnection:(TConnection *)connection getCommand:(NSString *)str
{
NSString *mapID = nil;
TMap *map = [TMap mapForID:mapID];
// Make sure we do not map code generated for the block to the above line.
// CHECK: define internal void @"__39-[TServer serverConnection:getCommand:]_block_invoke"
// CHECK: call void @llvm.objc.storeStrong(ptr [[CONNECTION_ADDR:%.*]], ptr [[ONE:%.*]]) [[NUW:#[0-9]+]]
// CHECK: call void @llvm.objc.storeStrong(ptr [[STR_ADDR:%.*]], ptr [[THREE:%.*]]) [[NUW]]
// CHECK: call {{.*}}@objc_msgSend{{.*}}, !dbg ![[LINE_ABOVE:[0-9]+]]
// CHECK: getelementptr
// CHECK-NOT: !dbg, ![[LINE_ABOVE]]
// CHECK: call void @llvm.objc.storeStrong(ptr [[STR_ADDR]], ptr null) [[NUW]]
// CHECK-NEXT: call void @llvm.objc.storeStrong(ptr [[CONNECTION_ADDR]], ptr null) [[NUW]]
// CHECK-NEXT: ret
// CHECK: attributes [[NUW]] = { nounwind }
[map dataWithCompletionBlock:^(NSData *data, NSError *error) {
if (data) {
NSString *encoded = [[data compressedData] encodedString:18];
[connection sendResponseCode:TOK dataFollows:YES
format:@"Sending \"%@\" (%@)", [map name], [map identifier]];
[encoded enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) {
[connection sendFormat:@"%@\r\n", line];
}];
[connection sendString:@".\r\n"];
} else {
[connection sendResponseCode:TError dataFollows:NO
format:@"Failed \"%@\" (%@)", [map name], [map identifier]];
}
}];
}
@end