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: ;;