Peter Collingbourne | 49d29ed | 2013-10-20 21:29:32 +0000 | [diff] [blame^] | 1 | // RUN: %clangxx -fsanitize=bool %s -O3 -o %T/bool.exe && %T/bool.exe 2>&1 | FileCheck %s |
Richard Smith | e3eb652 | 2012-12-13 07:12:20 +0000 | [diff] [blame] | 2 | |
| 3 | unsigned char NotABool = 123; |
| 4 | |
| 5 | int main(int argc, char **argv) { |
| 6 | bool *p = (bool*)&NotABool; |
| 7 | |
Nick Lewycky | 43ac401 | 2013-10-02 05:05:28 +0000 | [diff] [blame] | 8 | // CHECK: bool.cpp:9:10: runtime error: load of value 123, which is not a valid value for type 'bool' |
Richard Smith | e3eb652 | 2012-12-13 07:12:20 +0000 | [diff] [blame] | 9 | return *p; |
| 10 | } |