1
0
Files
binutils/debian/tests/libc-link
Konstantin Demin 8c29d0a2c2 initial import from Debian
version: 2.45-4 (UNRELEASED)
commit: bf4f75f17a4f370adc9bf9feca09710ce76ecc63
2025-08-11 12:46:32 +03:00

30 lines
567 B
Bash

#!/bin/sh
# autopkgtest check: Build and run a simple program against libc, to verify
# basic binutils compile-time and run-time linking functionality.
#
# (C) 2012 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > libctest.c
#include <string.h>
#include <assert.h>
int main()
{
assert (1 > 0);
assert (strcmp ("hello", "hello") == 0);
return 0;
}
EOF
gcc -o libctest libctest.c
echo "build: OK"
[ -x libctest ]
./libctest
echo "run: OK"