Debian Codegraph @

clang/test/AST/ByteCode/builtins.c

raw
1 // RUN: %clang_cc1 -fexperimental-new-constant-interpreter %s -verify
2 // RUN: %clang_cc1 %s -verify=ref
3
4 // expected-no-diagnostics
5 // ref-no-diagnostics
6
7 extern __SIZE_TYPE__ strlen(const char *);
8
9 struct str_t {
10 char s1[sizeof("a")];
11 };
12 static const struct str_t str1 = {"a"};
13 #define str ((const char *)&str1)
14 int structStrlen(void) {
15 if (strlen(str) == 1)
16 return 0;
17 return 1;
18 }
19
20 void f() { __builtin_memcpy(f, f, 1); }
21 void f2() { __builtin_memchr(f2, 0, 1); }