1*1f5207b7SJohn Levon // requires constant integer expressions
2*1f5207b7SJohn Levon static int bar[] = {
3*1f5207b7SJohn Levon 	[__builtin_bswap16(0x1234)] = 0,		// OK
4*1f5207b7SJohn Levon 	[__builtin_bswap32(0x1234)] = 0,		// OK
5*1f5207b7SJohn Levon 	[__builtin_bswap64(0x1234)] = 0,		// OK
6*1f5207b7SJohn Levon };
7*1f5207b7SJohn Levon 
8*1f5207b7SJohn Levon // requires constant integers
foo(unsigned long long a)9*1f5207b7SJohn Levon static int foo(unsigned long long a)
10*1f5207b7SJohn Levon {
11*1f5207b7SJohn Levon 	switch (a) {
12*1f5207b7SJohn Levon 	case __builtin_bswap16(1   <<  8):
13*1f5207b7SJohn Levon 	case __builtin_bswap32(2L  << 24):
14*1f5207b7SJohn Levon 	case __builtin_bswap64(3LL << 56):
15*1f5207b7SJohn Levon 		return 0;
16*1f5207b7SJohn Levon 	default:
17*1f5207b7SJohn Levon 		return 1;
18*1f5207b7SJohn Levon 	}
19*1f5207b7SJohn Levon }
20*1f5207b7SJohn Levon 
21*1f5207b7SJohn Levon /*
22*1f5207b7SJohn Levon  * check-name: constness of pure/const builtins
23*1f5207b7SJohn Levon  */
24