From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGen/2007-09-12-PragmaPack.c | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 clang/test/CodeGen/2007-09-12-PragmaPack.c (limited to 'clang/test/CodeGen/2007-09-12-PragmaPack.c') diff --git a/clang/test/CodeGen/2007-09-12-PragmaPack.c b/clang/test/CodeGen/2007-09-12-PragmaPack.c new file mode 100644 index 0000000..71c7537 --- /dev/null +++ b/clang/test/CodeGen/2007-09-12-PragmaPack.c @@ -0,0 +1,32 @@ +// 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); +} -- cgit v1.2.3