aboutsummaryrefslogtreecommitdiff
path: root/libgo/misc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-08-07 15:17:35 -0700
committerIan Lance Taylor <iant@golang.org>2020-08-07 17:22:33 -0700
commit10c8507372f3e1c09df0bfe6449c126dee5075de (patch)
tree27c7db25f91db33c83f56cc75621e61fbf21d921 /libgo/misc
parenta72e938d710fa4b6c8eb89c4daab68e320fa97df (diff)
downloadgcc-10c8507372f3e1c09df0bfe6449c126dee5075de.zip
gcc-10c8507372f3e1c09df0bfe6449c126dee5075de.tar.gz
gcc-10c8507372f3e1c09df0bfe6449c126dee5075de.tar.bz2
libgo: update to Go1.15rc2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247517
Diffstat (limited to 'libgo/misc')
-rw-r--r--libgo/misc/cgo/test/test.go13
-rw-r--r--libgo/misc/cgo/testshared/shared_test.go13
2 files changed, 26 insertions, 0 deletions
diff --git a/libgo/misc/cgo/test/test.go b/libgo/misc/cgo/test/test.go
index 8c69ad9..35bc3a1 100644
--- a/libgo/misc/cgo/test/test.go
+++ b/libgo/misc/cgo/test/test.go
@@ -901,6 +901,12 @@ typedef struct S32579 { unsigned char data[1]; } S32579;
// issue 38649
// Test that #define'd type aliases work.
#define netbsd_gid unsigned int
+
+// issue 40494
+// Inconsistent handling of tagged enum and union types.
+enum Enum40494 { X_40494 };
+union Union40494 { int x; };
+void issue40494(enum Enum40494 e, union Union40494* up) {}
*/
import "C"
@@ -2204,3 +2210,10 @@ var issue38649 C.netbsd_gid = 42
// issue 39877
var issue39877 *C.void = nil
+
+// issue 40494
+// No runtime test; just make sure it compiles.
+
+func Issue40494() {
+ C.issue40494(C.enum_Enum40494(C.X_40494), (*C.union_Union40494)(nil))
+}
diff --git a/libgo/misc/cgo/testshared/shared_test.go b/libgo/misc/cgo/testshared/shared_test.go
index f8dabbe..5e08937 100644
--- a/libgo/misc/cgo/testshared/shared_test.go
+++ b/libgo/misc/cgo/testshared/shared_test.go
@@ -462,6 +462,7 @@ func TestTrivialExecutable(t *testing.T) {
run(t, "trivial executable", "../../bin/trivial")
AssertIsLinkedTo(t, "../../bin/trivial", soname)
AssertHasRPath(t, "../../bin/trivial", gorootInstallDir)
+ checkSize(t, "../../bin/trivial", 100000) // it is 19K on linux/amd64, 100K should be enough
}
// Build a trivial program in PIE mode that links against the shared runtime and check it runs.
@@ -470,6 +471,18 @@ func TestTrivialExecutablePIE(t *testing.T) {
run(t, "trivial executable", "./trivial.pie")
AssertIsLinkedTo(t, "./trivial.pie", soname)
AssertHasRPath(t, "./trivial.pie", gorootInstallDir)
+ checkSize(t, "./trivial.pie", 100000) // it is 19K on linux/amd64, 100K should be enough
+}
+
+// Check that the file size does not exceed a limit.
+func checkSize(t *testing.T, f string, limit int64) {
+ fi, err := os.Stat(f)
+ if err != nil {
+ t.Fatalf("stat failed: %v", err)
+ }
+ if sz := fi.Size(); sz > limit {
+ t.Errorf("file too large: got %d, want <= %d", sz, limit)
+ }
}
// Build a division test program and check it runs.