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-test.h"
15 #include "llvm-c/DebugInfo.h"
19 int llvm_test_dibuilder() {
20 LLVMModuleRef M = LLVMModuleCreateWithName("debuginfo.c");
21 LLVMDIBuilderRef DIB = LLVMCreateDIBuilder(M);
23 LLVMMetadataRef File = LLVMDIBuilderCreateFile(DIB, "debuginfo.c", 12,
26 LLVMDIBuilderCreateCompileUnit(DIB,
27 LLVMDWARFSourceLanguageC, File,"llvm-c-test", 11, 0, NULL, 0, 0,
28 NULL, 0, LLVMDWARFEmissionFull, 0, 0, 0);
30 char *MStr = LLVMPrintModuleToString(M);
32 LLVMDisposeMessage(MStr);
34 LLVMDisposeDIBuilder(DIB);