summaryrefslogtreecommitdiff
path: root/testasmcomp/quicksort.cmm
diff options
context:
space:
mode:
Diffstat (limited to 'testasmcomp/quicksort.cmm')
-rw-r--r--testasmcomp/quicksort.cmm43
1 files changed, 0 insertions, 43 deletions
diff --git a/testasmcomp/quicksort.cmm b/testasmcomp/quicksort.cmm
deleted file mode 100644
index 4029da8d15..0000000000
--- a/testasmcomp/quicksort.cmm
+++ /dev/null
@@ -1,43 +0,0 @@
-(***********************************************************************)
-(* *)
-(* Objective Caml *)
-(* *)
-(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
-(* *)
-(* Copyright 1996 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id$ *)
-
-(function "quicksort" (lo: int hi: int a: addr)
- (if (< lo hi)
- (let (i lo
- j hi
- pivot (addraref a hi))
- (while (< i j)
- (catch
- (while 1
- (if (>= i hi) exit [])
- (if (> (addraref a i) pivot) exit [])
- (assign i (+ i 1)))
- with [])
- (catch
- (while 1
- (if (<= j lo) exit [])
- (if (< (addraref a j) pivot) exit [])
- (assign j (- j 1)))
- with [])
- (if (< i j)
- (let temp (addraref a i)
- (addraset a i (addraref a j))
- (addraset a j temp))
- []))
- (let temp (addraref a i)
- (addraset a i (addraref a hi))
- (addraset a hi temp))
- (app "quicksort" lo (- i 1) a unit)
- (app "quicksort" (+ i 1) hi a unit))
- []))