Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into fix/execute_benched
[simgrid.git] / tools / cmake / test_prog / prog_asan.cpp
1 /* Copyright (c) 2017. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 /* Check availability of AddressSanitizer */
8
9 #if defined(__has_feature)
10 #define HAS_FEATURE(x) __has_feature(x)
11 #else
12 #define HAS_FEATURE(x) 0
13 #endif
14
15 #if not HAS_FEATURE(address_sanitizer) && not defined(__SANITIZE_ADDRESS__)
16 #error "ASan feature not found."
17 #endif
18
19 #include <sanitizer/asan_interface.h>
20
21 #if defined(CHECK_FIBER_SUPPORT)
22 // Verify the existence of the fiber annotation interface, with the expected signature
23 void (*start_fiber)(void**, const void*, size_t)   = __sanitizer_start_switch_fiber;
24 void (*finish_fiber)(void*, const void**, size_t*) = __sanitizer_finish_switch_fiber;
25 #endif
26
27 int main(void)
28 {
29 }