Mercurial > hg > CbC > CbC_llvm
diff clang/test/Analysis/svalbuilder-logic.c @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | 0572611fdcc8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clang/test/Analysis/svalbuilder-logic.c Thu Feb 13 15:10:13 2020 +0900 @@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -verify %s +// expected-no-diagnostics + +// Testing core functionality of the SValBuilder. + +int SValBuilderLogicNoCrash(int *x) { + return 3 - (int)(x +3); +} + +// http://llvm.org/bugs/show_bug.cgi?id=15863 +// Don't crash when mixing 'bool' and 'int' in implicit comparisons to 0. +void pr15863() { + extern int getBool(); + _Bool a = getBool(); + (void)!a; // no-warning +}