aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-08 21:08:34 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-08 21:08:34 +0000
commit2016c8c4a2ebf528c54c42045bc6a30ae590147c (patch)
tree4b9cba99a858d6031f83063ed8ee14882157bdb2 /test
parent871ee56e8003b8ce6f0658351ca051db504d9dc4 (diff)
Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier versions of clang. Regression from r156531. <rdar://problem/12048621>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/pragma-pack-6.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Sema/pragma-pack-6.c b/test/Sema/pragma-pack-6.c
new file mode 100644
index 0000000000..40659c23bd
--- /dev/null
+++ b/test/Sema/pragma-pack-6.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify
+
+// Pragma pack handling with tag declarations
+
+struct X;
+
+#pragma pack(2)
+struct X { int x; };
+struct Y;
+#pragma pack()
+
+struct Y { int y; };
+
+extern int check[__alignof(struct X) == 2 ? 1 : -1];
+extern int check[__alignof(struct Y) == 4 ? 1 : -1];
+