summaryrefslogtreecommitdiffstats
path: root/test/Analysis/region-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/region-store.c')
-rw-r--r--test/Analysis/region-store.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/region-store.c b/test/Analysis/region-store.c
new file mode 100644
index 0000000..09c3f10
--- /dev/null
+++ b/test/Analysis/region-store.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s
+
+int printf(const char *restrict,...);
+
+// Testing core functionality of the region store.
+// radar://10127782
+int compoundLiteralTest() {
+ int index = 0;
+ for (index = 0; index < 2; index++) {
+ int thing = (int []){0, 1}[index];
+ printf("thing: %i\n", thing);
+ }
+ return 0;
+}
+
+int compoundLiteralTest2() {
+ int index = 0;
+ for (index = 0; index < 3; index++) {
+ int thing = (int [][3]){{0,0,0}, {1,1,1}, {2,2,2}}[index][index];
+ printf("thing: %i\n", thing);
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud