blob: 708fb8e9822a3ed43bd192470c5da6f01c236c38 [file] [log] [blame]
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -03001define SOURCE_HELLO
2#include <stdio.h>
3int main(void)
4{
5 return puts(\"hi\");
6}
7endef
8
9ifndef NO_DWARF
10define SOURCE_DWARF
11#include <dwarf.h>
Robert Morella7112392010-11-16 14:16:33 -080012#include <elfutils/libdw.h>
13#include <elfutils/version.h>
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -030014#ifndef _ELFUTILS_PREREQ
15#error
16#endif
17
18int main(void)
19{
20 Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
21 return (long)dbg;
22}
23endef
24endif
25
26define SOURCE_LIBELF
27#include <libelf.h>
28
29int main(void)
30{
31 Elf *elf = elf_begin(0, ELF_C_READ, 0);
32 return (long)elf;
33}
34endef
35
36define SOURCE_GLIBC
37#include <gnu/libc-version.h>
38
39int main(void)
40{
41 const char *version = gnu_get_libc_version();
42 return (long)version;
43}
44endef
45
Irina Tirdead816ec22012-10-08 09:43:27 +030046define SOURCE_BIONIC
47#include <android/api-level.h>
48
49int main(void)
50{
51 return __ANDROID_API__;
52}
53endef
54
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -030055define SOURCE_ELF_MMAP
56#include <libelf.h>
57int main(void)
58{
59 Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
60 return (long)elf;
61}
62endef
63
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -030064ifndef NO_SLANG
65define SOURCE_SLANG
66#include <slang.h>
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -030067
68int main(void)
69{
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -030070 return SLsmg_init_smg();
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -030071}
72endef
73endif
74
Pekka Enbergc31a9452012-03-19 15:13:29 -030075ifndef NO_GTK2
76define SOURCE_GTK2
77#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
78#include <gtk/gtk.h>
79#pragma GCC diagnostic error \"-Wstrict-prototypes\"
80
81int main(int argc, char *argv[])
82{
83 gtk_init(&argc, &argv);
84
85 return 0;
86}
87endef
Namhyung Kima6b702c2012-05-29 13:23:01 +090088
89define SOURCE_GTK2_INFOBAR
90#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
91#include <gtk/gtk.h>
92#pragma GCC diagnostic error \"-Wstrict-prototypes\"
93
94int main(void)
95{
96 gtk_info_bar_new();
97
98 return 0;
99}
100endef
Pekka Enbergc31a9452012-03-19 15:13:29 -0300101endif
102
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -0300103ifndef NO_LIBPERL
104define SOURCE_PERL_EMBED
105#include <EXTERN.h>
106#include <perl.h>
107
108int main(void)
109{
110perl_alloc();
111return 0;
112}
113endef
114endif
115
116ifndef NO_LIBPYTHON
Michael Wittenced465c2011-04-02 21:46:09 +0000117define SOURCE_PYTHON_VERSION
118#include <Python.h>
119#if PY_VERSION_HEX >= 0x03000000
120 #error
121#endif
Arnaldo Carvalho de Melofeb8ada2012-10-09 15:15:25 -0300122int main(void)
123{
124 return 0;
125}
Michael Wittenced465c2011-04-02 21:46:09 +0000126endef
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -0300127define SOURCE_PYTHON_EMBED
128#include <Python.h>
Arnaldo Carvalho de Melof9af3a42010-06-09 16:57:39 -0300129int main(void)
130{
131 Py_Initialize();
132 return 0;
133}
134endef
135endif
136
137define SOURCE_BFD
138#include <bfd.h>
139
140int main(void)
141{
142 bfd_demangle(0, 0, 0);
143 return 0;
144}
145endef
146
147define SOURCE_CPLUS_DEMANGLE
148extern char *cplus_demangle(const char *, int);
149
150int main(void)
151{
152 cplus_demangle(0, 0);
153 return 0;
154}
155endef
156
Kirill A. Shutemovf4e7ac02010-08-21 03:38:20 +0300157define SOURCE_STRLCPY
158#include <stdlib.h>
159extern size_t strlcpy(char *dest, const char *src, size_t size);
160
161int main(void)
162{
163 strlcpy(NULL, NULL, 0);
164 return 0;
165}
166endef
Jiri Olsa6a40cd92012-08-07 15:20:44 +0200167
168ifndef NO_LIBUNWIND
169define SOURCE_LIBUNWIND
170#include <libunwind.h>
171#include <stdlib.h>
172
173extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
174 unw_word_t ip,
175 unw_dyn_info_t *di,
176 unw_proc_info_t *pi,
177 int need_unwind_info, void *arg);
178
179
180#define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)
181
182int main(void)
183{
184 unw_addr_space_t addr_space;
185 addr_space = unw_create_addr_space(NULL, 0);
186 unw_init_remote(NULL, addr_space, NULL);
187 dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL);
188 return 0;
189}
190endef
191endif
Irina Tirdeac9f08be2012-09-08 03:43:23 +0300192
193ifndef NO_BACKTRACE
194define SOURCE_BACKTRACE
195#include <execinfo.h>
196#include <stdio.h>
197
198int main(void)
199{
200 backtrace(NULL, 0);
201 backtrace_symbols(NULL, 0);
202 return 0;
203}
204endef
205endif
Namhyung Kim4d290892012-09-27 20:23:38 +0900206
207ifndef NO_LIBAUDIT
208define SOURCE_LIBAUDIT
209#include <libaudit.h>
210
211int main(void)
212{
213 return audit_open();
214}
215endef
Bernhard Rosenkraenzer78da39f2012-10-08 09:43:26 +0300216endif
217
218define SOURCE_ON_EXIT
219#include <stdio.h>
220
221int main(void)
222{
223 return on_exit(NULL, NULL);
224}
225endef
Peter Hurley79d824e2013-01-27 20:51:22 -0500226
227define SOURCE_LIBNUMA
228#include <numa.h>
229#include <numaif.h>
230
231int main(void)
232{
233 numa_available();
234 return 0;
235}
Arnaldo Carvalho de Melo6692c262013-03-28 11:34:10 -0300236endef