summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/if-empty-body.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/if-empty-body.c')
-rw-r--r--clang/test/Sema/if-empty-body.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/if-empty-body.c b/clang/test/Sema/if-empty-body.c
new file mode 100644
index 00000000000..1dc9e448177
--- /dev/null
+++ b/clang/test/Sema/if-empty-body.c
@@ -0,0 +1,9 @@
+// RUN: clang -parse-ast -verify %s
+
+void f1(int a) {
+ if (a); // expected-warning {{if statement has empty body}}
+}
+
+void f2(int a) {
+ if (a) {}
+}
OpenPOWER on IntegriCloud