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