gcc/testsuite/c-c++-common/asan/pr59063-2.c
raw| 1 | /* { dg-do run { target { *-*-linux* *-*-freebsd* } } } */ |
| 2 | /* { dg-options "-static-libasan" } */ |
| 3 | |
| 4 | #include <time.h> |
| 5 | static int weak_gettime (clockid_t clk_id, struct timespec *tp) |
| 6 | __attribute__((__weakref__("clock_gettime"))); |
| 7 | int main() { |
| 8 | if (!clock_gettime) |
| 9 | return 0; |
| 10 | struct timespec ts; |
| 11 | return weak_gettime(CLOCK_MONOTONIC, &ts); |
| 12 | } |