From da51c4cbd53943d8473562231b7753dadd89421c Mon Sep 17 00:00:00 2001
From: Bill Wendling
To run all of the simple tests in LLVM using DejaGNU, use the master Makefile in the llvm/test directory:
+ +% gmake -C llvm/test-or
or
+ +% gmake check+
To run only a subdirectory of tests in llvm/test using DejaGNU (ie. Regression/Transforms), just set the TESTSUITE variable to the path of the subdirectory (relative to llvm/test):
+ +% gmake -C llvm/test TESTSUITE=Regression/Transforms+
Note: If you are running the tests with objdir != subdir, you must have run the complete testsuite before you can specify a @@ -138,6 +148,7 @@ subdirectory.
To run the comprehensive test suite (tests that compile and execute whole programs), run the llvm-test tests:
+% cd llvm/projects % svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test @@ -145,6 +156,7 @@ programs), run the llvm-test tests: % ./configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT % gmake+
Below is an example of legal RUN lines in a .ll file:
-- ; RUN: llvm-as < %s | llvm-dis > %t1 - ; RUN: llvm-dis < %s.bc-13 > %t2 - ; RUN: diff %t1 %t2 -+ +
+; RUN: llvm-as < %s | llvm-dis > %t1 +; RUN: llvm-dis < %s.bc-13 > %t2 +; RUN: diff %t1 %t2 ++
As with a Unix shell, the RUN: lines permit pipelines and I/O redirection to be used. However, the usage is slightly different than for Bash. To check @@ -351,43 +366,66 @@ location of these external programs is configured by the llvm-test
There are some quoting rules that you must pay attention to when writing your RUN lines. In general nothing needs to be quoted. Tcl won't strip off any ' or " so they will get passed to the invoked program. For example:
-- ... | grep 'find this string' -+ +
+... | grep 'find this string' ++
This will fail because the ' characters are passed to grep. This would instruction grep to look for 'find in the files this and string'. To avoid this use curly braces to tell Tcl that it should treat everything enclosed as one value. So our example would become:
-- ... | grep {find this string} -+ +
+... | grep {find this string} ++
Additionally, the characters [ and ] are treated specially by Tcl. They tell Tcl to interpret the content as a command to execute. Since these characters are often used in regular expressions this can have disastrous results and cause the entire test run in a directory to fail. For example, a common idiom is to look for some basicblock number:
-- ... | grep bb[2-8] -+ +
+... | grep bb[2-8] ++
This, however, will cause Tcl to fail because its going to try to execute a program named "2-8". Instead, what you want is this:
-- ... | grep {bb\[2-8\]} -+ +
+... | grep {bb\[2-8\]} ++
Finally, if you need to pass the \ character down to a program, then it must be doubled. This is another Tcl special character. So, suppose you had: -
- ... | grep 'i32\*' -+ +
+... | grep 'i32\*' ++
This will fail to match what you want (a pointer to i32). First, the ' do not get stripped off. Second, the \ gets stripped off by Tcl so what grep sees is: 'i32*'. That's not likely to match anything. To resolve this you must use \\ and the {}, like this:
-- ... | grep {i32\\*} -+ +
+... | grep {i32\\*} ++
- ; XFAIL: darwin,sun,llvmgcc4 -+ +
+; XFAIL: darwin,sun,llvmgcc4 ++
To make the output more useful, the llvm_runtest function wil scan the lines of the test case for ones that contain a pattern that matches @@ -573,12 +636,14 @@ specify the following configuration options:
uses the default value /home/vadve/shared/benchmarks/speccpu2000/benchspec.+
+
The master Makefile in llvm/test is capable of running only the DejaGNU -driven tests. By default, it will run all of these tests.
+The master Makefile in llvm/test is capable of running only the +DejaGNU driven tests. By default, it will run all of these tests.
To run only the DejaGNU driven tests, run gmake at the command line in llvm/test. To run a specific directory of tests, use -the TESTSUITE variable. +the TESTSUITE variable.
For example, to run the Regression tests, type @@ -613,40 +678,71 @@ the TESTSUITE variable. llvm/test/Regression. You must use DejaGNU from the llvm/test directory to run them.
-To run the llvm-test suite, you need to use the following steps: -
+To run the llvm-test suite, you need to use the following steps:
+Check out the test-suite module with:
+ ++% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test ++
This will get the test suite into llvm/projects/llvm-test
+ +Configure the test suite. You can do this one of two ways:
++% cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure ++
This will ensure that the projects/llvm-test directory is + also properly configured.
Use the configure script found in the llvm-test + source directory:
+ ++% $LLVM_SRC_ROOT/projects/llvm-test/configure \ + --with-llvmsrc=$LLVM_SRC_ROOT \ + --with-llvmobj=$LLVM_OBJ_ROOT ++
Note that the second and third steps only need to be done once. After you have the suite checked out and configured, you don't need to do it again (unless the test code or configure script changes).
To make a specialized test (use one of the
-llvm-test/TEST.<type>.Makefiles), just run:
-gmake TEST=<type> test
For example, you could run the
-nightly tester tests using the following commands:
- % cd llvm/projects/llvm-test - % gmake TEST=nightly test +% gmake TEST=<type> test+
For example, you could run the nightly tester tests using the following +commands:
+ ++% cd llvm/projects/llvm-test +% gmake TEST=nightly test ++
Regardless of which test you're running, the results are printed on standard output and standard error. You can redirect these results to a file if you