xref: /aosp_15_r20/external/compiler-rt/test/msan/ftime.cc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
2*7c3d14c8STreehugger Robot 
3*7c3d14c8STreehugger Robot // ftime() is deprecated on FreeBSD.
4*7c3d14c8STreehugger Robot // XFAIL: freebsd
5*7c3d14c8STreehugger Robot 
6*7c3d14c8STreehugger Robot #include <assert.h>
7*7c3d14c8STreehugger Robot #include <sys/timeb.h>
8*7c3d14c8STreehugger Robot 
9*7c3d14c8STreehugger Robot #include <sanitizer/msan_interface.h>
10*7c3d14c8STreehugger Robot 
main(void)11*7c3d14c8STreehugger Robot int main(void) {
12*7c3d14c8STreehugger Robot   struct timeb tb;
13*7c3d14c8STreehugger Robot   int res = ftime(&tb);
14*7c3d14c8STreehugger Robot   assert(!res);
15*7c3d14c8STreehugger Robot   assert(__msan_test_shadow(&tb, sizeof(tb)) == -1);
16*7c3d14c8STreehugger Robot   return 0;
17*7c3d14c8STreehugger Robot }
18