github.com/llvm-mirror/llgo@v0.0.0-20190322182713-bf6f0a60fce1/test/execution/new.go (about)

     1  // RUN: llgo -o %t %s
     2  // RUN: %t 2>&1 | FileCheck %s
     3  
     4  // CHECK: 0
     5  // CHECK-NEXT: 2
     6  // CHECK-NEXT: 4
     7  
     8  package main
     9  
    10  func main() {
    11  	x := new(int)
    12  	println(*x)
    13  	*x = 2
    14  	println(*x)
    15  	*x = *x * *x
    16  	println(*x)
    17  }