comparison gcc/testsuite/gcc.c-torture/execute/widechar-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 extern void abort (void);
2 extern void exit (int);
3
4 static int f(char *x)
5 {
6 return __builtin_strlen(x);
7 }
8
9 int foo ()
10 {
11 return f((char*)&L"abcdef"[0]);
12 }
13
14
15 int
16 main()
17 {
18 #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
19 if (foo () != 0)
20 abort ();
21 #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
22 if (foo () != 1)
23 abort ();
24 #endif
25 exit (0);
26 }