2015-01-15 12:13:29 +08:00
|
|
|
// RUN: llgoi < %s 2>&1 | FileCheck %s
|
|
|
|
|
|
|
|
x := 3
|
2016-04-25 09:18:20 +08:00
|
|
|
x
|
|
|
|
// CHECK: 3
|
2015-01-15 12:13:29 +08:00
|
|
|
|
|
|
|
x + x
|
2016-04-25 09:18:20 +08:00
|
|
|
// CHECK: 6
|
2015-01-15 12:13:29 +08:00
|
|
|
|
|
|
|
x * x
|
2016-04-25 09:18:20 +08:00
|
|
|
// CHECK: 9
|
2015-01-15 12:13:29 +08:00
|
|
|
|
|
|
|
x = 4
|
|
|
|
x + x
|
2016-04-25 09:18:20 +08:00
|
|
|
// CHECK: 8
|
2015-01-15 12:13:29 +08:00
|
|
|
|
|
|
|
x := true
|
|
|
|
// CHECK: cannot assign {{.*}} to x (variable of type int)
|
|
|
|
|
|
|
|
x, y := func() (int, int) {
|
|
|
|
return 1, 2
|
|
|
|
}()
|
2016-04-25 09:18:20 +08:00
|
|
|
// CHECK: 1
|
|
|
|
// CHECK: 2
|
2015-01-15 12:13:29 +08:00
|
|
|
|
|
|
|
x, _ = func() (int, int) {
|
|
|
|
return 3, 4
|
|
|
|
}()
|
|
|
|
x
|
2016-04-25 09:18:20 +08:00
|
|
|
// CHECK: 3
|