aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/builtin-functions.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-07-06 16:42:06 +0200
committerGitHub <noreply@github.com>2025-07-06 16:42:06 +0200
commitec9eefcef560e4ea5b5d8ee6ed9cc6ef8c1f274c (patch)
tree8b2f61b6a1ae6efaaccc92c020f52961d9883b03 /clang/test/AST/ByteCode/builtin-functions.cpp
parentdb4e927f9f02b40a0bc332205b88bc40edc29afc (diff)
downloadllvm-ec9eefcef560e4ea5b5d8ee6ed9cc6ef8c1f274c.zip
llvm-ec9eefcef560e4ea5b5d8ee6ed9cc6ef8c1f274c.tar.gz
llvm-ec9eefcef560e4ea5b5d8ee6ed9cc6ef8c1f274c.tar.bz2
[clang][bytecode] Fix a crash in overflow builtins (#147189)
Only initialize pointers that can be initialized.
Diffstat (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp')
-rw-r--r--clang/test/AST/ByteCode/builtin-functions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp
index 3b95a8e..1bb6d22 100644
--- a/clang/test/AST/ByteCode/builtin-functions.cpp
+++ b/clang/test/AST/ByteCode/builtin-functions.cpp
@@ -1753,4 +1753,12 @@ namespace I128Mul {
}
#endif
+namespace InitParam {
+ constexpr int foo(int a) {
+ __builtin_mul_overflow(20, 10, &a);
+ return a;
+ }
+ static_assert(foo(10) == 200);
+}
+
#endif