aboutsummaryrefslogtreecommitdiff
path: root/src/test/compilerbug_tests.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-07-04 08:40:12 +0800
committerfanquake <fanquake@gmail.com>2019-07-04 10:18:47 +0800
commit629c7b029cf934932be3699da592cfbe6e146f8a (patch)
treee371534349ca64f0791a8854232136980674bb16 /src/test/compilerbug_tests.cpp
parent9c29bc71dc40de4e6ff94c272d63449a7a87ba0a (diff)
parentbcb27d7b03d1e7a4404c04859f8146d8bc7c360a (diff)
downloadbitcoin-629c7b029cf934932be3699da592cfbe6e146f8a.tar.xz
Merge #16035: 0.18.1: Backports
bcb27d7b0 .python-version: Bump to 3.5.6 (MarcoFalke) af25a757e Add comments to Python ECDSA implementation (John Newbery) 715da91e9 Set AA_EnableHighDpiScaling attribute early (Hennadii Stepanov) 2800b3d5c gui: Fix open wallet menu initialization order (João Barbosa) e78007fc1 Make and get the multisig redeemscript and destination in one function instead of two (Andrew Chow) d9fc969e7 Pure python EC (Pieter Wuille) 23ba460c1 test: Add test that addmultisigaddress fails for watchonly addresses (MarcoFalke) 13b3bb564 test: Fixup creatmultisig documentation and whitespace (MarcoFalke) 79745d175 Replace remaining fprintf with tfm::format manually (MarcoFalke) beb09f09b scripted-diff: Replace fprintf with tfm::format (MarcoFalke) e29aa6e72 Exceptions should be caught by reference, not by value. (Kristaps Kaupe) f88959ba7 tinyformat: Add doc to Bitcoin Core specific strprintf (MarcoFalke) 0023c9789 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke) 832eb4ff5 Bugfix: test/functional/rpc_psbt: Correct test description comment (Luke Dashjr) 966d8d084 Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions (Luke Dashjr) bb36ac82e rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke) d24d0ec05 Add example 2nd arg to signrawtransactionwithkey (Chris Moore) 592016ba1 fixup: Fix prunning test (João Barbosa) c80a498ae Fix RPC/pruneblockchain returned prune height (Jonas Schnelli) b2398240f gui: Enable open wallet menu on setWalletController (João Barbosa) d1f261150 Add test for GCC bug 90348 (Pieter Wuille) d80c558e0 gui: Set progressDialog to nullptr (João Barbosa) 7ed1a6019 gui: Enable console line edit on setClientModel (João Barbosa) b55cbe82d qt: fix opening bitcoin.conf via Preferences on macOS; see #15409 (shannon1916) b6c1f9478 Disallow extended encoding for non-witness transactions (take 3) (MarcoFalke) 86031083c Add test for superfluous witness record in deserialization (Gregory Sanders) 5a58ddb6d Fix missing input template by making minimal tx (Gregory Sanders) 206f5ee87 Disallow extended encoding for non-witness transactions (Pieter Wuille) 3dbc7def0 Show loaded wallets as disabled in open menu instead of nothing (MeshCollider) a635377b6 Install bitcoin-wallet manpage. (Daniel Kraft) eb85ee62b Doc: remove text about txes always relayed from -whitelist (David A. Harding) 890a92eba doc: Mention blocksonly in reduce-traffic.md, unhide option (MarcoFalke) 3460555f4 test: Add test for p2p_blocksonly (MarcoFalke) 8f215c7a2 test: Format predicate source as multiline on error (MarcoFalke) 9c1a607a0 net: Rename ::fRelayTxes to ::g_relay_txes (MarcoFalke) 5935f0126 build with -fstack-reuse=none (MarcoFalke) Pull request description: Tree-SHA512: 5cd73a4319cb69c92b528239cf97c0ed5fcf2b9e8c7fe154e4679eeec95db433a0223d8dc574e4cdc96c1913cfdf160b10c42dcdbcb5bbc8fb743c07930ef9da
Diffstat (limited to 'src/test/compilerbug_tests.cpp')
-rw-r--r--src/test/compilerbug_tests.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test/compilerbug_tests.cpp b/src/test/compilerbug_tests.cpp
new file mode 100644
index 0000000000..701671314f
--- /dev/null
+++ b/src/test/compilerbug_tests.cpp
@@ -0,0 +1,43 @@
+// Copyright (c) 2019 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#include <test/test_bitcoin.h>
+#include <boost/test/unit_test.hpp>
+
+BOOST_FIXTURE_TEST_SUITE(compilerbug_tests, BasicTestingSetup)
+
+#if defined(__GNUC__)
+// This block will also be built under clang, which is fine (as it supports noinline)
+void __attribute__ ((noinline)) set_one(unsigned char* ptr)
+{
+ *ptr = 1;
+}
+
+int __attribute__ ((noinline)) check_zero(unsigned char const* in, unsigned int len)
+{
+ for (unsigned int i = 0; i < len; ++i) {
+ if (in[i] != 0) return 0;
+ }
+ return 1;
+}
+
+void set_one_on_stack() {
+ unsigned char buf[1];
+ set_one(buf);
+}
+
+BOOST_AUTO_TEST_CASE(gccbug_90348) {
+ // Test for GCC bug 90348. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348
+ for (int i = 0; i <= 4; ++i) {
+ unsigned char in[4];
+ for (int j = 0; j < i; ++j) {
+ in[j] = 0;
+ set_one_on_stack(); // Apparently modifies in[0]
+ }
+ BOOST_CHECK(check_zero(in, i));
+ }
+}
+#endif
+
+BOOST_AUTO_TEST_SUITE_END()