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
74 lines
2.1 KiB
C
74 lines
2.1 KiB
C
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
// CONFIG open rdar://6416474
|
|
// was rdar://5847976
|
|
// was rdar://6348320
|
|
|
|
#include <stdio.h>
|
|
#include <Block.h>
|
|
|
|
int verbose = 0;
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
if (argc > 1) verbose = 1;
|
|
|
|
__block void (^recursive_local_block)(int);
|
|
|
|
if (verbose) printf("recursive_local_block is a local recursive block\n");
|
|
recursive_local_block = ^(int i) {
|
|
if (verbose) printf("%d\n", i);
|
|
if (i > 0) {
|
|
recursive_local_block(i - 1);
|
|
}
|
|
};
|
|
|
|
if (verbose) printf("recursive_local_block's address is %p, running it:\n", (void*)recursive_local_block);
|
|
recursive_local_block(5);
|
|
|
|
if (verbose) printf("Creating other_local_block: a local block that calls recursive_local_block\n");
|
|
|
|
void (^other_local_block)(int) = ^(int i) {
|
|
if (verbose) printf("other_local_block running\n");
|
|
recursive_local_block(i);
|
|
};
|
|
|
|
if (verbose) printf("other_local_block's address is %p, running it:\n", (void*)other_local_block);
|
|
|
|
other_local_block(5);
|
|
|
|
#if __APPLE_CC__ >= 5627
|
|
if (verbose) printf("Creating other_copied_block: a Block_copy of a block that will call recursive_local_block\n");
|
|
|
|
void (^other_copied_block)(int) = Block_copy(^(int i) {
|
|
if (verbose) printf("other_copied_block running\n");
|
|
recursive_local_block(i);
|
|
});
|
|
|
|
if (verbose) printf("other_copied_block's address is %p, running it:\n", (void*)other_copied_block);
|
|
|
|
other_copied_block(5);
|
|
#endif
|
|
|
|
__block void (^recursive_copy_block)(int);
|
|
|
|
if (verbose) printf("Creating recursive_copy_block: a Block_copy of a block that will call recursive_copy_block recursively\n");
|
|
|
|
recursive_copy_block = Block_copy(^(int i) {
|
|
if (verbose) printf("%d\n", i);
|
|
if (i > 0) {
|
|
recursive_copy_block(i - 1);
|
|
}
|
|
});
|
|
|
|
if (verbose) printf("recursive_copy_block's address is %p, running it:\n", (void*)recursive_copy_block);
|
|
|
|
recursive_copy_block(5);
|
|
|
|
printf("%s: Success\n", argv[0]);
|
|
return 0;
|
|
}
|