New tests for Packed structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35685 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-04-05 17:07:48 +00:00
parent c8c5752b2f
commit 13eb4c6587
4 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// RUN: %llvmgcc %s -S -o -
# define pck __attribute__((packed))
struct pck F {
unsigned long long i : 12,
j : 23,
k : 27,
l;
};
struct F f1;
void foo() {
f1.l = 5;
}

View File

@ -0,0 +1,16 @@
// RUN: %llvmgcc %s -S -o -
# define pck __attribute__((packed))
struct pck E {
unsigned long long l,
i : 12,
j : 23,
k : 29; };
struct E e1;
void foo() {
e1.k = 5;
}

View File

@ -0,0 +1,18 @@
// RUN: %llvmgcc %s -S -o -
#pragma pack(push, 2)
enum {
tA = 0,
tB = 1
};
struct MyStruct {
unsigned long A;
char C;
void * B;
};
void bar(){
struct MyStruct MS = { tB, 0 };
}

View File

@ -0,0 +1,16 @@
// RUN: %llvmgcc %s -S -o -
enum {
tA = 0,
tB = 1
};
struct MyStruct {
unsigned long A;
void * B;
};
void bar(){
struct MyStruct MS = { tB, 0 };
}