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