From 90147816f67d4adc90d8562b2d40da04f5152ecb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 Jul 2001 05:00:34 +0000 Subject: [PATCH] New test case git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/combinations.c | 11 +++++++++++ test/combinations.ll | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 test/combinations.c create mode 100644 test/combinations.ll diff --git a/test/combinations.c b/test/combinations.c new file mode 100644 index 00000000000..cffdff1d4c6 --- /dev/null +++ b/test/combinations.c @@ -0,0 +1,11 @@ + + +void combinations(unsigned int n, unsigned *A) { + unsigned int i, t = 1; + A[0] = A[n] = 1; + + for (i = 1; i <= n/2; i++) { + t = (t * (n+1-i)) / i; + A[i] = A[n-i] = t; + } +} diff --git a/test/combinations.ll b/test/combinations.ll new file mode 100644 index 00000000000..8dfd67bb516 --- /dev/null +++ b/test/combinations.ll @@ -0,0 +1,39 @@ +implementation + +;; Emitting: void combinations(unsigned int, unsigned int*) +void "combinations"(uint %n, uint* %A) +begin +bb1: ;;