summaryrefslogtreecommitdiffstats
path: root/test/Sema/const-eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/const-eval.c')
-rw-r--r--test/Sema/const-eval.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/const-eval.c b/test/Sema/const-eval.c
index f1c0485..bc8b227 100644
--- a/test/Sema/const-eval.c
+++ b/test/Sema/const-eval.c
@@ -121,3 +121,13 @@ EVAL_EXPR(43, varfloat && constfloat) // expected-error {{must have a constant s
// <rdar://problem/11205586>
// (Make sure we continue to reject this.)
EVAL_EXPR(44, "x"[0]); // expected-error {{variable length array}}
+
+// <rdar://problem/10962435>
+EVAL_EXPR(45, ((char*)-1) + 1 == 0 ? 1 : -1)
+EVAL_EXPR(46, ((char*)-1) + 1 < (char*) -1 ? 1 : -1)
+EVAL_EXPR(47, &x < &x + 1 ? 1 : -1)
+EVAL_EXPR(48, &x != &x - 1 ? 1 : -1)
+EVAL_EXPR(49, &x < &x - 100 ? 1 : -1) // expected-error {{must have a constant size}}
+
+extern struct Test50S Test50;
+EVAL_EXPR(50, &Test50 < (struct Test50S*)((unsigned)&Test50 + 10)) // expected-error {{must have a constant size}}
OpenPOWER on IntegriCloud