| 1 |
// RUN: %clang_cc1 -emit-llvm -triple s390x-ibm-zos -fzos-extensions -fdump-record-layouts < %s | FileCheck %s --check-prefix=PTR32-ZOS |
| 2 |
// RUN: %clang_cc1 -emit-llvm -triple s390x-ibm-linux -fzos-extensions -fdump-record-layouts < %s | FileCheck %s --check-prefix=PTR32-LINUX |
| 3 |
// RUN: %clang_cc1 -emit-llvm -triple s390x-linux-gnu -fzos-extensions -fdump-record-layouts < %s | FileCheck %s --check-prefix=PTR32-LINUX |
| 4 |
|
| 5 |
// PTR32-ZOS: 0 | struct s1 |
| 6 |
// PTR32-ZOS-NEXT: 0 | long a |
| 7 |
// PTR32-ZOS-NEXT: 8 | int b |
| 8 |
// PTR32-ZOS-NEXT: 12 | int * __ptr32 c |
| 9 |
// PTR32-ZOS-NEXT: 16 | int d |
| 10 |
// PTR32-ZOS-NEXT: | [sizeof=24, align=8] |
| 11 |
|
| 12 |
// PTR32-LINUX: 0 | struct s1 |
| 13 |
// PTR32-LINUX-NEXT: 0 | long a |
| 14 |
// PTR32-LINUX-NEXT: 8 | int b |
| 15 |
// PTR32-LINUX-NEXT: 16 | int * __ptr32 c |
| 16 |
// PTR32-LINUX-NEXT: 24 | int d |
| 17 |
// PTR32-LINUX-NEXT: | [sizeof=32, align=8] |
| 18 |
struct s1 { |
| 19 |
long a; |
| 20 |
int b; |
| 21 |
int * __ptr32 c; |
| 22 |
int d; |
| 23 |
} S1; |
| 24 |
|
| 25 |
// PTR32-ZOS: 0 | struct s2 |
| 26 |
// PTR32-ZOS-NEXT: 0 | long a |
| 27 |
// PTR32-ZOS-NEXT: 8 | int b |
| 28 |
// PTR32-ZOS-NEXT: 16 | int * c |
| 29 |
// PTR32-ZOS-NEXT: 24 | int d |
| 30 |
// PTR32-ZOS-NEXT: | [sizeof=32, align=8] |
| 31 |
|
| 32 |
// PTR32-LINUX: 0 | struct s2 |
| 33 |
// PTR32-LINUX-NEXT: 0 | long a |
| 34 |
// PTR32-LINUX-NEXT: 8 | int b |
| 35 |
// PTR32-LINUX-NEXT: 16 | int * c |
| 36 |
// PTR32-LINUX-NEXT: 24 | int d |
| 37 |
// PTR32-LINUX-NEXT: | [sizeof=32, align=8] |
| 38 |
struct s2 { |
| 39 |
long a; |
| 40 |
int b; |
| 41 |
int *c; |
| 42 |
int d; |
| 43 |
} S2; |
| 44 |
|
| 45 |
// PTR32-ZOS: 0 | struct s3 |
| 46 |
// PTR32-ZOS-NEXT: 0 | int a |
| 47 |
// PTR32-ZOS-NEXT: 4 | int * __ptr32 b |
| 48 |
// PTR32-ZOS-NEXT: 8 | int * __ptr32 c |
| 49 |
// PTR32-ZOS-NEXT: 12 | int * d |
| 50 |
// PTR32-ZOS-NEXT: | [sizeof=20, align=1] |
| 51 |
|
| 52 |
struct __attribute__((packed)) s3 { |
| 53 |
int a; |
| 54 |
int *__ptr32 b; |
| 55 |
int *__ptr32 c; |
| 56 |
int *d; |
| 57 |
}; |
| 58 |
struct s3 S3; |
| 59 |
|
| 60 |
// PTR32-ZOS: 0 | union u1 |
| 61 |
// PTR32-ZOS-NEXT: 0 | int * __ptr32 a |
| 62 |
// PTR32-ZOS-NEXT: 0 | int * b |
| 63 |
// PTR32-ZOS-NEXT: | [sizeof=8, align=8] |
| 64 |
|
| 65 |
// PTR32-LINUX: 0 | union u1 |
| 66 |
// PTR32-LINUX-NEXT: 0 | int * __ptr32 a |
| 67 |
// PTR32-LINUX-NEXT: 0 | int * b |
| 68 |
// PTR32-LINUX-NEXT: | [sizeof=8, align=8] |
| 69 |
union u1 { |
| 70 |
int *__ptr32 a; |
| 71 |
int *b; |
| 72 |
} U1; |
| 73 |
|
| 74 |
// PTR32-ZOS: 0 | union u2 |
| 75 |
// PTR32-ZOS-NEXT: 0 | int * __ptr32 a |
| 76 |
// PTR32-ZOS-NEXT: 0 | int * b |
| 77 |
// PTR32-ZOS-NEXT: | [sizeof=8, align=1] |
| 78 |
|
| 79 |
union __attribute__((packed)) u2 { |
| 80 |
int *__ptr32 a; |
| 81 |
int *b; |
| 82 |
}; |
| 83 |
union u2 U2; |
| 84 |
|
| 85 |
// PTR32-ZOS: 0 | union u3 |
| 86 |
// PTR32-ZOS-NEXT: 0 | int * __ptr32 a |
| 87 |
// PTR32-ZOS-NEXT: 0 | short b |
| 88 |
// PTR32-ZOS-NEXT: | [sizeof=4, align=1] |
| 89 |
|
| 90 |
union __attribute__((packed)) u3 { |
| 91 |
int *__ptr32 a; |
| 92 |
short b; |
| 93 |
}; |
| 94 |
union u3 U3; |