aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/globalinit.c
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-01-29 01:28:48 +0000
committerAnders Carlsson <andersca@mac.com>2008-01-29 01:28:48 +0000
commita3881fc62ac1ddbf9c236fffd47b637fb4745bbd (patch)
treeeb454448b4ec35f5619354923bf9675be94e0006 /test/CodeGen/globalinit.c
parentf6884ac7cfc4c5562c0678ad65b3460a38f56e23 (diff)
Correctly handle constants that refer to enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/globalinit.c')
-rw-r--r--test/CodeGen/globalinit.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/CodeGen/globalinit.c b/test/CodeGen/globalinit.c
index 13a9e930bd..f868feb24a 100644
--- a/test/CodeGen/globalinit.c
+++ b/test/CodeGen/globalinit.c
@@ -32,6 +32,12 @@ void booltest2() {
static _Bool booltest3 = 4;
}
-// Braces in a scalar
-int a = { 1 };
-int b = { 1, 2 };
+// Scalars in braces.
+static int a = { 1 };
+static int b = { 1, 2 };
+
+enum {
+ EnumA, EnumB
+};
+
+int c[] = { EnumA, EnumB };