#!/bin/bash
if [ "${DEB_BUILD_ARCH}" = "sparc64" ]
then
	cat > sparc64-test.cpp <<EOF
#include <iostream>
int main()
{
    std::cout << __builtin_popcountll(6ull) << std::endl;
}
EOF
	set -x
	g++ sparc64-test.cpp && ./a.out
	g++ -mpopc sparc64-test.cpp && ./a.out
	g++ -mno-popc sparc64-test.cpp && ./a.out
	rm -f sparc64-test.cpp
	rm -f a.out
fi
