Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 //PR9463
      4 int subfun(const char *text) {
      5   const char *tmp = text;
      6   return 0;
      7 }
      8 
      9 void 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 
     39 const char *text = "some text";
     40 
     41 int main() {
     42 	const char *ptr = text;
     43 
     44 	fun(ptr);
     45 
     46 	return 0;
     47 }
     48