aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/CodeExtractor
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-02-28 03:20:41 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-02-28 03:20:41 +0000
commit870e587d5d8b5f9005e0e42e19120fe6f21c1c35 (patch)
tree75e9d1e5c074e61962b4df1f83cbae3b654ef2d0 /test/Transforms/CodeExtractor
parent84cda0f470e95132f1a2577aa2e93e06a93cd0a1 (diff)
Two testcases for loops: one with outputs, one without.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/CodeExtractor')
-rw-r--r--test/Transforms/CodeExtractor/loops-no-output.c13
-rw-r--r--test/Transforms/CodeExtractor/loops-outputs.c13
2 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/CodeExtractor/loops-no-output.c b/test/Transforms/CodeExtractor/loops-no-output.c
new file mode 100644
index 0000000000..5f96c04cb1
--- /dev/null
+++ b/test/Transforms/CodeExtractor/loops-no-output.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+ int i;
+ for (i=0; i < 5; ++i)
+ printf("%d\n", i);
+
+ printf("separator!\n");
+
+ for (i=0; i < 4; ++i)
+ printf("[%d]\n", i+5);
+ return 0;
+}
diff --git a/test/Transforms/CodeExtractor/loops-outputs.c b/test/Transforms/CodeExtractor/loops-outputs.c
new file mode 100644
index 0000000000..43bb0de668
--- /dev/null
+++ b/test/Transforms/CodeExtractor/loops-outputs.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+ int i, d=0;
+ for (i=0; i < 10; ++i)
+ d += i;
+
+ printf("separator!\n");
+
+ for (i=0; i < 4; ++i)
+ printf("[%d]\n", d+i);
+ return 0;
+}