diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-03-17 19:02:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-17 19:02:55 +0100 |
commit | cfa07ccdfcf03cbd48086fe9988f97e3a776b02c (patch) | |
tree | 3fee4ef7540836b3ea751f079b960070c8030044 /clang/test/AST/ByteCode/builtin-functions.cpp | |
parent | ca1bde0b91a6129e7bacee0fa67e4331b06dd683 (diff) | |
download | llvm-cfa07ccdfcf03cbd48086fe9988f97e3a776b02c.zip llvm-cfa07ccdfcf03cbd48086fe9988f97e3a776b02c.tar.gz llvm-cfa07ccdfcf03cbd48086fe9988f97e3a776b02c.tar.bz2 |
[clang][bytecode] Fix builtin_memchr with non-0 start index (#131633)
Diffstat (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp')
-rw-r--r-- | clang/test/AST/ByteCode/builtin-functions.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp index 2981255..11ff48b 100644 --- a/clang/test/AST/ByteCode/builtin-functions.cpp +++ b/clang/test/AST/ByteCode/builtin-functions.cpp @@ -1459,6 +1459,11 @@ namespace Memchr { constexpr bool b = !memchr("hello", 'h', 3); // both-error {{constant expression}} \ // both-note {{non-constexpr function 'memchr' cannot be used in a constant expression}} + constexpr bool f() { + const char *c = "abcdef"; + return __builtin_char_memchr(c + 1, 'f', 1) == nullptr; + } + static_assert(f()); } namespace Strchr { |