Anna Zaks | 2a6e30d | 2012-05-02 00:05:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Anna Zaks | 2a6e30d | 2012-05-02 00:05:23 +0000 | [diff] [blame] | 3 | |
| 4 | // Testing core functionality of the SValBuilder. |
| 5 | |
| 6 | int SValBuilderLogicNoCrash(int *x) { |
| 7 | return 3 - (int)(x +3); |
| 8 | } |
Jordan Rose | 112344a | 2013-05-01 18:19:59 +0000 | [diff] [blame] | 9 | |
| 10 | // http://llvm.org/bugs/show_bug.cgi?id=15863 |
| 11 | // Don't crash when mixing 'bool' and 'int' in implicit comparisons to 0. |
| 12 | void pr15863() { |
| 13 | extern int getBool(); |
| 14 | _Bool a = getBool(); |
| 15 | (void)!a; // no-warning |
| 16 | } |