diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /util/system/compiler_ut.cpp | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'util/system/compiler_ut.cpp')
-rw-r--r-- | util/system/compiler_ut.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/util/system/compiler_ut.cpp b/util/system/compiler_ut.cpp index f93b1c0850..5b500e9529 100644 --- a/util/system/compiler_ut.cpp +++ b/util/system/compiler_ut.cpp @@ -1,24 +1,24 @@ -#include "compiler.h" - +#include "compiler.h" + #include <library/cpp/testing/unittest/registar.h> - + Y_UNIT_TEST_SUITE(TCompilerTest) { Y_UNIT_TEST(TestPragmaNoWshadow) { - Y_PRAGMA_DIAGNOSTIC_PUSH - Y_PRAGMA_NO_WSHADOW - - // define two variables with similar names, latest must shadow first - // and there will be no warning for this - - for (int i = 0; i < 1; ++i) { - for (int i = 100500; i < 100501; ++i) { - UNIT_ASSERT_EQUAL(i, 100500); - } - } - - Y_PRAGMA_DIAGNOSTIC_POP - } - + Y_PRAGMA_DIAGNOSTIC_PUSH + Y_PRAGMA_NO_WSHADOW + + // define two variables with similar names, latest must shadow first + // and there will be no warning for this + + for (int i = 0; i < 1; ++i) { + for (int i = 100500; i < 100501; ++i) { + UNIT_ASSERT_EQUAL(i, 100500); + } + } + + Y_PRAGMA_DIAGNOSTIC_POP + } + Y_PRAGMA_DIAGNOSTIC_PUSH Y_PRAGMA_NO_UNUSED_PARAMETER @@ -35,38 +35,38 @@ Y_UNIT_TEST_SUITE(TCompilerTest) { } Y_UNIT_TEST(TestHaveInt128) { -#ifdef Y_HAVE_INT128 - // will be compiled without errors - unsigned __int128 a = 1; - __int128 b = 1; - UNIT_ASSERT_EQUAL(a, 1); - UNIT_ASSERT_EQUAL(b, 1); - UNIT_ASSERT_EQUAL(sizeof(a), sizeof(b)); - - // and we can set a type alias for __int128 and unsigned __int128 without compiler errors - using TMyInt128 = __int128; - using TMyUnsignedInt128 = unsigned __int128; - - TMyInt128 i128value; - TMyUnsignedInt128 ui128value; - Y_UNUSED(i128value); - Y_UNUSED(ui128value); - -#endif - } - - // define deprecated function +#ifdef Y_HAVE_INT128 + // will be compiled without errors + unsigned __int128 a = 1; + __int128 b = 1; + UNIT_ASSERT_EQUAL(a, 1); + UNIT_ASSERT_EQUAL(b, 1); + UNIT_ASSERT_EQUAL(sizeof(a), sizeof(b)); + + // and we can set a type alias for __int128 and unsigned __int128 without compiler errors + using TMyInt128 = __int128; + using TMyUnsignedInt128 = unsigned __int128; + + TMyInt128 i128value; + TMyUnsignedInt128 ui128value; + Y_UNUSED(i128value); + Y_UNUSED(ui128value); + +#endif + } + + // define deprecated function [[deprecated]] void Bar() { - return; - } - - Y_UNIT_TEST(TestNoDeprecated) { - Y_PRAGMA_DIAGNOSTIC_PUSH - Y_PRAGMA_NO_DEPRECATED - - // will be compiled without errors + return; + } + + Y_UNIT_TEST(TestNoDeprecated) { + Y_PRAGMA_DIAGNOSTIC_PUSH + Y_PRAGMA_NO_DEPRECATED + + // will be compiled without errors Bar(); - - Y_PRAGMA_DIAGNOSTIC_POP - } -} + + Y_PRAGMA_DIAGNOSTIC_POP + } +} |