1
0
mirror of https://github.com/golang/go synced 2024-11-12 03:40:21 -07:00

godefs: add enum/const testdata

Also, add golden output data for linux/arm.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5256041
This commit is contained in:
Dave Cheney 2011-10-14 17:34:00 -04:00 committed by Russ Cox
parent 55751a38f0
commit a3ff67c3a7
4 changed files with 64 additions and 1 deletions

View File

@ -38,4 +38,15 @@ struct T5 {
typedef struct T5 T5;
typedef struct T4 $T4;
typedef T5 $T5;
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),
};

View File

@ -5,6 +5,13 @@
package test
// Constants
const (
sizeofPtr = 0x4;
sizeofShort = 0x2;
sizeofInt = 0x4;
sizeofLong = 0x4;
sizeofLongLong = 0x8;
)
// Types

View File

@ -5,6 +5,13 @@
package test
// Constants
const (
sizeofPtr = 0x8;
sizeofShort = 0x2;
sizeofInt = 0x4;
sizeofLong = 0x8;
sizeofLongLong = 0x8;
)
// Types

View File

@ -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;
}