diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-02-11 22:48:18 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-02-11 22:48:18 +0000 |
commit | 289e74a4ba4d6722e81ce19dfee0081abda8d088 (patch) | |
tree | 8749c30329409c702e29cedc1c4badb4a4d9e905 /test/Feature | |
parent | 9530a6f3cd8d071c260baa12f28d66f9d6f983d1 (diff) |
Simple fibonacci test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r-- | test/Feature/fib.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Feature/fib.ll b/test/Feature/fib.ll new file mode 100644 index 0000000000..7ea38cbfac --- /dev/null +++ b/test/Feature/fib.ll @@ -0,0 +1,28 @@ +implementation + +uint "fib"(uint %n) +begin +bb1: ;[#uses=0] + %cond1000 = setgt uint %n, 1 ; <bool> [#uses=1] + br bool %cond1000, label %bb3, label %bb2 + +bb2: ;[#uses=1] + ret uint 1 + +bb3: ;[#uses=1] + %reg112 = sub uint %n, 2 ; <uint> [#uses=1] + %reg113 = call uint %fib( uint %reg112 ) ; <uint> [#uses=1] + %reg115 = sub uint %n, 1 ; <uint> [#uses=1] + %reg116 = call uint %fib( uint %reg115 ) ; <uint> [#uses=1] + %reg110 = add uint %reg113, %reg116 ; <uint> [#uses=1] + ret uint %reg110 +end + +int "main"(int %argc, sbyte * * %argv) +begin +bb1: ;[#uses=0] + %reg109 = call uint %fib( uint 6 ) ; <uint> [#uses=1] + %cast1004 = cast uint %reg109 to int ; <int> [#uses=1] + ret int %cast1004 +end + |