From 15db10e29d774624b1ff0d2da62570d7a3516cf6 Mon Sep 17 00:00:00 2001
From: "Ivan R. Ivanov" <ivanov.i.aa@m.titech.ac.jp>
Date: Thu, 22 Aug 2024 15:00:53 +0900
Subject: [PATCH 1/2] Enable printing of debug info

---
 tools/cgeist/driver.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/cgeist/driver.cc b/tools/cgeist/driver.cc
index b49eecdcfec5..5d63bae70bc8 100644
--- a/tools/cgeist/driver.cc
+++ b/tools/cgeist/driver.cc
@@ -612,7 +612,7 @@ int main(int argc, char **argv) {
 
   OpPrintingFlags flags;
   if (PrintDebugInfo)
-    flags.enableDebugInfo(/*pretty*/ false);
+    flags.enableDebugInfo(/*enable*/ true, /*pretty*/ false);
 
   if (ImmediateMLIR) {
     module->print(llvm::outs(), flags);

From e98297eeb3220eab5e41bad71679f17b31c60a7c Mon Sep 17 00:00:00 2001
From: "Ivan R. Ivanov" <ivanov.i.aa@m.titech.ac.jp>
Date: Wed, 2 Oct 2024 13:54:35 +0900
Subject: [PATCH 2/2] Add test

---
 tools/cgeist/Test/Verification/debug-info.c | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 tools/cgeist/Test/Verification/debug-info.c

diff --git a/tools/cgeist/Test/Verification/debug-info.c b/tools/cgeist/Test/Verification/debug-info.c
new file mode 100644
index 000000000000..c7a70d3f57e2
--- /dev/null
+++ b/tools/cgeist/Test/Verification/debug-info.c
@@ -0,0 +1,4 @@
+// RUN: cgeist %s %stdinclude --function=* --print-debug-info -S | FileCheck %s
+
+int main() { return 0; }
+//CHECK: loc