struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3795.c
blob7711f3a19484fc07dcca3338968d10a378775af4
1 /* bug-3795.c
2 Triggered an assertion in optimization in zsdcc 4.4.0.
3 (see also https://github.com/z88dk/z88dk/issues/2635)
4 */
6 #include <testfwk.h>
8 #include <stdint.h>
10 uint8_t IntNorms[2][4] = { {0x1F, 0x00, 0x3E, 0x1F},
11 {0x9F, 0x12, 0x37, 0x10}, };
12 float test_s;
14 void f(void)
16 uint8_t i = 0;
17 int16_t value16x;
19 while(i < 2)
21 value16x = (int16_t)IntNorms[i][0];
22 test_s = (float)value16x;
23 ++i;
27 void testBug(void)
29 f();
30 ASSERT(test_s == 0x9F);