[PATCH] D106817: [PowerPC] Changed sema checking range for tdw td builtin
Albion Fung via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 26 16:45:00 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG18526b0d661f: [PowerPC] Changed sema checking range for tdw td builtin (authored by Conanap).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106817/new/
https://reviews.llvm.org/D106817
Files:
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-ppc-xlcompat-error.c
Index: clang/test/CodeGen/builtins-ppc-xlcompat-error.c
===================================================================
--- clang/test/CodeGen/builtins-ppc-xlcompat-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-error.c
@@ -17,9 +17,11 @@
void test_trap(void) {
#ifdef __PPC64__
- __tdw(lla, llb, 50); //expected-error {{argument value 50 is outside the valid range [0, 31]}}
+ __tdw(lla, llb, 50); //expected-error {{argument value 50 is outside the valid range [1, 31]}}
+ __tdw(lla, llb, 0); //expected-error {{argument value 0 is outside the valid range [1, 31]}}
#endif
- __tw(ia, ib, 50); //expected-error {{argument value 50 is outside the valid range [0, 31]}}
+ __tw(ia, ib, 50); //expected-error {{argument value 50 is outside the valid range [1, 31]}}
+ __tw(ia, ib, 0); //expected-error {{argument value 0 is outside the valid range [1, 31]}}
}
void test_builtin_ppc_rldimi() {
Index: clang/lib/Sema/SemaChecking.cpp
===================================================================
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3395,7 +3395,7 @@
return SemaBuiltinConstantArgRange(TheCall, 3, 0, 7);
case PPC::BI__builtin_ppc_tw:
case PPC::BI__builtin_ppc_tdw:
- return SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+ return SemaBuiltinConstantArgRange(TheCall, 2, 1, 31);
case PPC::BI__builtin_ppc_cmpeqb:
case PPC::BI__builtin_ppc_setb:
case PPC::BI__builtin_ppc_maddhd:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106817.361853.patch
Type: text/x-patch
Size: 1472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210726/98b78512/attachment.bin>
More information about the cfe-commits
mailing list