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