mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-20 18:48:13 +00:00
Testcase for structure field reordering
llvm-svn: 1247
This commit is contained in:
parent
79fd0836bb
commit
485b4f452a
30
test/StructModifyTest.c
Normal file
30
test/StructModifyTest.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
typedef struct {
|
||||||
|
int w;
|
||||||
|
float x;
|
||||||
|
double y;
|
||||||
|
long long z;
|
||||||
|
} S1Ty;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
S1Ty A, B;
|
||||||
|
} S2Ty;
|
||||||
|
|
||||||
|
void printS1(S1Ty *V) {
|
||||||
|
printf("%d, %f, %f, %lld\n", V->w, V->x, V->y, V->z);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
S2Ty E;
|
||||||
|
E.A.w = 1;
|
||||||
|
E.A.x = 123.42f;
|
||||||
|
E.A.y = 19.0;
|
||||||
|
E.A.z = 123455678902ll;
|
||||||
|
E.B.w = 2;
|
||||||
|
E.B.x = 23.42f;
|
||||||
|
E.B.y = 29.0;
|
||||||
|
E.B.z = 23455678902ll;
|
||||||
|
|
||||||
|
printS1(&E.A);
|
||||||
|
printS1(&E.B);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user