aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-c-test/debuginfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-c-test/debuginfo.c')
-rw-r--r--llvm/tools/llvm-c-test/debuginfo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-c-test/debuginfo.c b/llvm/tools/llvm-c-test/debuginfo.c
index 0f09c74..e376d82 100644
--- a/llvm/tools/llvm-c-test/debuginfo.c
+++ b/llvm/tools/llvm-c-test/debuginfo.c
@@ -325,6 +325,13 @@ int llvm_test_dibuilder(void) {
LLVMValueRef Phi2 = LLVMBuildPhi(Builder, I64, "p2");
LLVMAddIncoming(Phi2, &Zero, &FooEntryBlock, 1);
+ // Test that LLVMGetFirstDbgRecord and LLVMGetLastDbgRecord return NULL for
+ // instructions without debug info.
+ LLVMDbgRecordRef Phi1FirstDbgRecord = LLVMGetFirstDbgRecord(Phi1);
+ assert(Phi1FirstDbgRecord == NULL);
+ LLVMDbgRecordRef Phi1LastDbgRecord = LLVMGetLastDbgRecord(Phi1);
+ assert(Phi1LastDbgRecord == NULL);
+
// Insert a non-phi before the `ret` but not before the debug records to
// test that works as expected.
LLVMPositionBuilder(Builder, FooVarBlock, Ret);