summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-3585.c
blob: e5421f79a0c6df31a8177198af67f7e19eaab89a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* bug-3547.c
   A bug in the promotion of char operands of the ternary operator.
 */

#include <testfwk.h>

int f(unsigned char u) {
    return u&4 ? u : -1; // returns negative int
    //return u&4 ? (int)u : -1; // works
}

void
testBug (void) {
    ASSERT (f(0x9f) == 0x9f);
}