Implement missing support for range init for local variables.
Showing the changes to tests (2 of 3 files). Show all
Unified · Split
| @@ -148,6 +148,9 @@ void foo (struct W *w, struct pkthdr *phdr_) · 147 unmodified lines | ||
| 148 | 148 | struct V lv3 = {((struct S){7,8,{9,10}}), ((const struct W *)w)->t.t, 50}; |
| 149 | 149 | const struct pkthdr *phdr = phdr_; |
| 150 | 150 | struct flowi6 flow = { .daddr = phdr->daddr, .saddr = phdr->saddr }; |
| 151 | + int elt = 0x42; | |
| 152 | + /* Range init, overlapping */ | |
| 153 | + struct T lt2 = { { [1 ... 5] = 9, [6 ... 10] = elt, [4 ... 7] = elt+1 }, 1 }; | |
| 151 | 154 | print(ls); |
| 152 | 155 | print(ls2); |
| 153 | 156 | print(lt); |
| @@ -163,6 +166,7 @@ void foo (struct W *w, struct pkthdr *phdr_) · 9 unmodified lines | ||
| 163 | 166 | print(lv); |
| 164 | 167 | print(lv2); |
| 165 | 168 | print(lv3); |
| 169 | + print(lt2); | |
| 166 | 170 | print(flow); |
| 167 | 171 | } |
| 168 | 172 | #endif |
| @@ -33,4 +33,5 @@ ls3: 1 2 3 4 · 32 unmodified lines | ||
| 33 | 33 | lv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e |
| 34 | 34 | lv2: 1 2 3 4 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 |
| 35 | 35 | lv3: 7 8 9 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 |
| 36 | +lt2: 0 9 9 9 43 43 43 43 42 42 42 0 0 0 0 0 1 | |
| 36 | 37 | flow: 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 |