1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s 2*f4a2713aSLionel Sambuc // expected-no-diagnostics 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc // Testing core functionality of the SValBuilder. 5*f4a2713aSLionel Sambuc SValBuilderLogicNoCrash(int * x)6*f4a2713aSLionel Sambucint SValBuilderLogicNoCrash(int *x) { 7*f4a2713aSLionel Sambuc return 3 - (int)(x +3); 8*f4a2713aSLionel Sambuc } 9*f4a2713aSLionel Sambuc 10*f4a2713aSLionel Sambuc // http://llvm.org/bugs/show_bug.cgi?id=15863 11*f4a2713aSLionel Sambuc // Don't crash when mixing 'bool' and 'int' in implicit comparisons to 0. pr15863()12*f4a2713aSLionel Sambucvoid pr15863() { 13*f4a2713aSLionel Sambuc extern int getBool(); 14*f4a2713aSLionel Sambuc _Bool a = getBool(); 15*f4a2713aSLionel Sambuc (void)!a; // no-warning 16*f4a2713aSLionel Sambuc } 17