pass_pkg_var_zero.mx raw

   1  package main
   2  
   3  // Tests that zero-value package vars are accessible.
   4  // Package globals are immutable after init(); main package has no init().
   5  // Zero-value vars can be read but not written outside init().
   6  
   7  var x int32
   8  
   9  func main() {
  10  	if x == 0 {
  11  		println("PASS: zero-value var is zero")
  12  	} else {
  13  		println("FAIL: zero-value var is not zero")
  14  	}
  15  }
  16