summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-3850.c
blob: 2c4aa3aea492106f533b1ad11e9c24cb150ef888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* bug-3850.c
   An issue in handling of non-dead register a in z80 codegen for casts to bool.
 */
 
#include <testfwk.h>

#include <stdbool.h>

struct {
    bool b : 1;
} x;
bool f( void ) { return true; }
int m( void ) {
    x.b |= f();
    return 0;
}

void testBug (void) {
    x.b = false;
    m();
    ASSERT(x.b);
}