Skip to content

Commit 383bd69

Browse files
authored
[clang][bytecode][test] Enable a few tests in const-eval.c (#160034)
They didn't use to work but do now.
1 parent e396dab commit 383bd69

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

clang/test/AST/ByteCode/const-eval.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66
/// This is a version of test/Sema/const-eval.c with the
77
/// tests commented out that the new constant expression interpreter does
8-
/// not support yet. They are all marked with the NEW_INTERP define:
9-
///
10-
/// - builtin_constant_p
11-
/// - unions
12-
8+
/// not support yet. They are all marked with the NEW_INTERP define.
139

1410
#define EVAL_EXPR(testno, expr) enum { test##testno = (expr) }; struct check_positive##testno { int a[test##testno]; };
1511
int x;
@@ -52,9 +48,7 @@ struct s {
5248

5349
EVAL_EXPR(19, ((int)&*(char*)10 == 10 ? 1 : -1));
5450

55-
#ifndef NEW_INTERP
5651
EVAL_EXPR(20, __builtin_constant_p(*((int*) 10)));
57-
#endif
5852

5953
EVAL_EXPR(21, (__imag__ 2i) == 2 ? 1 : -1);
6054

@@ -112,11 +106,9 @@ int intLvalue[*(int*)((long)&n ?: 1)] = { 1, 2 }; // both-error {{variable lengt
112106
union u { int a; char b[4]; };
113107
char c = ((union u)(123456)).b[0]; // both-error {{not a compile-time constant}}
114108

115-
#ifndef NEW_INTERP
116109
extern const int weak_int __attribute__((weak));
117110
const int weak_int = 42;
118111
int weak_int_test = weak_int; // both-error {{not a compile-time constant}}
119-
#endif
120112

121113
int literalVsNull1 = "foo" == 0;
122114
int literalVsNull2 = 0 == "foo";
@@ -125,10 +117,8 @@ int literalVsNull2 = 0 == "foo";
125117
int castViaInt[*(int*)(unsigned long)"test"]; // both-error {{variable length array}}
126118

127119
// PR11391.
128-
#ifndef NEW_INTERP
129120
struct PR11391 { _Complex float f; } pr11391;
130121
EVAL_EXPR(42, __builtin_constant_p(pr11391.f = 1))
131-
#endif
132122

133123
// PR12043
134124
float varfloat;

0 commit comments

Comments
 (0)