diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
| commit | b3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch) | |
| tree | 60a1694bec5a44d15456acc880cb2f91619f66aa /test/Analysis/sizeofpointer.c | |
| parent | 8f57cb0305232cb53fff00ef151ca716766f3437 (diff) | |
Notes
Diffstat (limited to 'test/Analysis/sizeofpointer.c')
| -rw-r--r-- | test/Analysis/sizeofpointer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Analysis/sizeofpointer.c b/test/Analysis/sizeofpointer.c new file mode 100644 index 000000000000..e40c71857242 --- /dev/null +++ b/test/Analysis/sizeofpointer.c @@ -0,0 +1,8 @@ +// RUN: clang-cc -analyze -warn-sizeof-pointer -verify %s + +struct s { +}; + +int f(struct s *p) { + return sizeof(p); // expected-warning{{The code calls sizeof() on a pointer type. This can produce an unexpected result.}} +} |
