xref: /illumos-gate/usr/src/tools/smatch/src/validation/mem2reg/alias-mixed.c (revision 8c0b080c8ed055a259d8cd26b9f005211c6a9753)
1 extern int g;
2 
3 
4 static int foo(int *p)
5 {
6 	*p = 1;
7 	g = 2;
8 	return *p == 1;
9 }
10 
11 static int bar(int *p)
12 {
13 	g = 1;
14 	*p = 2;
15 	return g == 1;
16 }
17 
18 static void test(void)
19 {
20 	foo(&g);
21 	bar(&g);
22 }
23 
24 /*
25  * check-name: alias symbol/pointer
26  * check-command: test-linearize $file
27  * check-output-ignore
28  *
29  * check-output-excludes: ret\\..* *\\$1
30  */
31