aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/compiler_ut.cpp
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/system/compiler_ut.cpp
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/system/compiler_ut.cpp')
-rw-r--r--util/system/compiler_ut.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/util/system/compiler_ut.cpp b/util/system/compiler_ut.cpp
index 5b500e9529..f93b1c0850 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
+ }
+}