mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 02:16:06 +00:00

CodeGen/2003-08-21-WideString.c CodeGen/2003-10-02-UnionLValueError.c CodeGen/2004-02-20-Builtins.c CodeGen/2008-01-04-WideBitfield.c CodeGen/2002-07-14-MiscTests3.c CodeGen/2005-04-09-ComplexOps.c CodeGen/2008-12-23-AsmIntPointerTie.c CodeGen/2005-07-20-SqrtNoErrno.c CodeGen/2005-01-02-VAArgError-ICE.c CodeGen/2004-06-17-UnorderedCompares.c CodeGen/2002-06-25-FWriteInterfaceFailure.c CodeGen/2002-02-18-64bitConstant.c CodeGen/2002-05-24-Alloca.c CodeGen/2006-01-13-Includes.c CodeGen/2007-09-27-ComplexIntCompare.c CodeGen/2004-02-13-IllegalVararg.c CodeGen/2007-09-12-PragmaPack.c CodeGen/2002-08-02-UnionTest.c from test/FrontendC with changes to remove header file includes. llvm-svn: 136153
33 lines
600 B
C
33 lines
600 B
C
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
|
|
|
|
typedef unsigned char uint8_t;
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned int uint32_t;
|
|
|
|
#pragma pack(push, 1)
|
|
typedef struct
|
|
{
|
|
uint32_t a;
|
|
} foo;
|
|
|
|
typedef struct {
|
|
uint8_t major;
|
|
uint8_t minor;
|
|
uint16_t build;
|
|
} VERSION;
|
|
|
|
typedef struct {
|
|
uint8_t a[5];
|
|
VERSION version;
|
|
uint8_t b;
|
|
foo d;
|
|
uint32_t guard;
|
|
} bar;
|
|
#pragma pack(pop)
|
|
|
|
|
|
unsigned barsize(void) {
|
|
// CHECK: ret i32 18
|
|
return sizeof(bar);
|
|
}
|