aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2007-04-16 16:10:54 -0700
committerJosh Triplett <josh@freedesktop.org>2007-04-16 16:10:54 -0700
commit2b568826db1f1169713526b1aaaedb581968b9ff (patch)
treee9f8ef36bbaf5a0d759f8fdfde6440357f924c26 /validation/address_space.c
parentPrevent potential NULL pointer dereference in expand_compare (diff)
downloadsparse-2b568826db1f1169713526b1aaaedb581968b9ff.tar.gz
sparse-2b568826db1f1169713526b1aaaedb581968b9ff.tar.bz2
sparse-2b568826db1f1169713526b1aaaedb581968b9ff.zip
Add test case for basic address_space annotations.
struct-as.c covers a particular corner case with address_space annotations, but none of the test cases covered the simple case of an address_space mismatch. Add one. Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'validation/address_space.c')
-rw-r--r--validation/address_space.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/validation/address_space.c b/validation/address_space.c
new file mode 100644
index 0000000..377890a
--- /dev/null
+++ b/validation/address_space.c
@@ -0,0 +1,8 @@
+#define __user __attribute__((address_space(1)))
+
+extern int poke_memory(void *addr);
+
+static int sys_do_stuff(void __user *user_addr)
+{
+ return poke_memory(user_addr);
+}