summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/checkers/bugprone-branch-clone-macro-crash.c
blob: ce0c0137d0a37918d4d02bb334d6479b4c5ebc40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %check_clang_tidy %s bugprone-branch-clone %t
int x = 0;
int y = 1;
#define a(b, c) \
  typeof(b) d;  \
  if (b)        \
    d = b;      \
  else if (c)   \
    d = b;

f() {
  // CHECK-MESSAGES: warning: repeated branch in conditional chain [bugprone-branch-clone]
  a(x, y)
}
OpenPOWER on IntegriCloud