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