1 /*===-- debuginfo.c - tool for testing libLLVM and llvm-c API -------------===*\
3 |* The LLVM Compiler Infrastructure *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
8 |*===----------------------------------------------------------------------===*|
10 |* Tests for the LLVM C DebugInfo API *|
12 \*===----------------------------------------------------------------------===*/
14 #include "llvm-c/DebugInfo.h"
17 int llvm_test_dibuilder(void) {
18 LLVMModuleRef M = LLVMModuleCreateWithName("debuginfo.c");
19 LLVMDIBuilderRef DIB = LLVMCreateDIBuilder(M);
21 LLVMMetadataRef File = LLVMDIBuilderCreateFile(DIB, "debuginfo.c", 12,
24 LLVMDIBuilderCreateCompileUnit(DIB,
25 LLVMDWARFSourceLanguageC, File,"llvm-c-test", 11, 0, NULL, 0, 0,
26 NULL, 0, LLVMDWARFEmissionFull, 0, 0, 0);
28 char *MStr = LLVMPrintModuleToString(M);
30 LLVMDisposeMessage(MStr);
32 LLVMDisposeDIBuilder(DIB);