mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +00:00
[analyzer] Test variable modified types.
llvm-svn: 156664
This commit is contained in:
parent
0661b81bca
commit
3236bad851
13
clang/test/Analysis/test-variably-modified-types.c
Normal file
13
clang/test/Analysis/test-variably-modified-types.c
Normal file
@ -0,0 +1,13 @@
|
||||
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyze-function=testVariablyModifiedTypes -verify %s
|
||||
|
||||
// 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.
|
||||
unsigned getArraySize(int *x) {
|
||||
if (!x)
|
||||
return *x; // expected-warning {{Dereference of null pointer}}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int testVariablyModifiedTypes(int *x) {
|
||||
int mytype[getArraySize(x)];
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user