Read/write declaration attributes from/to PCH properly. Embed them in the declaration block instead of trying to create another block.

The new block was messing with the assumption that after decls block comes the stmts block.
Fixes http://llvm.org/PR8406

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116737 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/PCH/attrs-PR8406.c b/test/PCH/attrs-PR8406.c
new file mode 100644
index 0000000..85225f5
--- /dev/null
+++ b/test/PCH/attrs-PR8406.c
@@ -0,0 +1,23 @@
+// Test this without pch.
+// RUN: %clang_cc1 -include %s -emit-llvm -o - %s | FileCheck %s
+
+// Test with pch.
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -include-pch %t -emit-llvm -o - %s | FileCheck %s
+
+#ifndef HEADER
+#define HEADER
+
+struct Bar
+{
+  // CHECK: align 512
+  int buffer[123] __attribute__((__aligned__(512)));
+};
+
+#else
+
+void foo() {
+  struct Bar bar;
+}
+
+#endif