forked from OSchip/llvm-project
We're in a constant context in the ConstantEmitter.
llvm-svn: 348029
This commit is contained in:
parent
601d311326
commit
e64fe2abae
|
@ -1552,7 +1552,8 @@ llvm::Constant *ConstantEmitter::tryEmitPrivate(const Expr *E,
|
|||
if (destType->isReferenceType())
|
||||
Success = E->EvaluateAsLValue(Result, CGM.getContext());
|
||||
else
|
||||
Success = E->EvaluateAsRValue(Result, CGM.getContext());
|
||||
Success = E->EvaluateAsRValue(Result, CGM.getContext(),
|
||||
/* InConstantContext */ true);
|
||||
|
||||
llvm::Constant *C;
|
||||
if (Success && !Result.HasSideEffects)
|
||||
|
|
|
@ -157,3 +157,14 @@ static void src_fn(void) {
|
|||
void test14() {
|
||||
assign(dest_p, src_fn);
|
||||
}
|
||||
|
||||
struct test15_s {
|
||||
const char *name;
|
||||
int num_args;
|
||||
};
|
||||
|
||||
extern int test15_v;
|
||||
|
||||
struct test15_s tcg_op_defs_org_x86_64[] = {
|
||||
{"tag", __builtin_constant_p(test15_v) && !test15_v ? 0x10 : 0 },
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue