[X86] Cleanup ADCX/ADOX instruction definitions.
[lldb.git] / llvm / tools / llvm-c-test / debuginfo.c
1 /*===-- debuginfo.c - tool for testing libLLVM and llvm-c API -------------===*\
2 |*                                                                            *|
3 |*                     The LLVM Compiler Infrastructure                       *|
4 |*                                                                            *|
5 |* This file is distributed under the University of Illinois Open Source      *|
6 |* License. See LICENSE.TXT for details.                                      *|
7 |*                                                                            *|
8 |*===----------------------------------------------------------------------===*|
9 |*                                                                            *|
10 |* Tests for the LLVM C DebugInfo API                                         *|
11 |*                                                                            *|
12 \*===----------------------------------------------------------------------===*/
13
14 #include "llvm-c/DebugInfo.h"
15 #include <stdio.h>
16
17 int llvm_test_dibuilder(void) {
18   LLVMModuleRef M = LLVMModuleCreateWithName("debuginfo.c");
19   LLVMDIBuilderRef DIB = LLVMCreateDIBuilder(M);
20
21   LLVMMetadataRef File = LLVMDIBuilderCreateFile(DIB, "debuginfo.c", 12,
22                                                  ".", 1);
23
24   LLVMDIBuilderCreateCompileUnit(DIB,
25       LLVMDWARFSourceLanguageC, File,"llvm-c-test", 11, 0, NULL, 0, 0,
26       NULL, 0, LLVMDWARFEmissionFull, 0, 0, 0);
27
28   char *MStr = LLVMPrintModuleToString(M);
29   puts(MStr);
30   LLVMDisposeMessage(MStr);
31
32   LLVMDisposeDIBuilder(DIB);
33   LLVMDisposeModule(M);
34
35   return 0;
36 }