aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/tests/ansi/abs.c
blob: 492040ccfe536399df7a07502d71cd6a0a4ad865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdlib.h>
#include <assert.h>
#include <limits.h>

int main(){
    assert(abs(-10) == 10);
    assert(abs(2021) == 2021);

    assert(labs(-256) == 256);
    assert(labs(10034890) == 10034890);

    assert(llabs(-0x2deadbeef) == 0x2deadbeef);
    assert(llabs(49238706947) == 49238706947);

    return 0;
}