aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/backend/union.c
diff options
authorPekka Enberg <penberg@kernel.org>2011-10-25 12:26:30 +0300
committerPekka Enberg <penberg@kernel.org>2011-10-28 13:45:42 +0300
commitbc367edabaf2503a20dfdd5f5912d9a4733424fa (patch)
treefa2338fd05707c30bf849b387a570e5865fa2111 /validation/backend/union.c
parentac1601d50ff22e2a4835ca252722ef687c7ef6d8 (diff)
downloadsparse-dev-bc367edabaf2503a20dfdd5f5912d9a4733424fa.tar.gz
sparse, llvm: Add support for union types
This patch adds support for SYM_UNION in symbol_type(). The LLVM API does not provide support for unions so we treat them as opaque structs. Cc: Christopher Li <sparse@chrisli.org> Cc: Jeff Garzik <jgarzik@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation/backend/union.c')
-rw-r--r--validation/backend/union.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/validation/backend/union.c b/validation/backend/union.c
new file mode 100644
index 00000000..e155f6ad
--- /dev/null
+++ b/validation/backend/union.c
@@ -0,0 +1,12 @@
+union foo {
+ unsigned long x;
+ unsigned char y;
+ char buf[128];
+};
+
+static union foo foo;
+
+/*
+ * check-name: Union code generation
+ * check-command: ./sparsec -c $file -o tmp.o
+ */