Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Anders Carlsson | 2d85f8b | 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 | b96728d | 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 |