summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2019-04-30 23:07:12 +0000
committerMitch Phillips <mitchphillips@outlook.com>2019-04-30 23:07:12 +0000
commit40f98d4b78daa37febe019aed72fdc54380752e9 (patch)
treeea33c2397de9111711000ad903f1430a9ac00fc4 /compiler-rt/lib/sanitizer_common/tests
parent84ea3f2a4867ffd9a3b3d0f9055efe6c242a1c5e (diff)
downloadbcm5719-llvm-40f98d4b78daa37febe019aed72fdc54380752e9.tar.gz
bcm5719-llvm-40f98d4b78daa37febe019aed72fdc54380752e9.zip
Added test.
llvm-svn: 359632
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/tests')
-rw-r--r--compiler-rt/lib/sanitizer_common/tests/sanitizer_flags_test.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_flags_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_flags_test.cc
index 5a948f39266..cfe90ef4585 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_flags_test.cc
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_flags_test.cc
@@ -16,6 +16,7 @@
#include "sanitizer_common/sanitizer_allocator_internal.h"
#include "gtest/gtest.h"
+#include <stdint.h>
#include <string.h>
namespace __sanitizer {
@@ -110,6 +111,21 @@ TEST(SanitizerCommon, IntFlags) {
"Invalid value for int option");
}
+TEST(SanitizerCommon, LongLongIntFlags) {
+ s64 InitValue = -5;
+ s64 IntMin = INT64_MIN;
+ s64 IntMax = INT64_MAX;
+ TestFlag(InitValue, "flag_name=0", 0ll);
+ TestFlag(InitValue, "flag_name=42", 42ll);
+ TestFlag(InitValue, "flag_name=-42", -42ll);
+
+ TestFlag(InitValue, "flag_name=-9223372036854775808", IntMin);
+ TestFlag(InitValue, "flag_name=9223372036854775807", IntMax);
+
+ TestFlag(InitValue, "flag_name=-92233720368547758080000", IntMin);
+ TestFlag(InitValue, "flag_name=92233720368547758070000", IntMax);
+}
+
TEST(SanitizerCommon, StrFlags) {
TestFlag("zzz", 0, "zzz");
TestFlag("zzz", "flag_name=", "");
OpenPOWER on IntegriCloud