summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/new.go
blob: 24773de7f350c80c22a1169338069d9e66dfeed6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: llgo -o %t %s
// RUN: %t 2>&1 | FileCheck %s

// CHECK: 0
// CHECK-NEXT: 2
// CHECK-NEXT: 4

package main

func main() {
	x := new(int)
	println(*x)
	*x = 2
	println(*x)
	*x = *x * *x
	println(*x)
}
OpenPOWER on IntegriCloud