1 // RUN: %clangxx -O0 -g %s -o %t -lcrypt && %run %t
2 
3 // crypt() is missing from Android and -lcrypt from darwin.
4 // UNSUPPORTED: android, darwin
5 
6 #include <assert.h>
7 #include <unistd.h>
8 #include <cstring>
9 #if __has_include(<crypt.h>)
10 #include <crypt.h>
11 #endif
12 
13 int
14 main (int argc, char** argv)
15 {
16   {
17     char *p = crypt("abcdef", "xz");
18     volatile size_t z = strlen(p);
19   }
20   {
21     char *p = crypt("abcdef", "$1$");
22     volatile size_t z = strlen(p);
23   }
24   {
25     char *p = crypt("abcdef", "$5$");
26     volatile size_t z = strlen(p);
27   }
28   {
29     char *p = crypt("abcdef", "$6$");
30     volatile size_t z = strlen(p);
31   }
32 }
33