]> Cypherpunks repositories - gostls13.git/commitdiff
godefs: add enum/const testdata
authorDave Cheney <dave@cheney.net>
Fri, 14 Oct 2011 21:34:00 +0000 (17:34 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 14 Oct 2011 21:34:00 +0000 (17:34 -0400)
Also, add golden output data for linux/arm.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5256041

src/cmd/godefs/testdata.c
src/cmd/godefs/testdata_darwin_386.golden
src/cmd/godefs/testdata_darwin_amd64.golden
src/cmd/godefs/testdata_linux_arm.golden [new file with mode: 0644]

index 3f459c41ba48887e0836982b804be04bd6dbf17f..f12589bf471d12ed815aa50cf0b72c755951e2e7 100644 (file)
@@ -38,4 +38,15 @@ struct T5 {
 
 typedef struct T5 T5;
 typedef struct T4 $T4;
-typedef T5 $T5;
\ No newline at end of file
+typedef T5 $T5;
+
+// Test constants and enumerations are printed correctly. clang/2.9 with 
+// -O2 and above causes Bprint to print %#llx values incorrectly.
+enum {
+       $sizeofPtr = sizeof(void*),
+       $sizeofShort = sizeof(short),
+       $sizeofInt = sizeof(int),
+       $sizeofLong = sizeof(long),
+       $sizeofLongLong = sizeof(long long),
+};
+
index d929238b0a0ffa7d0fc77c43d317b0cef244bfa4..0b269cc8c41303d28b87b192bf32979251b3e762 100644 (file)
@@ -5,6 +5,13 @@
 package test
 
 // Constants
+const (
+       sizeofPtr = 0x4;
+       sizeofShort = 0x2;
+       sizeofInt = 0x4;
+       sizeofLong = 0x4;
+       sizeofLongLong = 0x8;
+)
 
 // Types
 
index a694f4a73d1abb7effdc271e12854466267e2d77..c9e18a9b0b680e5e41ac573878962756fcaba15c 100644 (file)
@@ -5,6 +5,13 @@
 package test
 
 // Constants
+const (
+       sizeofPtr = 0x8;
+       sizeofShort = 0x2;
+       sizeofInt = 0x4;
+       sizeofLong = 0x8;
+       sizeofLongLong = 0x8;
+)
 
 // Types
 
diff --git a/src/cmd/godefs/testdata_linux_arm.golden b/src/cmd/godefs/testdata_linux_arm.golden
new file mode 100644 (file)
index 0000000..9fd4818
--- /dev/null
@@ -0,0 +1,38 @@
+// ./godefs -g test testdata.c
+
+// MACHINE GENERATED - DO NOT EDIT.
+
+package test
+
+// Constants
+const (
+       sizeofPtr = 0x4;
+       sizeofShort = 0x2;
+       sizeofInt = 0x4;
+       sizeofLong = 0x4;
+       sizeofLongLong = 0x8;
+)
+
+// Types
+
+type T2 struct {
+       A uint8;
+       Pad_godefs_0 [3]byte;
+       B uint32;
+       C uint32;
+       D uint16;
+       Pad_godefs_1 [2]byte;
+}
+
+type T3 struct {
+       A uint8;
+       Pad_godefs_0 [3]byte;
+       Pad0 int32;
+}
+
+type T4 struct {
+}
+
+type T5 struct {
+       A *T4;
+}