7 /* Define architecture */
8 #if defined(__i386__) || defined _M_IX86
9 # define TRIPLET_ARCH "i386"
10 #elif defined(__x86_64__) || defined _M_AMD64
11 # define TRIPLET_ARCH "x86_64"
12 #elif defined(__arm__)
13 # define TRIPLET_ARCH "arm"
14 #elif defined(__aarch64__)
15 # define TRIPLET_ARCH "aarch64"
17 # define TRIPLET_ARCH "unknown"
21 #if defined (__linux__)
22 # define TRIPLET_OS "linux"
23 #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
24 # define TRIPLET_OS "kfreebsd"
26 # define TRIPLET_OS "win32"
27 #elif !defined (__GNU__)
28 # define TRIPLET_OS "unknown"
31 /* Define calling convention and ABI */
32 #if defined (__ARM_EABI__)
33 # if defined (__ARM_PCS_VFP)
34 # define TRIPLET_ABI "gnueabihf"
36 # define TRIPLET_ABI "gnueabi"
39 # define TRIPLET_ABI "gnu"
43 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS
45 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_ABI
47 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS "-" TRIPLET_ABI
54 int main(int argc
, char *argv
[])
57 _setmode(_fileno(stdout
), _O_BINARY
); /* don't translate \n to \r\n */
59 switch(argc
== 2 ? argv
[1][0] : 0) {
62 volatile unsigned foo
= 0x01234567;
63 puts(*(unsigned char*)&foo
== 0x67 ? "no" : "yes");
68 printf("%d\n", __GNUC_MINOR__
);
71 printf("%d\n", __GNUC__
);
73 #elif defined __TINYC__
78 printf("%d\n", __TINYC__
);