| 1 |
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=common,ufirst -analyzer-config exploration_strategy=unexplored_first %s |
| 2 |
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=common,dfs -analyzer-config exploration_strategy=dfs %s |
| 3 |
|
| 4 |
extern void clang_analyzer_eval(int); |
| 5 |
|
| 6 |
typedef struct { char a; } b; |
| 7 |
int c(b* input) { |
| 8 |
int x = (input->a ?: input) ? 1 : 0; // common-warning{{pointer/integer type mismatch}} |
| 9 |
if (input->a) { |
| 10 |
// FIXME: The value should actually be "TRUE", |
| 11 |
// but is incorrect due to a bug. |
| 12 |
// dfs-warning@+1 {{FALSE}} ufirst-warning@+1 {{TRUE}} |
| 13 |
clang_analyzer_eval(x); |
| 14 |
} else { |
| 15 |
clang_analyzer_eval(x); // common-warning{{TRUE}} |
| 16 |
} |
| 17 |
return x; |
| 18 |
} |