Summary: Separate the evaluation of expressions from printing of results. This is in preparation for splitting the core of the interpreter out for use in alternative interpreter frontends. At the same time, the output is made less noisy in response to comments on the golang-nuts announcement. We would ideally print out values using Go syntax, but this is impractical until we have libgo based on Go 1.5. When that happens, fmt's %#v will handle reflect.Value better, and so we can fix/filter type names to remove automatically generated package names. Reviewers: pcc Subscribers: llvm-commits, axw Differential Revision: http://reviews.llvm.org/D13761 llvm-svn: 267374
29 lines
556 B
Plaintext
29 lines
556 B
Plaintext
// RUN: env GOPATH=%S/Inputs llgoi < %s 2>&1 | FileCheck %s
|
|
|
|
// make sure user symbols do not conflict with imported source package
|
|
Answer := 1
|
|
|
|
import "foo"
|
|
|
|
// Test that importing binary after source works.
|
|
import "strconv"
|
|
|
|
foo.Answer()
|
|
// CHECK: 42
|
|
|
|
strconv.FormatBool(true)
|
|
// CHECK: true
|
|
|
|
var v1 strconv.NumError
|
|
var v2 strconv.NumError
|
|
|
|
// v1 and v2 should have the same type identity.
|
|
// CHECK-NOT: cannot assign
|
|
v1 = v2
|
|
|
|
// Method lookup relies on v1 having a consistent type.
|
|
v1.Error
|
|
|
|
import "foo_cgo"
|
|
// CHECK: foo_cgo: cannot load cgo package
|