aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Li <sparse@chrisli.org>2009-06-21 18:45:23 -0700
committerChristopher Li <sparse@chrisli.org>2009-07-18 05:30:10 +0000
commit37f041aba632b7ffc46eb779df07804d9d7d547a (patch)
tree8ae2ec2ed563db09e221cfa72fc6beb1223437fb
parent977365deff2986acc7a41a377fc8defda406af6c (diff)
downloadsparse-37f041aba632b7ffc46eb779df07804d9d7d547a.tar.gz
Add validation for restrict and attribute warning
Some simple test to excise the recent patch. Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--validation/attr-warning.c8
-rw-r--r--validation/restrict-array.c12
2 files changed, 20 insertions, 0 deletions
diff --git a/validation/attr-warning.c b/validation/attr-warning.c
new file mode 100644
index 00000000..1c0976f6
--- /dev/null
+++ b/validation/attr-warning.c
@@ -0,0 +1,8 @@
+# define __warndecl(name, msg) \
+ extern void name (void) __attribute__((__warning__ (msg)))
+
+__warndecl (__warn_func, "warn message");
+
+/*
+ * check-name: attribute warning
+ */
diff --git a/validation/restrict-array.c b/validation/restrict-array.c
new file mode 100644
index 00000000..3facebf4
--- /dev/null
+++ b/validation/restrict-array.c
@@ -0,0 +1,12 @@
+#define __restrict_arr __restrict
+
+struct aiocb64;
+struct sigevent;
+
+extern int lio_listio64 (int __mode,
+ struct aiocb64 *__const __list[__restrict_arr],
+ int __nent, struct sigevent *__restrict __sig);
+
+/*
+ * check-name: restrict array attribute
+ */