summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/pr104560-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/analyzer/pr104560-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr104560-2.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr104560-2.c b/gcc/testsuite/gcc.dg/analyzer/pr104560-2.c
new file mode 100644
index 00000000000..f968a582caa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr104560-2.c
@@ -0,0 +1,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" } */
+}