-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev.boringcrypto] all: merge master into dev.boringcrypto
Merge at CL 144340, in order to cherry-pick CL 149459 next to it, which fixes a BoringCrypto specific breakage in the toolchain. Change-Id: I30aeac344bbff279449e27876dc8f9c406e55e43
- Loading branch information
Showing
33 changed files
with
688 additions
and
176 deletions.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,59 @@ | ||
// Copyright 2018 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package gc | ||
|
||
import ( | ||
"internal/testenv" | ||
"io/ioutil" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
"testing" | ||
) | ||
|
||
const aliasSrc = ` | ||
package x | ||
type T = int | ||
` | ||
|
||
func TestInvalidLang(t *testing.T) { | ||
t.Parallel() | ||
|
||
testenv.MustHaveGoBuild(t) | ||
|
||
dir, err := ioutil.TempDir("", "TestInvalidLang") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
defer os.RemoveAll(dir) | ||
|
||
src := filepath.Join(dir, "alias.go") | ||
if err := ioutil.WriteFile(src, []byte(aliasSrc), 0644); err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
outfile := filepath.Join(dir, "alias.o") | ||
|
||
if testLang(t, "go9.99", src, outfile) == nil { | ||
t.Error("compilation with -lang=go9.99 succeeded unexpectedly") | ||
} | ||
|
||
if testLang(t, "go1.8", src, outfile) == nil { | ||
t.Error("compilation with -lang=go1.8 succeeded unexpectedly") | ||
} | ||
|
||
if err := testLang(t, "go1.9", src, outfile); err != nil { | ||
t.Errorf("compilation with -lang=go1.9 failed unexpectedly: %v", err) | ||
} | ||
} | ||
|
||
func testLang(t *testing.T, lang, src, outfile string) error { | ||
run := []string{testenv.GoToolPath(t), "tool", "compile", "-lang", lang, "-o", outfile, src} | ||
t.Log(run) | ||
out, err := exec.Command(run[0], run[1:]...).CombinedOutput() | ||
t.Logf("%s", out) | ||
return err | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.