Home
last modified time | relevance | path

Searched +full:signed +full:- +full:integer +full:- +full:overflow (Results 1 – 25 of 1036) sorted by relevance

12345678910>>...42

/external/compiler-rt/test/ubsan/TestCases/Integer/
Dincdec-overflow.cpp1 // RUN: %clangxx -DOP=n++ -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck…
2 // RUN: %clangxx -DOP=++n -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck…
3 // RUN: %clangxx -DOP=m-- -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck…
4 // RUN: %clangxx -DOP=--m -fsanitize=signed-integer-overflow %s -o %t4 && %run %t4 2>&1 | FileCheck…
12 int m = -n - 1; in main()
14 …// PLUS: incdec-overflow.cpp:[[@LINE-1]]:3: runtime error: signed integer overflow: 2147483647 + 1… in main()
15 …// MINUS: incdec-overflow.cpp:[[@LINE-2]]:3: runtime error: signed integer overflow: -2147483648 - in main()
Dsub-overflow.cpp1 // RUN: %clangxx -DSUB_I32 -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileChec…
2 // RUN: %clangxx -DSUB_I64 -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileChec…
3 // RUN: %clangxx -DSUB_I128 -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileChe…
10 (void)(int8_t(-2) - int8_t(0x7f)); in main()
11 (void)(int16_t(-2) - int16_t(0x7fff)); in main()
14 (void)(int32_t(-2) - int32_t(0x7fffffff)); in main()
15 …// CHECK-SUB_I32: sub-overflow.cpp:[[@LINE-1]]:22: runtime error: signed integer overflow: -2 - 21… in main()
19 (void)(int64_t(-8000000000000000000ll) - int64_t(2000000000000000000ll)); in main()
20 …// CHECK-SUB_I64: -8000000000000000000 - 2000000000000000000 cannot be represented in type '{{long… in main()
25 (void)(-(__int128_t(1) << 126) - (__int128_t(1) << 126) - 1); in main()
[all …]
Dadd-overflow.cpp1 // RUN: %clangxx -DADD_I32 -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileChec…
2 // RUN: %clangxx -DADD_I64 -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileChec…
3 // RUN: %clangxx -DADD_I128 -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileChe…
16 …// CHECK-ADD_I32: add-overflow.cpp:[[@LINE-1]]:5: runtime error: signed integer overflow: 30541989… in main()
21 …// CHECK-ADD_I64: 8000000000000000000 + 2000000000000000000 cannot be represented in type '{{long(… in main()
30 …// CHECK-ADD_I128: {{0x40000000000000000000000000000000 \+ 0x40000000000000000000000000000000 cann… in main()
Dmul-overflow.cpp1 // RUN: %clangxx -fsanitize=signed-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s
7 (void)(int8_t(-2) * int8_t(0x7f)); in main()
12 …// CHECK: mul-overflow.cpp:13:27: runtime error: signed integer overflow: 65535 * 32769 cannot be … in main()
Dsuppressions.cpp1 // RUN: %clangxx -fsanitize=integer -g0 %s -o %t
3 // Suppression by symbol name (unsigned-integer-overflow:do_overflow below)
4 // requires the compiler-rt runtime to be able to symbolize stack addresses.
5 // REQUIRES: can-symbolize
10 // RUN: echo "signed-integer-overflow:%t" > %t.wrong-supp
11 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.wrong-supp"' not %run %t 2>&1 | FileCheck…
13 // RUN: echo "unsigned-integer-overflow:do_overflow" > %t.func-supp
14 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.func-supp"' %run %t
15 // RUN: echo "unsigned-integer-overflow:%t" > %t.module-supp
16 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.module-supp"' %run %t
[all …]
/external/clang/docs/
DUndefinedBehaviorSanitizer.rst12 UBSan modifies the program at compile-time to catch various kinds of undefined
16 * Signed integer overflow
17 * Conversion to, from, or between floating-point types which would
18 overflow the destination
20 See the full list of available :ref:`checks <ubsan-checks>` below.
22 UBSan has an optional run-time library which provides better error reporting.
33 Use ``clang++`` to compile and link your program with ``-fsanitize=undefined``
38 .. code-block:: console
46 % clang++ -fsanitize=undefined test.cc
48 …test.cc:3:5: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type …
[all …]
/external/XNNPACK/src/qs8-requantization/
Dgemmlowp-scalar.c6 // This source code is licensed under the BSD-style license found in the
14 #include <xnnpack/requantization-stubs.h>
28 assert(scale >= 0x1.0p-32f); in xnn_qs8_requantize_gemmlowp__scalar()
39 const int32_t shift = 127 + 31 - 32 - (float_as_uint32(scale) >> 23); in xnn_qs8_requantize_gemmlowp__scalar()
44 const int32_t remainder_mask = (int32_t)((UINT32_C(1) << shift) - UINT32_C(1)); in xnn_qs8_requantize_gemmlowp__scalar()
46 const int32_t smin = (int32_t) qmin - (int32_t) zero_point; in xnn_qs8_requantize_gemmlowp__scalar()
47 const int32_t smax = (int32_t) qmax - (int32_t) zero_point; in xnn_qs8_requantize_gemmlowp__scalar()
48 for (; n != 0; n -= 4) { in xnn_qs8_requantize_gemmlowp__scalar()
55 // Compute full 64-bit product of signed 32-bit factors. in xnn_qs8_requantize_gemmlowp__scalar()
57 // Note: multiplier can be treated as either signed or unsigned. in xnn_qs8_requantize_gemmlowp__scalar()
[all …]
/external/XNNPACK/src/qu8-requantization/
Dgemmlowp-scalar.c6 // This source code is licensed under the BSD-style license found in the
14 #include <xnnpack/requantization-stubs.h>
28 assert(scale >= 0x1.0p-32f); in xnn_qu8_requantize_gemmlowp__scalar()
39 const int32_t shift = 127 + 31 - 32 - (float_as_uint32(scale) >> 23); in xnn_qu8_requantize_gemmlowp__scalar()
44 const int32_t remainder_mask = (int32_t) ((UINT32_C(1) << shift) - UINT32_C(1)); in xnn_qu8_requantize_gemmlowp__scalar()
46 const int32_t smin = (int32_t) (uint32_t) qmin - (int32_t) (uint32_t) zero_point; in xnn_qu8_requantize_gemmlowp__scalar()
47 const int32_t smax = (int32_t) (uint32_t) qmax - (int32_t) (uint32_t) zero_point; in xnn_qu8_requantize_gemmlowp__scalar()
48 for (; n != 0; n -= 4) { in xnn_qu8_requantize_gemmlowp__scalar()
55 // Compute full 64-bit product of signed 32-bit factors. in xnn_qu8_requantize_gemmlowp__scalar()
57 // Note: multiplier can be treated as either signed or unsigned. in xnn_qu8_requantize_gemmlowp__scalar()
[all …]
/external/compiler-rt/lib/ubsan/
Dubsan_checks.inc1 //===-- ubsan_checks.inc ----------------------------------------*- C++ -*-===//
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
20 UBSAN_CHECK(GenericUB, "undefined-behavior", "undefined")
21 UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null")
22 UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment")
23 UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size")
24 UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow",
25 "signed-integer-overflow")
26 UBSAN_CHECK(UnsignedIntegerOverflow, "unsigned-integer-overflow",
[all …]
/external/libchrome/libchrome_tools/patch/
Dstatfs_f_type.patch1 # In some platforms, |statfs_buf.f_type| is declared as signed, but some of the
2 # values will overflow it, causing narrowing warnings. Cast to the largest
3 # possible unsigned integer type to avoid it.
5 --- a/base/files/file_util_linux.cc
7 @@ -6,6 +6,7 @@
15 @@ -23,7 +24,10 @@ bool GetFileSystemType(const FilePath& p
19 - switch (statfs_buf.f_type) {
20 + // In some platforms, |statfs_buf.f_type| is declared as signed, but some of
21 + // the values will overflow it, causing narrowing warnings. Cast to the
22 + // largest possible unsigned integer type to avoid it.
[all …]
/external/clang/test/CodeGen/
Dcompound-assign-overflow.c2-ffreestanding -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fsanitize=signed-integer-overflo…
Dinteger-overflow.c1 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=DEF…
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fwrapv | FileCheck %s --check-pr…
3 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv | FileCheck %s --check-pr…
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=signed-integer-overflo…
5 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv -ftrapv-handler foo | Fil…
8 // Tests for signed integer overflow stuff.
11 // DEFAULT-LABEL: define void @test1 in test1()
12 // WRAPV-LABEL: define void @test1 in test1()
13 // TRAPV-LABEL: define void @test1 in test1()
18 // TRAPV: llvm.sadd.with.overflow.i32 in test1()
[all …]
Dcatch-undef-behavior.c1-fsanitize=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla
2-fsanitize-trap=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflo…
3 …RUN: %clang_cc1 -fsanitize=null -fsanitize-recover=null -emit-llvm %s -o - -triple x86_64-linux-gn…
4 …UN: %clang_cc1 -fsanitize=signed-integer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | Fi…
6 // CHECK-UBSAN: @[[INT:.*]] = private unnamed_addr constant { i16, i16, [6 x i8] } { i16 0, i16 11,…
9 // CHECK-UBSAN: @[[LINE_100:.*]] = private unnamed_addr global {{.*}}, i32 100, i32 5 {{.*}} @[[INT…
10 // CHECK-UBSAN: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 10 {{.*}}, i64 4, i8 0
11 // CHECK-UBSAN: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 12 {{.*}} @{{.*}}, {{.*}} @{{.*}}
12 // CHECK-UBSAN: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 12 {{.*}} @{{.*}}, {{.*}} @{{.*}}
13 // CHECK-UBSAN: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 10 {{.*}} @{{.*}}, i64 4, i8 0 }
[all …]
Dneon-immediate-ubsan.c1 // RUN: %clang_cc1 -triple armv7s-linux-gnu -emit-llvm -o - %s \
2 // RUN: -target-feature +neon -target-cpu cortex-a8 \
3 // RUN: -fsanitize=signed-integer-overflow \
4 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=ARMV7
6 // RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm -o - %s \
7 // RUN: -target-feature +neon -target-cpu cortex-a53 \
8 // RUN: -fsanitize=signed-integer-overflow \
9 // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=AARCH64
13 // overflow intrinsics, if the overflow sanitizer is enabled.
20 // CHECK-LABEL: @test_vqrshrn_n_s64 in test_vqrshrn_n_s64()
[all …]
/external/sdv/vsomeip/third_party/boost/numeric/conversion/doc/
Ddefinitions.qbk4 Copyright (c) 2003-2007 Fernando Luis Cacciola Carballal
44 be used for padding or there may be trap-bits.
94 [[[_signed integer types] (§3.9.1/2):][
95 `{signed char, signed short int, signed int, signed long int}`
96 Can be used to represent general integer numbers (both negative and positive).
98 [[[_unsigned integer types] (§3.9.1/3):][
100 Can be used to represent positive integer numbers with modulo-arithmetic.
102 [[[_floating-point types] (§3.9.1/8):][
106 [[[_integral or integer types] (§3.9.1/7):][
107 `{{signed integers},{unsigned integers}, bool, char and wchar_t}`
[all …]
/external/swiftshader/third_party/SPIRV-Tools/source/util/
Dparse_number.h7 // http://www.apache.org/licenses/LICENSE-2.0
23 #include "spirv-tools/libspirv.h"
33 // ParseAndEncode{|Integer|Floating}Number().
37 // Returns true if the type is a scalar integer type.
48 // Returns true if the type is a signed value.
58 // Returns the number of bits in the type. This is only valid for integer and
74 // referenced value of type T to 0 if T is an unsigned integer type, and
83 // The specialization of ClampToZeroIfUnsignedType for unsigned integer types.
99 // specified as a hexadecimal number, then the overflow bits should be zero.
100 // If it was hex and the target type is signed, then return the sign-extended
[all …]
/external/deqp-deps/SPIRV-Tools/source/util/
Dparse_number.h7 // http://www.apache.org/licenses/LICENSE-2.0
23 #include "spirv-tools/libspirv.h"
33 // ParseAndEncode{|Integer|Floating}Number().
37 // Returns true if the type is a scalar integer type.
48 // Returns true if the type is a signed value.
58 // Returns the number of bits in the type. This is only valid for integer and
74 // referenced value of type T to 0 if T is an unsigned integer type, and
83 // The specialization of ClampToZeroIfUnsignedType for unsigned integer types.
99 // specified as a hexadecimal number, then the overflow bits should be zero.
100 // If it was hex and the target type is signed, then return the sign-extended
[all …]
/external/angle/third_party/spirv-tools/src/source/util/
Dparse_number.h7 // http://www.apache.org/licenses/LICENSE-2.0
23 #include "spirv-tools/libspirv.h"
33 // ParseAndEncode{|Integer|Floating}Number().
37 // Returns true if the type is a scalar integer type.
48 // Returns true if the type is a signed value.
58 // Returns the number of bits in the type. This is only valid for integer and
74 // referenced value of type T to 0 if T is an unsigned integer type, and
83 // The specialization of ClampToZeroIfUnsignedType for unsigned integer types.
99 // specified as a hexadecimal number, then the overflow bits should be zero.
100 // If it was hex and the target type is signed, then return the sign-extended
[all …]
/external/tensorflow/tensorflow/compiler/xla/
Doverflow_util.h7 http://www.apache.org/licenses/LICENSE-2.0
27 // Multiply two nonnegative int64_t's, returning negative for overflow
29 // Multiply in uint64_t rather than int64_t since signed overflow is in MultiplyWithoutOverflow()
36 // Check if we overflow uint64_t, using a cheap check if both inputs are small in MultiplyWithoutOverflow()
42 // Otherwise, detect overflow using a division in MultiplyWithoutOverflow()
43 if (ux != 0 && uxy / ux != uy) return -1; in MultiplyWithoutOverflow()
46 // Cast back to signed. Any negative value will signal an error. in MultiplyWithoutOverflow()
52 // x and y must be signed integers.
56 "Only implemented for signed numbers T."); in OverflowSafeAdd()
58 // "Signed integer overflow occurs on integer addition iff the operands have in OverflowSafeAdd()
/external/swiftshader/third_party/SPIRV-Tools/test/
Dparse_number_test.cpp1 // Copyright (c) 2015-2016 The Khronos Group Inc.
7 // http://www.apache.org/licenses/LICENSE-2.0
21 #include "spirv-tools/libspirv.h"
42 EXPECT_TRUE(ParseNumber("-32768", &i16)); in TEST()
43 EXPECT_EQ(-32768, i16); in TEST()
44 EXPECT_TRUE(ParseNumber("-0", &i16)); in TEST()
72 // We don't care about -0 since it's rejected at a higher level. in TEST()
73 EXPECT_FALSE(ParseNumber("-1", &u16)); in TEST()
93 EXPECT_TRUE(ParseNumber("-0", &i32)); in TEST()
95 EXPECT_TRUE(ParseNumber("-1", &i32)); in TEST()
[all …]
/external/deqp-deps/SPIRV-Tools/test/
Dparse_number_test.cpp1 // Copyright (c) 2015-2016 The Khronos Group Inc.
7 // http://www.apache.org/licenses/LICENSE-2.0
21 #include "spirv-tools/libspirv.h"
42 EXPECT_TRUE(ParseNumber("-32768", &i16)); in TEST()
43 EXPECT_EQ(-32768, i16); in TEST()
44 EXPECT_TRUE(ParseNumber("-0", &i16)); in TEST()
72 // We don't care about -0 since it's rejected at a higher level. in TEST()
73 EXPECT_FALSE(ParseNumber("-1", &u16)); in TEST()
93 EXPECT_TRUE(ParseNumber("-0", &i32)); in TEST()
95 EXPECT_TRUE(ParseNumber("-1", &i32)); in TEST()
[all …]
/external/angle/third_party/spirv-tools/src/test/
Dparse_number_test.cpp1 // Copyright (c) 2015-2016 The Khronos Group Inc.
7 // http://www.apache.org/licenses/LICENSE-2.0
21 #include "spirv-tools/libspirv.h"
42 EXPECT_TRUE(ParseNumber("-32768", &i16)); in TEST()
43 EXPECT_EQ(-32768, i16); in TEST()
44 EXPECT_TRUE(ParseNumber("-0", &i16)); in TEST()
72 // We don't care about -0 since it's rejected at a higher level. in TEST()
73 EXPECT_FALSE(ParseNumber("-1", &u16)); in TEST()
93 EXPECT_TRUE(ParseNumber("-0", &i32)); in TEST()
95 EXPECT_TRUE(ParseNumber("-1", &i32)); in TEST()
[all …]
/external/guava/guava/src/com/google/common/math/
DIntMath.java7 * http://www.apache.org/licenses/LICENSE-2.0
55 @VisibleForTesting static final int MAX_SIGNED_POWER_OF_TWO = 1 << (Integer.SIZE - 2);
62 * @throws ArithmeticException of the next-higher power of two is not representable as an {@code
71 return 1 << -Integer.numberOfLeadingZeros(x - 1); in ceilingPowerOfTwo()
83 return Integer.highestOneBit(x); in floorPowerOfTwo()
89 * <p>This differs from {@code Integer.bitCount(x) == 1}, because {@code
90 * Integer.bitCount(Integer.MIN_VALUE) == 1}, but {@link Integer#MIN_VALUE} is not a power of two.
93 return x > 0 & (x & (x - 1)) == 0; in isPowerOfTwo()
97 * Returns 1 if {@code x < y} as unsigned integers, and 0 otherwise. Assumes that x - y fits into
98 * a signed int. The implementation is branch-free, and benchmarks suggest it is measurably (if
[all …]
/external/guava/android/guava/src/com/google/common/math/
DIntMath.java7 * http://www.apache.org/licenses/LICENSE-2.0
55 @VisibleForTesting static final int MAX_SIGNED_POWER_OF_TWO = 1 << (Integer.SIZE - 2);
62 * @throws ArithmeticException of the next-higher power of two is not representable as an {@code
71 return 1 << -Integer.numberOfLeadingZeros(x - 1); in ceilingPowerOfTwo()
83 return Integer.highestOneBit(x); in floorPowerOfTwo()
89 * <p>This differs from {@code Integer.bitCount(x) == 1}, because {@code
90 * Integer.bitCount(Integer.MIN_VALUE) == 1}, but {@link Integer#MIN_VALUE} is not a power of two.
93 return x > 0 & (x & (x - 1)) == 0; in isPowerOfTwo()
97 * Returns 1 if {@code x < y} as unsigned integers, and 0 otherwise. Assumes that x - y fits into
98 * a signed int. The implementation is branch-free, and benchmarks suggest it is measurably (if
[all …]
/external/neven/Embedded/common/src/b_BasicEm/
DMath.h8 * http://www.apache.org/licenses/LICENSE-2.0
24 /* ---- includes ----------------------------------------------------------- */
31 /* ---- related objects --------------------------------------------------- */
33 /* ---- typedefs ----------------------------------------------------------- */
35 /* ---- constants ---------------------------------------------------------- */
37 /* ---- macros ------------------------------------------------------------- */
46 #define bbs_abs( valA ) ( ( valA ) > 0 ? ( valA ) : -( valA ) )
48 /* ---- external functions ------------------------------------------------- */
52 * The return value 'r' is the largest possible integer that
61 * The return value 'r' is the largest possible integer that
[all …]

12345678910>>...42