forked from OSchip/llvm-project
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
|