-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'llvm-3.5' into llvm-3.6
Additional tests for "make check".
- Loading branch information
Showing
10 changed files
with
236 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#! /bin/sh | ||
|
||
########################################## | ||
# Try compiling a simple program with # | ||
# bf-clang++ and no special Byfl options # | ||
# # | ||
# By Scott Pakin <pakin@lanl.gov> # | ||
########################################## | ||
|
||
# Define some helper variables. The ":-" ones will normally be | ||
# provided by the Makefile. | ||
AWK=${AWK:-awk} | ||
PERL=${PERL:-perl} | ||
srcdir=${srcdir:-../../tests} | ||
top_srcdir=${top_srcdir:-../..} | ||
top_builddir=${top_builddir:-..} | ||
clangxx=${BF_CLANGXX:-clang++} | ||
bf_clangxx="./bf-clang++" | ||
|
||
# Log everything we do. Fail on the first error. | ||
set -e | ||
set -x | ||
|
||
# Test 1: Do the C compiler and linker work at all? | ||
"$clangxx" -g -o simple-clang++-no-opts "$srcdir/simple.cpp" | ||
|
||
# Test 2: Do the C compiler and linker work when invoked from the Byfl | ||
# wrapper script? | ||
env BF_DISABLE=byfl \ | ||
"$PERL" -I"$top_srcdir/tools/wrappers" \ | ||
"$bf_clangxx" -bf-plugin="$top_builddir/lib/bytesflops/.libs/bytesflops.so" \ | ||
-bf-verbose -g -o simple-clang++-no-opts "$srcdir/simple.cpp" \ | ||
-L"$top_builddir/lib/byfl/.libs" | ||
|
||
# Test 3: Can the Byfl wrapper script compile, instrument, and link a program? | ||
"$PERL" -I"$top_srcdir/tools/wrappers" \ | ||
"$bf_clangxx" -bf-plugin="$top_builddir/lib/bytesflops/.libs/bytesflops.so" \ | ||
-bf-verbose -g -o simple-clang++-no-opts "$srcdir/simple.cpp" \ | ||
-L"$top_builddir/lib/byfl/.libs" | ||
|
||
# Test 4: Does the Byfl-instrumented program run without error? | ||
env LD_LIBRARY_PATH="$top_builddir/lib/byfl/.libs:$LD_LIBRARY_PATH" \ | ||
./simple-clang++-no-opts | ||
|
||
# Test 5: Can we postprocess the binary output? Are the results correct within | ||
# an order of magnitude? | ||
int_ops=`"$top_builddir/tools/postproc/bfbin2csv" --include=Program --flat-output simple-clang++-no-opts.byfl | "$AWK" -F, '$3 ~ /Integer operations/ {print $4}'` | ||
if [ ! -z "$int_ops" ] && [ "$int_ops" -lt 100000 ] ; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#! /bin/sh | ||
|
||
####################################### | ||
# Try compiling a simple program with # | ||
# bf-clang and many Byfl options # | ||
# # | ||
# By Scott Pakin <pakin@lanl.gov> # | ||
####################################### | ||
|
||
# Define some helper variables. The ":-" ones will normally be | ||
# provided by the Makefile. | ||
AWK=${AWK:-awk} | ||
PERL=${PERL:-perl} | ||
srcdir=${srcdir:-../../tests} | ||
top_srcdir=${top_srcdir:-../..} | ||
top_builddir=${top_builddir:-..} | ||
clang=${BF_CLANG:-clang} | ||
bf_clang="$top_builddir/tools/wrappers/bf-clang" | ||
|
||
# Log everything we do. Fail on the first error. | ||
set -e | ||
set -x | ||
|
||
# Test 1: Do the C compiler and linker work at all? | ||
"$clang" -O2 -g -o simple-clang-many-opts "$srcdir/simple.c" | ||
|
||
# Test 2: Do the C compiler and linker work when invoked from the Byfl | ||
# wrapper script? | ||
env BF_DISABLE=byfl \ | ||
"$PERL" -I"$top_srcdir/tools/wrappers" \ | ||
"$bf_clang" -bf-plugin="$top_builddir/lib/bytesflops/.libs/bytesflops.so" \ | ||
-bf-verbose -O2 -g -o simple-clang-many-opts "$srcdir/simple.c" \ | ||
-L"$top_builddir/lib/byfl/.libs" \ | ||
-bf-unique-bytes -bf-by-func -bf-call-stack -bf-vectors -bf-every-bb -bf-reuse-dist -bf-mem-footprint -bf-types -bf-inst-mix -bf-data-structs -bf-inst-deps | ||
|
||
# Test 3: Can the Byfl wrapper script compile, instrument, and link a program? | ||
"$PERL" -I"$top_srcdir/tools/wrappers" \ | ||
"$bf_clang" -bf-plugin="$top_builddir/lib/bytesflops/.libs/bytesflops.so" \ | ||
-bf-verbose -O2 -g -o simple-clang-many-opts "$srcdir/simple.c" \ | ||
-L"$top_builddir/lib/byfl/.libs" \ | ||
-bf-unique-bytes -bf-by-func -bf-call-stack -bf-vectors -bf-every-bb -bf-reuse-dist -bf-mem-footprint -bf-types -bf-inst-mix -bf-data-structs -bf-inst-deps | ||
|
||
# Test 4: Does the Byfl-instrumented program run without error? | ||
env LD_LIBRARY_PATH="$top_builddir/lib/byfl/.libs:$LD_LIBRARY_PATH" \ | ||
./simple-clang-many-opts | ||
|
||
# Test 5: Can we postprocess the binary output? Are the results correct within | ||
# an order of magnitude? | ||
int_ops=`"$top_builddir/tools/postproc/bfbin2csv" --include=Program --flat-output simple-clang-many-opts.byfl | "$AWK" -F, '$3 ~ /Integer operations/ {print $4}'` | ||
if [ ! -z "$int_ops" ] && [ "$int_ops" -lt 100000 ] ; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#! /bin/sh | ||
|
||
####################################### | ||
# Try compiling a simple program with # | ||
# bf-gcc and no special Byfl options # | ||
# # | ||
# By Scott Pakin <pakin@lanl.gov> # | ||
####################################### | ||
|
||
# Define some helper variables. The ":-" ones will normally be | ||
# provided by the Makefile. | ||
AWK=${AWK:-awk} | ||
PERL=${PERL:-perl} | ||
srcdir=${srcdir:-../../tests} | ||
top_srcdir=${top_srcdir:-../..} | ||
top_builddir=${top_builddir:-..} | ||
gcc=${BF_GCC:-gcc} | ||
bf_gcc="$top_builddir/tools/wrappers/bf-gcc" | ||
use_draongegg=${use_draongegg:-yes} | ||
|
||
# Skip this test if we don't have DragonEgg. | ||
if [ "x$use_dragonegg" != xyes ] ; then | ||
exit 77 | ||
fi | ||
|
||
# Log everything we do. Fail on the first error. | ||
set -e | ||
set -x | ||
|
||
# Test 1: Do the C compiler and linker work at all? | ||
"$gcc" -g -o simple-gcc-no-opts "$srcdir/simple.c" | ||
|
||
# Test 2: Do the C compiler and linker work when invoked from the Byfl | ||
# wrapper script? | ||
env BF_DISABLE=byfl \ | ||
"$PERL" -I"$top_srcdir/tools/wrappers" \ | ||
"$bf_gcc" -bf-plugin="$top_builddir/lib/bytesflops/.libs/bytesflops.so" \ | ||
-bf-verbose -g -o simple-gcc-no-opts "$srcdir/simple.c" \ | ||
-L"$top_builddir/lib/byfl/.libs" | ||
|
||
# Test 3: Can the Byfl wrapper script compile, instrument, and link a program? | ||
"$PERL" -I"$top_srcdir/tools/wrappers" \ | ||
"$bf_gcc" -bf-plugin="$top_builddir/lib/bytesflops/.libs/bytesflops.so" \ | ||
-bf-verbose -g -o simple-gcc-no-opts "$srcdir/simple.c" \ | ||
-L"$top_builddir/lib/byfl/.libs" | ||
|
||
# Test 4: Does the Byfl-instrumented program run without error? | ||
env LD_LIBRARY_PATH="$top_builddir/lib/byfl/.libs:$LD_LIBRARY_PATH" \ | ||
./simple-gcc-no-opts | ||
|
||
# Test 5: Can we postprocess the binary output? Are the results correct within | ||
# an order of magnitude? | ||
int_ops=`"$top_builddir/tools/postproc/bfbin2csv" --include=Program --flat-output simple-gcc-no-opts.byfl | "$AWK" -F, '$3 ~ /Integer operations/ {print $4}'` | ||
if [ ! -z "$int_ops" ] && [ "$int_ops" -lt 100000 ] ; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/*********************************** | ||
* Do some simple, pointless work * | ||
* By Scott Pakin <pakin@lanl.gov> * | ||
***********************************/ | ||
|
||
#include <iostream> | ||
#include <cstdlib> | ||
|
||
int main (int argc, const char *argv[]) | ||
{ | ||
int iters = argc > 1 ? atoi(argv[1]) : 100000; | ||
int i; | ||
int sum = 0; | ||
|
||
for (i = 0; i < iters; i++) | ||
sum = sum*34564793 + i; | ||
std::cout << "Sum is " << sum << '\n'; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters