2014-02-13 08:50:02 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin9 %s | FileCheck %s
|
|
|
|
|
2011-04-27 07:52:16 +08:00
|
|
|
// rdar://8823265
|
|
|
|
|
|
|
|
#define ATTR __attribute__((__ms_struct__))
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char foo;
|
|
|
|
long : 0;
|
|
|
|
char bar;
|
|
|
|
} ATTR t1;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s1 = sizeof(t1);
|
|
|
|
// CHECK: @s1 = global i32 2
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char foo;
|
|
|
|
long : 0;
|
|
|
|
char : 0;
|
|
|
|
int : 0;
|
|
|
|
char bar;
|
|
|
|
} ATTR t2;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s2 = sizeof(t2);
|
|
|
|
// CHECK: @s2 = global i32 2
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char foo;
|
|
|
|
long : 0;
|
|
|
|
char : 0;
|
|
|
|
int : 0;
|
|
|
|
char bar;
|
|
|
|
long : 0;
|
|
|
|
char : 0;
|
|
|
|
} ATTR t3;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s3 = sizeof(t3);
|
|
|
|
// CHECK: @s3 = global i32 2
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
long : 0;
|
|
|
|
char bar;
|
|
|
|
} ATTR t4;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s4 = sizeof(t4);
|
|
|
|
// CHECK: @s4 = global i32 1
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
long : 0;
|
|
|
|
long : 0;
|
|
|
|
char : 0;
|
|
|
|
char bar;
|
|
|
|
} ATTR t5;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s5 = sizeof(t5);
|
|
|
|
// CHECK: @s5 = global i32 1
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
long : 0;
|
|
|
|
long : 0;
|
|
|
|
char : 0;
|
|
|
|
char bar;
|
|
|
|
} ATTR t6;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s6 = sizeof(t6);
|
|
|
|
// CHECK: @s6 = global i32 1
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char foo;
|
|
|
|
long : 0;
|
|
|
|
int : 0;
|
|
|
|
char bar;
|
|
|
|
char bar1;
|
|
|
|
long : 0;
|
|
|
|
char bar2;
|
|
|
|
char bar3;
|
|
|
|
char : 0;
|
|
|
|
char bar4;
|
|
|
|
char bar5;
|
|
|
|
char : 0;
|
|
|
|
char bar6;
|
|
|
|
char bar7;
|
|
|
|
} ATTR t7;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s7 = sizeof(t7);
|
|
|
|
// CHECK: @s7 = global i32 9
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
long : 0;
|
|
|
|
long : 0;
|
|
|
|
char : 0;
|
|
|
|
} ATTR t8;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s8 = sizeof(t8);
|
|
|
|
// CHECK: @s8 = global i32 0
|
2011-04-27 07:52:16 +08:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char foo;
|
|
|
|
long : 0;
|
|
|
|
int : 0;
|
|
|
|
char bar;
|
|
|
|
char bar1;
|
|
|
|
long : 0;
|
|
|
|
char bar2;
|
|
|
|
char bar3;
|
|
|
|
char : 0;
|
|
|
|
char bar4;
|
|
|
|
char bar5;
|
|
|
|
char : 0;
|
|
|
|
char bar6;
|
|
|
|
char bar7;
|
|
|
|
int i1;
|
|
|
|
char : 0;
|
|
|
|
long : 0;
|
|
|
|
char :4;
|
|
|
|
char bar8;
|
|
|
|
char : 0;
|
|
|
|
char bar9;
|
|
|
|
char bar10;
|
|
|
|
int i2;
|
|
|
|
char : 0;
|
|
|
|
long : 0;
|
|
|
|
char :4;
|
|
|
|
} ATTR t9;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s9 = sizeof(t9);
|
|
|
|
// CHECK: @s9 = global i32 28
|
2011-04-27 07:52:16 +08:00
|
|
|
|
2011-05-03 01:20:56 +08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
char foo: 8;
|
|
|
|
long : 0;
|
|
|
|
char bar;
|
|
|
|
} ATTR t10;
|
2014-02-13 08:50:02 +08:00
|
|
|
int s10 = sizeof(t10);
|
|
|
|
// CHECK: @s10 = global i32 16
|