[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / SemaCXX / goto2.cpp
blobb42a61118241500697154a336eca8d27ce33ba1d
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 //PR9463
5 int subfun(const char *text) {
6 const char *tmp = text;
7 return 0;
10 void fun(const char* text) {
11 int count = 0;
12 bool check = true;
14 if (check)
16 const char *end = text;
18 if (check)
22 if (check)
24 count = subfun(end);
25 goto end;
28 check = !check;
30 while (check);
32 // also works, after commenting following line of source code
33 int e = subfun(end);
35 end:
36 if (check)
37 ++count;
40 const char *text = "some text";
42 int main() {
43 const char *ptr = text;
45 fun(ptr);
47 return 0;