1 #define TEST(X, T) if (__SIZEOF_ ## X ## __ != sizeof(T)) return 1
2
3 int test_sizeof(void)
4 {
5 TEST(SHORT, short);
6 TEST(INT, int);
7 TEST(LONG, long);
8 TEST(LONG_LONG, long long);
9 TEST(INT128, __int128);
10 TEST(SIZE_T, __SIZE_TYPE__);
11 TEST(POINTER, void*);
12 TEST(FLOAT, float);
13 TEST(DOUBLE, double);
14 TEST(LONG_DOUBLE, long double);
15
16 return 0;
17 }
18
19 /*
20 * check-name: predefined __SIZEOF_<type>__
21 * check-command: test-linearize -Wno-decl $file
22 * check-output-ignore
23 *
24 * check-output-contains: ret\\..*\\$0
25 */