• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download

test_const(volatile int x)1 static void test_const(volatile int x)
2 {
3 	const int x = 0;
4 	typeof(1?x:x)		i3; i3 = 0;	// should be OK
5 	typeof(+x)		i4; i4 = 0;	// should be OK
6 	typeof(-x)		i5; i5 = 0;	// should be OK
7 	typeof(!x)		i6; i6 = 0;	// should be OK
8 	typeof(x+x)		i7; i7 = 0;	// should be OK
9 }
10 
test_volatile(void)11 static void test_volatile(void)
12 {
13 	volatile int x = 0;
14 	int *pp;
15 
16 	typeof(1?x:x)		i3; pp = &i3;	// should be OK
17 	typeof(+x)		i4; pp = &i4;	// should be OK
18 	typeof(-x)		i5; pp = &i5;	// should be OK
19 	typeof(!x)		i6; pp = &i6;	// should be OK
20 	typeof(x+x)		i7; pp = &i7;	// should be OK
21 }
22 
23 /*
24  * check-name: unqual02
25  * check-command: sparse -Wno-declaration-after-statement $file
26  */
27