repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[clang] Handle __declspec() attributes in using
[llvm-project.git]
/
clang
/
test
/
CodeGen
/
2007-09-12-PragmaPack.c
blob
71c7537e9dcab5360350768ca1cc3db62ab53472
1
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
2
3
typedef
unsigned char uint8_t
;
4
typedef
unsigned short uint16_t
;
5
typedef
unsigned int uint32_t
;
6
7
#pragma pack(push, 1)
8
typedef
struct
9
{
10
uint32_t
a
;
11
}
foo
;
12
13
typedef
struct
{
14
uint8_t
major
;
15
uint8_t
minor
;
16
uint16_t
build
;
17
}
VERSION
;
18
19
typedef
struct
{
20
uint8_t
a
[
5
];
21
VERSION version
;
22
uint8_t
b
;
23
foo d
;
24
uint32_t
guard
;
25
}
bar
;
26
#pragma pack(pop)
27
28
29
unsigned
barsize
(
void
) {
30
// CHECK: ret i32 18
31
return sizeof
(
bar
);
32
}