Anna Zaks | 58715da | 2012-05-11 23:34:14 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyze-function=testVariablyModifiedTypes -verify %s |
| 2 | |
| 3 | // Test that we process variably modified type correctly - the call graph construction should pick up function_with_bug while recursively visiting test_variably_modifiable_types. |
| 4 | unsigned getArraySize(int *x) { |
| 5 | if (!x) |
| 6 | return *x; // expected-warning {{Dereference of null pointer}} |
| 7 | return 1; |
| 8 | } |
| 9 | |
| 10 | int testVariablyModifiedTypes(int *x) { |
| 11 | int mytype[getArraySize(x)]; |
| 12 | return 0; |
| 13 | } |