summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/transparent-union.c
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-02-28 20:44:39 +0000
committerErich Keane <erich.keane@intel.com>2017-02-28 20:44:39 +0000
commit2fe684bb1478ef89efd8122e442ec76efaf5f857 (patch)
tree6ea9d1a0ddbbff7504694a42228813b530c965e9 /clang/test/CodeGen/transparent-union.c
parent318971880e76eb8922351451a25099be2856975d (diff)
downloadbcm5719-llvm-2fe684bb1478ef89efd8122e442ec76efaf5f857.tar.gz
bcm5719-llvm-2fe684bb1478ef89efd8122e442ec76efaf5f857.zip
Allow attributes before union definition
permits typedef union __attribute__((transparent_union)) {...} Differential Revision: https://reviews.llvm.org/D28266 llvm-svn: 296518
Diffstat (limited to 'clang/test/CodeGen/transparent-union.c')
-rw-r--r--clang/test/CodeGen/transparent-union.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/transparent-union.c b/clang/test/CodeGen/transparent-union.c
index 2f00c2d21a0..efaef1bae98 100644
--- a/clang/test/CodeGen/transparent-union.c
+++ b/clang/test/CodeGen/transparent-union.c
@@ -3,10 +3,21 @@
// RUN: %clang_cc1 -Werror -triple armv7-linux -emit-llvm -o - %s | FileCheck %s --check-prefix=ARM
// RUN: %clang_cc1 -Werror -triple powerpc64le-linux -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -Werror -triple aarch64-linux -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -DINFRONT -Werror -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -DINFRONT -Werror -triple i386-linux -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -DINFRONT -Werror -triple armv7-linux -emit-llvm -o - %s | FileCheck %s --check-prefix=ARM
+// RUN: %clang_cc1 -DINFRONT -Werror -triple powerpc64le-linux -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -DINFRONT -Werror -triple aarch64-linux -emit-llvm -o - %s | FileCheck %s
+#ifdef INFRONT
+typedef union __attribute__((transparent_union)) {
+ void *f0;
+} transp_t0;
+#else
typedef union {
void *f0;
} transp_t0 __attribute__((transparent_union));
+#endif
void f0(transp_t0 obj);
OpenPOWER on IntegriCloud