3 /* Define architecture */
4 #if defined(__i386__) || defined _M_IX86
5 # define TRIPLET_ARCH "i386"
6 #elif defined(__x86_64__) || defined _M_AMD64
7 # define TRIPLET_ARCH "x86_64"
9 # define TRIPLET_ARCH "arm"
10 #elif defined(__aarch64__)
11 # define TRIPLET_ARCH "aarch64"
13 # define TRIPLET_ARCH "unknown"
17 #if defined (__linux__)
18 # define TRIPLET_OS "linux"
19 #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
20 # define TRIPLET_OS "kfreebsd"
22 # define TRIPLET_OS "win32"
23 #elif !defined (__GNU__)
24 # define TRIPLET_OS "unknown"
27 /* Define calling convention and ABI */
28 #if defined (__ARM_EABI__)
29 # if defined (__ARM_PCS_VFP)
30 # define TRIPLET_ABI "gnueabihf"
32 # define TRIPLET_ABI "gnueabi"
35 # define TRIPLET_ABI "gnu"
39 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS
41 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_ABI
43 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS "-" TRIPLET_ABI
50 int main(int argc
, char *argv
[])
52 switch(argc
== 2 ? argv
[1][0] : 0) {
55 volatile unsigned foo
= 0x01234567;
56 puts(*(unsigned char*)&foo
== 0x67 ? "no" : "yes");
61 printf("%d\n", __GNUC_MINOR__
);
64 printf("%d\n", __GNUC__
);
66 #elif defined __TINYC__
71 printf("%d\n", __TINYC__
);