xref: /aosp_15_r20/external/compiler-rt/test/msan/initgroups.cc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O0 %s -o %t && %run %t
2*7c3d14c8STreehugger Robot 
3*7c3d14c8STreehugger Robot #include <sys/types.h>
4*7c3d14c8STreehugger Robot #include <grp.h>
5*7c3d14c8STreehugger Robot #include <unistd.h>  // FreeBSD declares initgroups() here.
6*7c3d14c8STreehugger Robot 
main(void)7*7c3d14c8STreehugger Robot int main(void) {
8*7c3d14c8STreehugger Robot   initgroups("root", 0);
9*7c3d14c8STreehugger Robot   // The above fails unless you are root. Does not matter, MSan false positive
10*7c3d14c8STreehugger Robot   // (which we are testing for) happens anyway.
11*7c3d14c8STreehugger Robot   return 0;
12*7c3d14c8STreehugger Robot }
13