summaryrefslogtreecommitdiffstats
path: root/llgo/test/llgoi/vars.test
blob: c28198cf0f1ac4c462312f92777de257b2a68ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: llgoi < %s 2>&1 | FileCheck %s

x := 3
x
// CHECK: 3

x + x
// CHECK: 6

x * x
// CHECK: 9

x = 4
x + x
// CHECK: 8

x := true
// CHECK: cannot assign {{.*}} to x (variable of type int)

x, y := func() (int, int) {
	return 1, 2
}()
// CHECK: 1
// CHECK: 2

x, _ = func() (int, int) {
	return 3, 4
}()
x
// CHECK: 3
OpenPOWER on IntegriCloud