2 * Copyright (C) 2009 The Android Open Source Project
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CLIMITS__
32 #error "Wrong header file included!!"
37 const int kPassed = 0;
38 const int kFailed = 1;
39 #define FAIL_UNLESS(f) if (!android::f()) return kFailed;
40 } // anonymous namespace
47 volatile char c1 = CHAR_BIT;
48 volatile char c2 = CHAR_MAX;
49 volatile char c3 = CHAR_MIN;
52 volatile int i1 = INT_MAX;
53 volatile int i2 = INT_MIN;
56 volatile short s1 = SHRT_MAX;
57 volatile short s2 = SHRT_MIN;
60 volatile long l1 = LONG_MAX;
61 volatile long l2 = LONG_MIN;
64 volatile long long ll1 = LLONG_MAX;
65 volatile long long ll2 = LLONG_MIN;
67 volatile unsigned long mb = MB_LEN_MAX;
70 volatile signed char sc1 = SCHAR_MIN;
71 volatile signed char sc2 = SCHAR_MAX;
74 volatile unsigned int ui = UINT_MAX;
75 volatile unsigned short us = USHRT_MAX;
76 volatile unsigned long ul = ULONG_MAX;
77 volatile unsigned long long ull = ULLONG_MAX;
82 } // namespace android
84 int main(int argc, char **argv)
86 FAIL_UNLESS(testLimits);