summaryrefslogtreecommitdiffstats
path: root/llgo/test/llgoi/import-source.test
blob: b545b52697ef7d4274a188bfd627d57c45ca2f16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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"
// CHECK: # bar
// CHECK: # foo

// Test that importing binary after source works.
import "strconv"

foo.Answer()
// CHECK: #0 int = 42

strconv.FormatBool(true)
// CHECK: #0 string = 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
OpenPOWER on IntegriCloud