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 #include <crypt.h>
10 
11 int
12 main (int argc, char** argv)
13 {
14   {
15     char *p = crypt("abcdef", "xz");
16     volatile size_t z = strlen(p);
17   }
18   {
19     char *p = crypt("abcdef", "$1$");
20     volatile size_t z = strlen(p);
21   }
22   {
23     char *p = crypt("abcdef", "$5$");
24     volatile size_t z = strlen(p);
25   }
26   {
27     char *p = crypt("abcdef", "$6$");
28     volatile size_t z = strlen(p);
29   }
30 }
31