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
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);