xref: /aosp_15_r20/external/compiler-rt/test/msan/times.cc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
2*7c3d14c8STreehugger Robot 
3*7c3d14c8STreehugger Robot #include <assert.h>
4*7c3d14c8STreehugger Robot #include <stdlib.h>
5*7c3d14c8STreehugger Robot #include <stdio.h>
6*7c3d14c8STreehugger Robot #include <sys/times.h>
7*7c3d14c8STreehugger Robot 
8*7c3d14c8STreehugger Robot 
main(void)9*7c3d14c8STreehugger Robot int main(void) {
10*7c3d14c8STreehugger Robot   struct tms t;
11*7c3d14c8STreehugger Robot   clock_t res = times(&t);
12*7c3d14c8STreehugger Robot   assert(res != (clock_t)-1);
13*7c3d14c8STreehugger Robot 
14*7c3d14c8STreehugger Robot   if (t.tms_utime) printf("1\n");
15*7c3d14c8STreehugger Robot   if (t.tms_stime) printf("2\n");
16*7c3d14c8STreehugger Robot   if (t.tms_cutime) printf("3\n");
17*7c3d14c8STreehugger Robot   if (t.tms_cstime) printf("4\n");
18*7c3d14c8STreehugger Robot 
19*7c3d14c8STreehugger Robot   return 0;
20*7c3d14c8STreehugger Robot }
21