[llvm] [cross-project-tests] Fix struct-dse example so that it fails again (PR #73566)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 12:54:35 PST 2023


https://github.com/felipepiovezan created https://github.com/llvm/llvm-project/pull/73566

The purpose of this example is to provide a case where the debugger / debug info experience could be improved. A recent commit by clang (0d2860b795879f4dd152963b52f969b53b136899) changed codegen such that it changes how "small structs" are initialized, in a way that the debugger is now able to correctly display the variable being targeted by this test.

In order to keep the example relevant, i.e. failing, this commit makes it so that the struct is now "big enough" to not trigger the new codegen.

>From e9da1c16d6475dcfafc797b6dcfb02c23eed7961 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Mon, 27 Nov 2023 11:58:03 -0800
Subject: [PATCH] [cross-project-tests] Fix struct-dse example so that it fails
 again

The purpose of this example is to provide a case where the debugger / debug info
experience could be improved. A recent commit by clang
(0d2860b795879f4dd152963b52f969b53b136899) changed codegen such that it changes
how "small structs" are initialized, in a way that the debugger is now able to
correctly display the variable being targeted by this test.

In order to keep the example relevant, i.e. failing, this commit makes it so
that the struct is now "big enough" to not trigger the new codegen.
---
 .../debuginfo-tests/dexter-tests/memvars/struct-dse.c           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c
index 8a1b4cdf06c5f7b..9380bc5a0b0dc67 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c
@@ -10,7 +10,7 @@
 //// Check debug-info for the escaped struct variable num is reasonable.
 
 #include <stdio.h>
-struct Nums { int a, b, c; };
+struct Nums { int a, b, c, d, e, f, g, h, i, j; };
 struct Nums glob;
 __attribute__((__noinline__))
 void esc(struct Nums* nums) {



More information about the llvm-commits mailing list