blob: b42a61118241500697154a336eca8d27ce33ba1d [file] [log] [blame]
Douglas Gregorfa7b8ce2011-03-24 10:35:39 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Douglas Gregorfa7b8ce2011-03-24 10:35:39 +00003
4//PR9463
5int subfun(const char *text) {
6 const char *tmp = text;
7 return 0;
8}
9
10void fun(const char* text) {
11 int count = 0;
12 bool check = true;
13
14 if (check)
15 {
16 const char *end = text;
17
18 if (check)
19 {
20 do
21 {
22 if (check)
23 {
24 count = subfun(end);
25 goto end;
26 }
27
28 check = !check;
29 }
30 while (check);
31 }
32 // also works, after commenting following line of source code
33 int e = subfun(end);
34 }
35 end:
36 if (check)
37 ++count;
38}
39
40const char *text = "some text";
41
42int main() {
43 const char *ptr = text;
44
45 fun(ptr);
46
47 return 0;
48}