1// RUN: %clang %s -o %t && %run %t 2>&1
2
3#include <assert.h>
4#include <string.h>
5int main(int argc, char **argv) {
6 const char *s = "mytest";
7 assert(strnlen(s, 0) == 0UL);
8 assert(strnlen(s, 1) == 1UL);
9 assert(strnlen(s, 6) == strlen(s));
10 assert(strnlen(s, 7) == strlen(s));
11 return 0;
12}
13

source code of compiler-rt/test/sanitizer_common/TestCases/strnlen.c