]> AND Public Git Repository - simgrid.git/blobdiff - src/include/xbt/coverage.h
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finalize passing transitions during model checking
[simgrid.git] / src / include / xbt / coverage.h
index 30c209ef6b4a69c2ef9d39f2c4f087fb55230e16..750ad7d31ff7462f198885d18bdb048076ac0a10 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019-2020. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2019-2023. The SimGrid Team. All rights reserved.               */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 SG_BEGIN_DECL
 
 #ifdef COVERAGE
+
+#if defined(__GNUC__) && __GNUC__ >= 11
+#include "gcov.h"
+#define coverage_checkpoint()                                                                                          \
+  do {                                                                                                                 \
+    __gcov_dump();                                                                                                     \
+    __gcov_reset();                                                                                                    \
+  } while (0)
+#else
 extern void __gcov_flush();
 #define coverage_checkpoint() __gcov_flush()
+#endif
+
 #else
 #define coverage_checkpoint() (void)0
 #endif