diff options
author | Chris Lattner <sabre@nondot.org> | 2001-09-01 01:47:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-09-01 01:47:52 +0000 |
commit | 98af669fb9f1f4454953622bb5023ac24f2f0cc3 (patch) | |
tree | 558519bb460983fee3c8e156bad4cac8b878b54f | |
parent | f2a6477aee0939b18f2d32e6bd2809cb444cfc04 (diff) | |
download | external_llvm-98af669fb9f1f4454953622bb5023ac24f2f0cc3.zip external_llvm-98af669fb9f1f4454953622bb5023ac24f2f0cc3.tar.gz external_llvm-98af669fb9f1f4454953622bb5023ac24f2f0cc3.tar.bz2 |
Make fib be more real
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@413 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/fib.ll | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/test/fib.ll b/test/fib.ll index 73d5e53..9c54a4a 100644 --- a/test/fib.ll +++ b/test/fib.ll @@ -1,13 +1,7 @@ - -;; TODO: -;; [ ] Get rid out outside class & begin stuff -;; [ ] Allow global const pool to be expanded continually -;; [ ] Support global variable declaration & definition -;; [ ] Support function definition: %fib = prototype ulong (ulong) -;; [x] Support Type definition - implementation +declare int "atoi"(sbyte *) + ulong "fib"(ulong %n) begin setlt ulong %n, 2 ; {bool}:0 @@ -26,18 +20,17 @@ RecurseCase: end ulong "main"(int %argc, sbyte ** %argv) -;; %n2 = int 1 begin seteq int %argc, 2 ; {bool}:0 br bool %0, label %HasArg, label %Continue HasArg: ; %n1 = atoi(argv[1]) -;;; %n1 = add int 1, 1 + %n1 = add int 1, 1 br label %Continue Continue: -;;; %n = phi int %n1, %n2 - %N = add ulong 1, 1 ;; TODO: CAST + %n = phi int [%n1, %HasArg], [1, %0] + %N = cast int %n to ulong %F = call ulong(ulong) %fib(ulong %N) ret ulong %F end |