aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/builtin-functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp')
-rw-r--r--clang/test/AST/ByteCode/builtin-functions.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp
index bd453d6..a67b6b6 100644
--- a/clang/test/AST/ByteCode/builtin-functions.cpp
+++ b/clang/test/AST/ByteCode/builtin-functions.cpp
@@ -1197,4 +1197,14 @@ namespace BuiltinMemcpy {
return b;
}
static_assert(simpleMove() == 12);
+
+ constexpr int memcpyTypeRem() { // ref-error {{never produces a constant expression}}
+ int a = 12;
+ int b = 0;
+ __builtin_memmove(&b, &a, 1); // both-note {{'memmove' not supported: size to copy (1) is not a multiple of size of element type 'int'}} \
+ // ref-note {{not supported}}
+ return b;
+ }
+ static_assert(memcpyTypeRem() == 12); // both-error {{not an integral constant expression}} \
+ // both-note {{in call to}}
}