const ValueDecl *Decl = E->getDecl();
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(Decl))
return CGM.GetAddrOfFunctionDecl(FD, false);
+ if (const EnumConstantDecl *EC = dyn_cast<EnumConstantDecl>(Decl))
+ return llvm::ConstantInt::get(EC->getInitVal());
assert(0 && "Unsupported decl ref type!");
return 0;
}
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 };
// RUN: clang -emit-llvm %s
void f1()
{
- // Braces in a scalar
+ // Scalars in braces.
int a = { 1 };
int b = { 1, 2 };
-}
\ No newline at end of file
+}