1/*
2 * Copyright 2014, NICTA
3 *
4 * This software may be distributed and modified according to the terms of
5 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
6 * See "LICENSE_BSD2.txt" for details.
7 *
8 * @TAG(NICTA_BSD)
9 */
10
11#define MAX_SIZE 1024
12
13int globint1, globint2, globintarray[3];
14
15struct s {
16  int sz;
17  char data[MAX_SIZE];
18};
19
20struct s_dataptr {
21  int sz;
22  char *dataptr;
23};
24
25int f(struct s* ptr)
26{
27  return ptr ? 0 : ptr->sz;
28}
29
30struct t {
31  int x, y;
32};
33
34struct u {
35  struct t array[10];
36};
37
38struct k {
39  unsigned short b;
40  char c[1];
41};
42
43int g(struct u* uptr, int n, struct k *kptr)
44{
45  return uptr->array[n].x + (kptr ? kptr->b : 0);
46}
47
48struct u globu;
49struct k globk1, globk2, globkarray[10];
50
51int h(int *i)
52{
53  globk2.b++;
54  return *i + g(&globu, *i * 2, &globk1);
55}
56
57int h1(void)
58{
59  return g(&globu, 2, globkarray + 6);
60}
61
62int j(void)
63{
64  int i = h(&globint1), j = h(globintarray + 2);
65  return i + j;
66}
67
68int ts20110511_1(struct s *sptr, int i, int shift)
69{
70  return ((sptr->data[i]) >> shift);
71}
72
73int ts20110511_2(struct s *sptr, int shift)
74{
75  return ((sptr->sz) >> shift);
76}
77
78