summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/complex.go
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-11-27 00:06:42 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-11-27 00:06:42 +0000
commitad9841e8ac74bfcb1814b728a143408e87dd00a7 (patch)
treea36b962fece0b5b9676f26c1af90b43388069284 /llgo/test/execution/complex.go
parent5468e86469f716eb40b1b39dfd9fd92e4f35df9e (diff)
downloadbcm5719-llvm-ad9841e8ac74bfcb1814b728a143408e87dd00a7.tar.gz
bcm5719-llvm-ad9841e8ac74bfcb1814b728a143408e87dd00a7.zip
Initial commit of llgo.
llvm-svn: 222857
Diffstat (limited to 'llgo/test/execution/complex.go')
-rw-r--r--llgo/test/execution/complex.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/llgo/test/execution/complex.go b/llgo/test/execution/complex.go
new file mode 100644
index 00000000000..ad2a87bbd3c
--- /dev/null
+++ b/llgo/test/execution/complex.go
@@ -0,0 +1,24 @@
+// RUN: llgo -o %t %s
+// RUN: %t 2>&1 | FileCheck %s
+
+// CHECK: (+1.000000e+000+2.000000e+000i)
+// CHECK-NEXT: (-1.000000e+000-2.000000e+000i)
+// CHECK-NEXT: true
+// CHECK-NEXT: (+1.000000e+000+2.000000e+000i)
+// CHECK-NEXT: (-1.000000e+000-2.000000e+000i)
+// CHECK-NEXT: true
+
+package main
+
+func main() {
+ var f32 float32 = 1
+ var f64 float64 = 1
+ c64 := complex(f32, f32+1)
+ println(c64)
+ println(-c64)
+ println(c64 == c64)
+ c128 := complex(f64, f64+1)
+ println(c128)
+ println(-c128)
+ println(c128 == c128)
+}
OpenPOWER on IntegriCloud