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

     1  // RUN: llgo -o %t %s
     2  // RUN: %t 2>&1 | FileCheck %s
     3  
     4  // CHECK: +1.000000e+000
     5  // CHECK-NEXT: +2.000000e+000
     6  // CHECK-NEXT: +3.000000e+000
     7  
     8  package main
     9  
    10  var a1 = [...]float32{1.0, 2.0, 3.0}
    11  
    12  func main() {
    13  	var a2 [3]float32
    14  	a2 = a1
    15  	println(a2[0])
    16  	println(a2[1])
    17  	println(a2[2])
    18  
    19  	// broken due to lack of promotion of
    20  	// stack to heap.
    21  	//println(a2[0], a2[1], a2[2])
    22  }