summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-05 08:11:34 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-05 08:11:34 +0000
commita6c369cbd63996c1571ae601b7d92070f024b22c (patch)
treedc4f3f5a52ae4ea230f307ce5f442137f014b79b /test
parentb55147379939553eccd4289fd18e7f161619be4d (diff)
Merge of the "alignas" branch.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2342 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test')
-rw-r--r--test/regression/packedstruct1.c14
-rw-r--r--test/regression/packedstruct2.c10
2 files changed, 5 insertions, 19 deletions
diff --git a/test/regression/packedstruct1.c b/test/regression/packedstruct1.c
index e7b6c1d..e5526ed 100644
--- a/test/regression/packedstruct1.c
+++ b/test/regression/packedstruct1.c
@@ -6,9 +6,7 @@
/* Simple packing */
-#pragma pack(1)
-
-struct s1 { unsigned short x; int y; double z; };
+struct __packed__ s1 { unsigned short x; int y; double z; };
void test1(void)
{
@@ -22,9 +20,7 @@ void test1(void)
/* Packing plus alignment */
-#pragma pack(2,16)
-
-struct s2 { unsigned char x; int y; double z; };
+struct __packed__(2,16) s2 { unsigned char x; int y; double z; };
char filler1;
@@ -42,8 +38,6 @@ void test2(void)
/* Now with byte-swapped fields */
-#pragma pack(1,1,1)
-
struct s3 {
unsigned char x;
unsigned short y;
@@ -53,7 +47,7 @@ struct s3 {
char * p;
unsigned int t[3];
unsigned char s[2];
-};
+} __packed__(1,1,1);
struct s3 s3;
@@ -83,8 +77,6 @@ void test3(void)
/* Back to normal */
-#pragma pack()
-
struct s4 { unsigned short x; int y; double z; };
void test4(void)
diff --git a/test/regression/packedstruct2.c b/test/regression/packedstruct2.c
index 0c383a4..37c736e 100644
--- a/test/regression/packedstruct2.c
+++ b/test/regression/packedstruct2.c
@@ -4,9 +4,7 @@
/* Simple packing */
-#pragma pack(1)
-
-struct s1 { unsigned short x; int y; char z; };
+struct __packed__ s1 { unsigned short x; int y; char z; };
struct s1 s1 = { 2345, -12345678, 'x' };
@@ -17,9 +15,7 @@ void test1(void)
/* Now with byte-swapped fields */
-#pragma pack(1,1,1)
-
-struct s3 {
+struct __packed__(1,1,1) s3 {
unsigned char x;
unsigned short y;
unsigned int z;
@@ -47,8 +43,6 @@ void test3(void)
/* Back to normal */
-#pragma pack()
-
struct s4 { unsigned short x; int y; double z; };
struct s4 s4 = { 123, -456789, 3.14159 };