aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2011-11-23 14:34:14 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-11-23 14:34:14 -0500
commit04b9fc9a5e735e87f3b2049bca80b332353dab66 (patch)
treedcf4b150f5becdf2920c001587721409d4d8ac92
parent174aa10430f7a15bbabc87c23ec4ba6d63f88c59 (diff)
downloadsparse-04b9fc9a5e735e87f3b2049bca80b332353dab66.tar.gz
sparse, llvm: add loop testcase
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--validation/backend/loop.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/validation/backend/loop.c b/validation/backend/loop.c
new file mode 100644
index 00000000..31054f52
--- /dev/null
+++ b/validation/backend/loop.c
@@ -0,0 +1,21 @@
+
+extern int bar (int);
+
+extern int foo (int);
+
+int foo (int x)
+{
+ int y = 0;
+
+ while (y < 1000) {
+ y += bar(x);
+ }
+
+ return y;
+}
+
+
+/*
+ * check-name: Loops
+ * check-command: ./sparsec -c $file -o tmp.o
+ */