| Daniel Dunbar | ffd408a | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| Anders Carlsson | 663733e | 2007-10-10 20:50:11 +0000 | [diff] [blame] | 2 | |
| 3 | void f1(int a) { | ||||
| 4 | if (a); // expected-warning {{if statement has empty body}} | ||||
| 5 | } | ||||
| 6 | |||||
| 7 | void f2(int a) { | ||||
| 8 | if (a) {} | ||||
| 9 | } | ||||
| Chris Lattner | 84b2071 | 2007-10-29 05:08:52 +0000 | [diff] [blame] | 10 | |
| 11 | void f3() { | ||||
| 12 | if (1) | ||||
| 13 | xx; // expected-error {{use of undeclared identifier}} | ||||
| 14 | return; // no empty body warning. | ||||
| 15 | } | ||||
| 16 | |||||