[compiler-rt] r359632 - Added test.

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 16:07:12 PDT 2019


Author: hctim
Date: Tue Apr 30 16:07:12 2019
New Revision: 359632

URL: http://llvm.org/viewvc/llvm-project?rev=359632&view=rev
Log:
Added test.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_flags_test.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_flags_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_flags_test.cc?rev=359632&r1=359631&r2=359632&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_flags_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_flags_test.cc Tue Apr 30 16:07:12 2019
@@ -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=", "");




More information about the llvm-commits mailing list