OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 // Issue 432 - enum fields in struct can cause misaligned struct fields | 7 // Issue 432 - enum fields in struct can cause misaligned struct fields |
8 typedef enum { | 8 typedef enum { |
9 a | 9 a |
10 } T1; | 10 } T1; |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Issue 1466 - forward references to types in stabs debug info were | 31 // Issue 1466 - forward references to types in stabs debug info were |
32 // always treated as enums | 32 // always treated as enums |
33 struct T4 {}; | 33 struct T4 {}; |
34 | 34 |
35 struct T5 { | 35 struct T5 { |
36 struct T4 *a; | 36 struct T4 *a; |
37 }; | 37 }; |
38 | 38 |
39 typedef struct T5 T5; | 39 typedef struct T5 T5; |
40 typedef struct T4 $T4; | 40 typedef struct T4 $T4; |
41 typedef T5 $T5; | 41 typedef T5 $T5; |
| 42 |
| 43 // Test constants and enumerations are printed correctly. clang/2.9 with· |
| 44 // -O2 and above causes Bprint to print %#llx values incorrectly. |
| 45 enum { |
| 46 » $sizeofPtr = sizeof(void*), |
| 47 » $sizeofShort = sizeof(short), |
| 48 » $sizeofInt = sizeof(int), |
| 49 » $sizeofLong = sizeof(long), |
| 50 » $sizeofLongLong = sizeof(long long), |
| 51 }; |
| 52 |
OLD | NEW |