brintos

brintos / llvm-project-archived public Read only

0
0
Text · 761 B · 427c669 Raw
19 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=common,ufirst -analyzer-config exploration_strategy=unexplored_first %s2// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=common,dfs -analyzer-config exploration_strategy=dfs %s3 4extern void clang_analyzer_eval(int);5 6typedef struct { char a; } b;7int 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}19