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.
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}
14