summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/pr104560-2.c
blob: f968a582caa16ca1ed9674918f26a67e47054a59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
struct ibv_device {
  /* [...snip...] */
  int placeholder;
};

struct verbs_device {
  struct ibv_device device; /* Must be first */
  /* [...snip...] */
  int placeholder;
};

struct mlx5_device {
  struct verbs_device verbs_dev;
  int placeholder;
};

static inline struct mlx5_device *to_mdev(struct ibv_device *ibdev)
{
  return (struct mlx5_device *)ibdev;
}
  
static void mlx5_uninit_device(struct verbs_device *verbs_device)
{
  struct mlx5_device *dev = to_mdev(&verbs_device->device);
  __builtin_free(dev); /* { dg-bogus "not on the heap" } */
}