From 6f610707cf0919effb0c18337ca45579a37b0870 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Sun, 28 Jun 2009 13:59:24 +0000 Subject: Invalidate a field of struct type by setting its default value to conjured symbol. llvm-svn: 74408 --- clang/test/Analysis/array-struct.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/test/Analysis') diff --git a/clang/test/Analysis/array-struct.c b/clang/test/Analysis/array-struct.c index 438e1ccf476..4e888c82a27 100644 --- a/clang/test/Analysis/array-struct.c +++ b/clang/test/Analysis/array-struct.c @@ -157,3 +157,14 @@ struct s3 p[1]; void f16(struct s3 *p) { struct s3 a = *((struct s3*) ((char*) &p[0])); } + +void inv(struct s1 *); + +// Invalidate the struct field. +void f17() { + struct s1 t; + int x; + inv(&t); + if (t.e.d) + x = 1; +} -- cgit v1.2.3