summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/compound-literal.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/compound-literal.c')
-rw-r--r--clang/test/Sema/compound-literal.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/Sema/compound-literal.c b/clang/test/Sema/compound-literal.c
index c5c0c17143f..217dbeda8a7 100644
--- a/clang/test/Sema/compound-literal.c
+++ b/clang/test/Sema/compound-literal.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -pedantic %s
// REQUIRES: LP64
struct foo { int a, b; };
@@ -36,3 +36,9 @@ void IncompleteFunc(unsigned x) {
// PR6080
int array[(sizeof(int[3]) == sizeof( (int[]) {0,1,2} )) ? 1 : -1];
+
+// rdar://28949016 - Constant restriction should not apply to compound literals in blocks
+int (^block)(int) = ^(int i) {
+ int *array = (int[]) {i, i + 2, i + 4};
+ return array[i];
+};
OpenPOWER on IntegriCloud