inclyc added inline comments.

================
Comment at: clang/test/Parser/while-loop-outside-function.c:3
+
+while(1) {}; // expected-error {{while loop outside of function}}
+
----------------
mizvekov wrote:
> You could break this down further into more lines to test exactly where the 
> error is placed. Id expect it to be placed at the `while` keyword.
Passes this test case, I will submit this in the next patch.

```
// RUN: %clang_cc1 -fsyntax-only -verify %s

while(1) {}; // expected-error {{while loop outside of function}}


while(1) // expected-error {{while loop outside of function}}
{

}

while(1) { // expected-error {{while loop outside of function}}

}

while(1) { // expected-error {{while loop outside of function}}

};

while(1) // expected-error {{while loop outside of function}}
{

}

while(1) { // expected-error {{while loop outside of function}}

};

// without semicolon
while(1) {} // expected-error {{while loop outside of function}}

void some_fn();

void some_fn() {
    while(1) {};
}
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129573/new/

https://reviews.llvm.org/D129573

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to