blob: a833434228d10a49ce6be44f7d922a9da41872e2 [file] [log] [blame]
Anna Zaks58715da2012-05-11 23:34:14 +00001// 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.
4unsigned getArraySize(int *x) {
5 if (!x)
6 return *x; // expected-warning {{Dereference of null pointer}}
7 return 1;
8}
9
10int testVariablyModifiedTypes(int *x) {
11 int mytype[getArraySize(x)];
12 return 0;
13}