aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/expand
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-01-26 01:32:35 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-09-27 02:17:31 +0200
commit62308ab6a6025f8df926b8af009f68fbebe040b6 (patch)
treeb10a0f0132827654957be3562495336142e4626a /validation/expand
parentd765800ade9ccb195c1b45033573dcaeec4e3f46 (diff)
downloadsparse-dev-62308ab6a6025f8df926b8af009f68fbebe040b6.tar.gz
asm: add test evaluation, expansion & linearization of ASM operands
ASM statements are quite complex. Add some tests to catch some potential errors. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/expand')
-rw-r--r--validation/expand/asm0.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/validation/expand/asm0.c b/validation/expand/asm0.c
new file mode 100644
index 00000000..0664b622
--- /dev/null
+++ b/validation/expand/asm0.c
@@ -0,0 +1,24 @@
+static void foo(void)
+{
+ asm("" :: "i" (42 & 3));
+ asm("" :: "i" (__builtin_constant_p(0)));
+}
+
+/*
+ * check-name: expand-asm0
+ * check-command: test-linearize $file
+ * check-known-to-fail
+ *
+ * check-output-start
+foo:
+.L0:
+ <entry-point>
+ asm ""
+ in: "i" ($2)
+ asm ""
+ in: "i" ($1)
+ ret
+
+
+ * check-output-end
+ */