Peter Collingbourne 6725a83e84 Introduce llgoi, a REPL for Go
llgoi is a Go REPL based on llgo irgen and the LLVM JIT. It supports
expressions, statements, most declarations and imports, including binary
imports from the standard library and source imports from $GOPATH.

Differential Revision: http://reviews.llvm.org/D6957

llvm-svn: 226097
2015-01-15 04:13:29 +00:00

30 lines
389 B
Plaintext

// RUN: llgoi < %s 2>&1 | FileCheck %s
x := 3
// CHECK: x untyped int = 3
x + x
// CHECK: #0 int = 6
x * x
// CHECK: #0 int = 9
x = 4
x + x
// CHECK: #0 int = 8
x := true
// CHECK: cannot assign {{.*}} to x (variable of type int)
x, y := func() (int, int) {
return 1, 2
}()
// CHECK: x int = 1
// CHECK: y int = 2
x, _ = func() (int, int) {
return 3, 4
}()
x
// CHECK: #0 int = 3