Ted Kremenek | c530291 | 2009-03-05 20:22:13 +0000 | [diff] [blame^] | 1 | // RUN: clang -analyze -checker-cfref -analyzer-store=basic --verify %s && |
| 2 | // RUN: clang -analyze -checker-cfref -analyzer-store=region --verify %s |
| 3 | |
| 4 | // Test function pointer casts. Currently we track function addresses using |
| 5 | // loc::FunctionVal. Because casts can be arbitrary, do we need to model |
| 6 | // functions with regions? |
| 7 | |
| 8 | typedef void (*MyFuncTest1)(void); |
| 9 | |
| 10 | MyFuncTest1 test1_aux(void); |
| 11 | void test1(void) { |
| 12 | void *x; |
| 13 | void* (*p)(void); |
| 14 | p = ((void*) test1_aux()); |
| 15 | if (p != ((void*) 0)) x = (*p)(); |
| 16 | } |