aboutsummaryrefslogtreecommitdiff
path: root/conftest.c
blob: a803bffe272b0a75e92755b52096ecd144ca8776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>

int main(int argc, char *argv[])
{
    switch(argc == 2 ? argv[1][0] : 0) {
#ifdef __GNUC__
        case 'v':
            printf("%d\n", __GNUC__);
            break;
        case 'm':
            printf("%d\n", __GNUC_MINOR__);
            break;
#else
        case 'v':
        case 'm':
            puts("0");
            break;
#endif
        case 'b':
        {
            volatile unsigned foo = 0x01234567;
            puts(*(unsigned char*)&foo == 0x67 ? "no" : "yes");
            break;
        }
        case -1:
            /* to test -Wno-unused-result */
            fread(NULL, 1, 1, NULL);
            break;
    }
    return 0;
}