summaryrefslogtreecommitdiff
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
commit28e85e1f226db1ccd0b6f20678eca874890afd2a (patch)
tree64b92c9a553160bc65c59ec6a61d28f7f6c4ecbd
parentfea2ce9367928a8f9b32f02fa4774f0b0c0af81f (diff)
downloadcompiler-rt-28e85e1f226db1ccd0b6f20678eca874890afd2a.tar.gz
Added test.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359632 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/sanitizer_common/tests/sanitizer_flags_test.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_flags_test.cc b/lib/sanitizer_common/tests/sanitizer_flags_test.cc
index 5a948f392..cfe90ef45 100644
--- a/lib/sanitizer_common/tests/sanitizer_flags_test.cc
+++ b/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=", "");