summaryrefslogtreecommitdiff
path: root/test/files/run/testpar.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/testpar.scala')
-rw-r--r--test/files/run/testpar.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/testpar.scala b/test/files/run/testpar.scala
new file mode 100644
index 0000000000..c4c813ee00
--- /dev/null
+++ b/test/files/run/testpar.scala
@@ -0,0 +1,24 @@
+
+
+
+import scala.parallel._
+
+
+
+
+
+object Test {
+
+ def main(args: Array[String]) {
+ if (util.Properties.isJavaAtLeast("1.6")) {
+ val vendor = util.Properties.javaVmVendor
+ if ((vendor contains "Sun") || (vendor contains "Apple")) assert(fib(40) == 102334155)
+ }
+ }
+
+ def fib(n: Int): Int = if (n < 3) 1 else if (n < 35) fib(n - 1) + fib(n - 2) else {
+ val (p, pp) = par(fib(n - 1), fib(n - 2))
+ p() + pp()
+ }
+
+}