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/Sema/pragma-pack.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 clang/test/Sema/pragma-pack.c (limited to 'clang/test/Sema/pragma-pack.c') diff --git a/clang/test/Sema/pragma-pack.c b/clang/test/Sema/pragma-pack.c new file mode 100644 index 0000000..e93ce42 --- /dev/null +++ b/clang/test/Sema/pragma-pack.c @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify %s + +/* expected-warning {{value of #pragma pack(show) == 8}} */ #pragma pack(show) +/* expected-warning {{expected #pragma pack parameter to be}} */ #pragma pack(3) +/* expected-warning {{value of #pragma pack(show) == 8}} */ #pragma pack(show) +#pragma pack(4) +/* expected-warning {{value of #pragma pack(show) == 4}} */ #pragma pack(show) +#pragma pack() // resets to default +/* expected-warning {{value of #pragma pack(show) == 8}} */ #pragma pack(show) +#pragma pack(2) +#pragma pack(push, eek, 16) // -> (eek, 2), 16 +/* expected-warning {{value of #pragma pack(show) == 16}} */ #pragma pack(show) +#pragma pack(push) // -> (eek, 2), (, 2), 16 +/* expected-warning {{value of #pragma pack(show) == 16}} */ #pragma pack(show) +#pragma pack(1) +#pragma pack(push, 8) // -> (eek, 2), (, 2), (, 1), 8 +/* expected-warning {{value of #pragma pack(show) == 8}} */ #pragma pack(show) +#pragma pack(pop) // -> (eek, 2), (,2), 1 +/* expected-warning {{value of #pragma pack(show) == 1}} */ #pragma pack(show) +#pragma pack(pop, eek) +/* expected-warning {{value of #pragma pack(show) == 2}} */ #pragma pack(show) +/* expected-warning {{pack(pop, ...) failed: stack empty}} */ #pragma pack(pop) + +#pragma pack(push) +#pragma pack(pop, 16) +/* expected-warning {{value of #pragma pack(show) == 16}} */ #pragma pack(show) + -- cgit v1.2.3