summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/functions/compare.go
diff options
context:
space:
mode:
Diffstat (limited to 'llgo/test/execution/functions/compare.go')
-rw-r--r--llgo/test/execution/functions/compare.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/llgo/test/execution/functions/compare.go b/llgo/test/execution/functions/compare.go
new file mode 100644
index 00000000000..9daa062efe9
--- /dev/null
+++ b/llgo/test/execution/functions/compare.go
@@ -0,0 +1,26 @@
+// RUN: llgo -o %t %s
+// RUN: %t 2>&1 | FileCheck %s
+
+// CHECK: true
+// CHECK-NEXT: false
+// CHECK-NEXT: true
+// CHECK-NEXT: false
+// CHECK-NEXT: false
+// CHECK-NEXT: true
+// CHECK-NEXT: false
+// CHECK-NEXT: true
+
+package main
+
+func main() {
+ var f func()
+ println(f == nil)
+ println(f != nil)
+ println(nil == f)
+ println(nil != f)
+ f = func() {}
+ println(f == nil)
+ println(f != nil)
+ println(nil == f)
+ println(nil != f)
+}
OpenPOWER on IntegriCloud