1*c85f09ccSJohn Levon # define __force	__attribute__((force))
2*c85f09ccSJohn Levon 
3*c85f09ccSJohn Levon struct s {
4*c85f09ccSJohn Levon 	int a;
5*c85f09ccSJohn Levon };
6*c85f09ccSJohn Levon 
foo(struct s * s)7*c85f09ccSJohn Levon static int foo(struct s *s)
8*c85f09ccSJohn Levon {
9*c85f09ccSJohn Levon 	return (*((typeof(s->a) __force *) &s->a)) & 1;
10*c85f09ccSJohn Levon }
11*c85f09ccSJohn Levon 
bar(struct s * d,struct s * s1,struct s * s2)12*c85f09ccSJohn Levon static void bar(struct s *d, struct s *s1, struct s *s2)
13*c85f09ccSJohn Levon {
14*c85f09ccSJohn Levon 	*d = *s1, *d = *s2;
15*c85f09ccSJohn Levon }
16*c85f09ccSJohn Levon 
17*c85f09ccSJohn Levon /*
18*c85f09ccSJohn Levon  * check-name: unexamined base type
19*c85f09ccSJohn Levon  * check-command: test-linearize -Wno-decl $file
20*c85f09ccSJohn Levon  * check-description:
21*c85f09ccSJohn Levon  *	Test case for missing examine in evaluate_dereference()'s
22*c85f09ccSJohn Levon  *	target base type. In this case, the loaded value has a
23*c85f09ccSJohn Levon  *	a null size, giving the wrongly generated code for foo():
24*c85f09ccSJohn Levon  *		ptrcast.64  %r3 <- (64) %arg1
25*c85f09ccSJohn Levon  *		load        %r4 <- 0[%r3]
26*c85f09ccSJohn Levon  *		    ^^^				!! WRONG !!
27*c85f09ccSJohn Levon  *		cast.32     %r5 <- (0) %r4
28*c85f09ccSJohn Levon  *		                   ^^^		!! WRONG !!
29*c85f09ccSJohn Levon  *		and.32      %r6 <- %r5, $1
30*c85f09ccSJohn Levon  *		ret.32      %r6
31*c85f09ccSJohn Levon  *
32*c85f09ccSJohn Levon  * check-output-ignore
33*c85f09ccSJohn Levon  * check-output-excludes: load[^.]
34*c85f09ccSJohn Levon  * check-output-excludes: cast\\..*(0)
35*c85f09ccSJohn Levon  * check-output-excludes: store[^.]
36*c85f09ccSJohn Levon  */
37