mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-23 20:01:24 +00:00

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
30 lines
389 B
Plaintext
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
|