namespace test0 {
struct D { ~D(); };
int f(bool b) {
if (b) {
D d;
goto end;
}
end:
return 1;
}
}
namespace test1 {
struct C { C(); };
int f(bool b) {
if (b)
goto foo; C c; foo:
return 1;
}
}
namespace test2 {
struct C { C(); };
int f(void **ip) {
static void *ips[] = { &&lbl1, &&lbl2 };
C c;
goto *ip;
lbl1:
return 0;
lbl2:
return 1;
}
}
namespace test3 {
struct C { C(); };
int f(void **ip) {
static void *ips[] = { &&lbl1, &&lbl2 };
goto *ip;
lbl1: {
C c;
return 0;
}
lbl2:
return 1;
}
}
namespace test4 {
struct C { C(); };
struct D { ~D(); };
int f(void **ip) {
static void *ips[] = { &&lbl1, &&lbl2 };
C c0;
goto *ip; C c1; lbl1: return 0;
lbl2:
return 1;
}
}
namespace test5 {
struct C { C(); };
struct D { ~D(); };
int f(void **ip) {
static void *ips[] = { &&lbl1, &&lbl2 };
C c0;
goto *ip;
lbl1: return 0;
lbl2:
if (ip[1]) {
D d; ip += 2;
goto *ip; }
return 1;
}
}
namespace test6 {
struct C { C(); };
unsigned f(unsigned s0, unsigned s1, void **ip) {
static void *ips[] = { &&lbl1, &&lbl2, &&lbl3, &&lbl4 };
C c0;
goto *ip;
lbl1:
s0++;
goto *++ip;
lbl2:
s0 -= s1;
goto *++ip;
lbl3: {
unsigned tmp = s0;
s0 = s1;
s1 = tmp;
goto *++ip;
}
lbl4:
return s0;
}
}
namespace test7 {
struct C { C(); };
void test() {
goto foo;
static C c;
foo:
return;
}
}
namespace test8 {
void test1(int c) {
switch (c) {
case 0:
int x = 56; case 1: x = 10;
}
}
void test2() {
goto l2; l1: int x = 5; l2: x++;
}
}
namespace test9 {
struct S { int i; };
void test1() {
goto foo;
S s;
foo:
return;
}
unsigned test2(unsigned x, unsigned y) {
switch (x) {
case 2:
S s;
if (y > 42) return x + y;
default:
return x - 2;
}
}
}
namespace PR10462 {
enum MyEnum {
something_valid,
something_invalid
};
bool recurse() {
MyEnum K;
switch (K) { case something_valid:
case what_am_i_thinking: int *X = 0;
if (recurse()) {
}
break;
}
}
}
namespace test10 {
int test() {
static void *ps[] = { &&a0 };
goto *&&a0; int a = 3; a0:
return 0;
}
}