summaryrefslogtreecommitdiffstats
path: root/test/Sema/if-empty-body.c
blob: af1e62f6b1b61c2696c207e71aa92f8378f75de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 -fsyntax-only -verify %s

void f1(int a) {
    if (a); // expected-warning {{if statement has empty body}}
}

void f2(int a) {
    if (a) {}
}

void f3() {
  if (1)
    xx;      // expected-error {{use of undeclared identifier}}
  return;    // no empty body warning.
}

OpenPOWER on IntegriCloud