Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / copypaste / generic.c
blob4c265b2d68b1661b2ae8f66d946d8aaa9c476404
1 // RUN: %clang_analyze_cc1 -std=c11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
3 // expected-no-diagnostics
5 int global;
7 int foo1(void) {
8 if (global > 0)
9 return 0;
10 else if (global < 0)
11 return _Generic(global, double: 1, float: 2, default: 3);
12 return 1;
15 // Different associated type (int instead of float)
16 int foo2(void) {
17 if (global > 0)
18 return 0;
19 else if (global < 0)
20 return _Generic(global, double: 1, int: 2, default: 4);
21 return 1;
24 // Different number of associated types.
25 int foo3(void) {
26 if (global > 0)
27 return 0;
28 else if (global < 0)
29 return _Generic(global, double: 1, default: 4);
30 return 1;