mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
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:
parent
c8c5752b2f
commit
13eb4c6587
16
test/CFrontend/2007-04-05-PackedBitFields-2.c
Normal file
16
test/CFrontend/2007-04-05-PackedBitFields-2.c
Normal 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;
|
||||
}
|
16
test/CFrontend/2007-04-05-PackedBitFields.c
Normal file
16
test/CFrontend/2007-04-05-PackedBitFields.c
Normal 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;
|
||||
}
|
18
test/CFrontend/2007-04-05-PackedStruct.c
Normal file
18
test/CFrontend/2007-04-05-PackedStruct.c
Normal 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 };
|
||||
}
|
16
test/CFrontend/2007-04-05-UnPackedStruct.c
Normal file
16
test/CFrontend/2007-04-05-UnPackedStruct.c
Normal 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 };
|
||||
}
|
Loading…
Reference in New Issue
Block a user