1 // RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -fsyntax-only -verify %s
7 void callee_variadic(const char *, ...);
9 void test_variadic(void) {
11 callee_variadic("s", t); // expected-error {{cannot pass non-trivial C object of type 'Strong' by value to variadic function}}
14 void test_jump0(int cond) {
18 Strong x; // expected-note {{jump bypasses initialization of variable of non-trivial C struct type}}
20 case 1: // expected-error {{cannot jump from switch statement to this case label}}
26 void test_jump1(void) {
27 static void *ips[] = { &&L0 };
28 L0: // expected-note {{possible target of indirect goto}}
30 Strong x; // expected-note {{jump exits scope of variable with non-trivial destructor}}
31 goto *ips; // expected-error {{cannot jump}}
34 typedef void (^BlockTy)(void);
38 void test_block_scope0(int cond) {
39 Strong x; // expected-note {{jump enters lifetime of block which captures a C struct that is non-trivial to destroy}}
44 default: // expected-error {{cannot jump from switch statement to this case label}}
49 void test_block_scope1(void) {
50 static void *ips[] = { &&L0 };
51 L0: // expected-note {{possible target of indirect goto}}
53 Strong x; // expected-note {{jump exits scope of variable with non-trivial destructor}} expected-note {{jump exits lifetime of block which captures a C struct that is non-trivial to destroy}}
55 goto *ips; // expected-error {{cannot jump}}
58 void test_compound_literal0(int cond, id x) {
61 (void)(Strong){ .a = x }; // expected-note {{jump enters lifetime of a compound literal that is non-trivial to destruct}}
63 default: // expected-error {{cannot jump from switch statement to this case label}}
68 void test_compound_literal1(id x) {
69 static void *ips[] = { &&L0 };
70 L0: // expected-note {{possible target of indirect goto}}
72 (void)(Strong){ .a = x }; // expected-note {{jump exits lifetime of a compound literal that is non-trivial to destruct}}
73 goto *ips; // expected-error {{cannot jump}}