Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llgoi: Fix importing source packages together with dependent binary p…
…ackages. Note that this means that llgoi does not support the case where a package's pkgpath is different from its import path, but I don't think this should actually happen with llgoi. Differential Revision: http://reviews.llvm.org/D8403 llvm-svn: 232612
- Loading branch information
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package bar | ||
|
||
import "strconv" | ||
|
||
func Answer() int { | ||
return 42 | ||
n, _ := strconv.Atoi("42") | ||
return n | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: env GOPATH=%S/Inputs llgoi < %s | FileCheck %s | ||
|
||
// Test that importing binary before source works. | ||
import "strconv" | ||
|
||
import "foo" | ||
// CHECK: # bar | ||
// CHECK: # foo | ||
|
||
foo.Answer() | ||
// CHECK: #0 int = 42 | ||
|
||
strconv.FormatBool(true) | ||
// CHECK: #0 string = true |