Files
TheRock/compiler/amd-llvm/clang/test/SemaObjC/scope-check.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

100 lines
2.5 KiB
Objective-C

// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -fsyntax-only -verify -fobjc-exceptions -Wno-objc-root-class %s
@class A, B, C;
void test1(void) {
goto L; // expected-error{{cannot jump}}
goto L2; // expected-error{{cannot jump}}
goto L3; // expected-error{{cannot jump}}
@try { // expected-note {{jump bypasses initialization of @try block}}
L: ;
} @catch (A *x) { // expected-note {{jump bypasses initialization of @catch block}}
L2: ;
} @catch (B *x) {
} @catch (C *c) {
} @finally {// expected-note {{jump bypasses initialization of @finally block}}
L3: ;
}
@try {
goto L4; // expected-error{{cannot jump}}
goto L5; // expected-error{{cannot jump}}
} @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
L5: ;
goto L6; // expected-error{{cannot jump}}
} @catch (B *c) { // expected-note {{jump bypasses initialization of @catch block}}
L6: ;
} @finally { // expected-note {{jump bypasses initialization of @finally block}}
L4: ;
}
@try { // expected-note 2 {{jump bypasses initialization of @try block}}
L7: ;
} @catch (C *c) {
goto L7; // expected-error{{cannot jump}}
} @finally {
goto L7; // expected-error{{cannot jump}}
}
goto L8; // expected-error{{cannot jump}}
@try {
} @catch (A *c) {
} @catch (B *c) {
} @catch (C *c) { // expected-note {{jump bypasses initialization of @catch block}}
L8: ;
}
id X;
goto L9; // expected-error{{cannot jump}}
@synchronized (X) // expected-note {{jump bypasses initialization of @synchronized block}}
{
L9:
;
}
}
void test2(int a) {
if (a) goto L0;
@try {} @finally {}
L0:
return;
}
void test3(void) {
@try {
goto blargh;
blargh: ;
} @catch (...) {}
}
@interface Greeter
+ (void) hello;
@end
@implementation Greeter
+ (void) hello {
@try {
goto blargh; // expected-error {{cannot jump}}
} @catch (...) { // expected-note {{jump bypasses initialization of @catch block}}
blargh: ;
}
}
+ (void)meth2 {
int n; void *P;
goto L0; // expected-error {{cannot jump}}
typedef int A[n]; // expected-note {{jump bypasses initialization of VLA typedef}}
L0:
goto L1; // expected-error {{cannot jump}}
A b, c[10]; // expected-note 2 {{jump bypasses initialization of variable length array}}
L1:
goto L2; // expected-error {{cannot jump}}
A d[n]; // expected-note {{jump bypasses initialization of variable length array}}
L2:
return;
}
@end