1# Check if APP_ABI=armeabi-v7a use "rev" instructions for __swapXX
2# See https://android-review.googlesource.com/#/c/17144
3#
4
5fail_panic ()
6{
7    if [ $? != 0 ] ; then
8        echo "ERROR: $@"
9        exit 1
10    fi
11}
12
13for opt do
14    optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
15    case "$opt" in
16    APP_ABI=*)
17        APP_ABI=$optarg
18        ;;
19    esac
20done
21
22$NDK/ndk-build -B APP_CFLAGS=-save-temps
23fail_panic "can't compile!"
24grep -w madd cortex-a53-835769-1.s | grep -qw w0,
25fail_panic "fail to generate correct code for cortex-a53-835769-1.c"
26grep -w madd cortex-a53-835769-2.s | grep -qw w0,
27fail_panic "fail to generate correct code for cortex-a53-835769-2.c"
28
29rm -rf libs obj cortex-a53-835769-*
30