summaryrefslogtreecommitdiff
path: root/src/cmd/godefs/testdata.c
blob: 3f459c41ba48887e0836982b804be04bd6dbf17f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2011 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.

#include <stdint.h>

// Issue 432 - enum fields in struct can cause misaligned struct fields
typedef enum {
	a
} T1;

struct T2 {
	uint8_t a;
	T1 b;
	T1 c;
	uint16_t d;
};

typedef struct T2 T2;
typedef T2 $T2;

// Issue 1162 - structs with fields named Pad[0-9]+ conflict with field
// names used by godefs for padding
struct T3 {
	uint8_t a;
	int Pad0;
};

typedef struct T3 $T3;

// Issue 1466 - forward references to types in stabs debug info were
// always treated as enums
struct T4 {};

struct T5 {
	struct T4 *a;
};

typedef struct T5 T5;
typedef struct T4 $T4;
typedef T5 $T5;