diff options
author | Jordy Rose <jediknil@belkadan.com> | 2010-08-20 01:05:59 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2010-08-20 01:05:59 +0000 |
commit | 59b6dca7e5160d6f2aff42b1cf077d1cbd64e330 (patch) | |
tree | 253f87fb8ba9281a194ea8e321109a61983d39d9 /test/Analysis/array-struct-region.c | |
parent | 2283d79155a3e82442fce124ce5fd704ca138801 (diff) |
Handle nested compound values in BindArray for multidimensional arrays. Fixes PR7945.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/array-struct-region.c')
-rw-r--r-- | test/Analysis/array-struct-region.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/array-struct-region.c b/test/Analysis/array-struct-region.c index 2966d13004..dabd25bb1f 100644 --- a/test/Analysis/array-struct-region.c +++ b/test/Analysis/array-struct-region.c @@ -23,3 +23,25 @@ int string_literal_init() { return 42; } + +void nested_compound_literals(int rad) { + int vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + int a; + + for (a = 0; a < 6; ++a) { + vec[a][0] *= rad; // no-warning + vec[a][1] *= rad; // no-warning + } +} + +void nested_compound_literals_float(float rad) { + float vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + int a; + + for (a = 0; a < 6; ++a) { + vec[a][0] *= rad; // no-warning + vec[a][1] *= rad; // no-warning + } +} |