• Home
Name Date Size #Lines LOC

..--

P_alloc_in_struct/03-May-2024-128

P_array_init/03-May-2024-3124

P_compute/03-May-2024-1914

P_ref_count/03-May-2024-12295

bitcode_wrapper/03-May-2024-5244

debug/03-May-2024-2216

opt/03-May-2024-141109

padding/03-May-2024-318269

READMED03-May-20241.6 KiB4334

lit.cfgD03-May-20243.5 KiB7555

rs-filecheck-wrapper.shD03-May-2024475 167

run-lit-tests.shD03-May-2024176 73

scriptc-filecheck-wrapper.shD03-May-20241.6 KiB9680

README

1
2Summary
3=======
4This directory contains tests for Slang that use the 'llvm-lit' testing tool.
5Each testcase is a separate .rs file, and comments inside the testcase are
6used to verify certain strings are present in the output bitcode files.
7
8Prerequisites
9=============
10To run the tests, you must have the android build environment variables
11set (i.e. source build/envsetup.sh; lunch). You must also have on your path:
12- Android version of llvm-lit (currently in libbcc/tests/debuginfo)
13- FileCheck (utility from llvm)
14- llvm-rs-cc (slang frontend compiler)
15
16If you are unable to run the tests, try using the "--debug" option to llvm-lit.
17
18When debugging failures, the "-v" option will print to stdout the details of
19the failure. Note that tests marked as "Expected Fail" (XFAIL) will not print
20failure information, even with -v.
21
22Customizing
23===========
24The tools lit and FileCheck are fairly flexible, and could be used to validate
25more than just emitted bitcode. For example, with some changes to the testcases
26and the helper shell-script rs-filecheck-wrapper.sh, it should be possible to
27write tests that verify the emitted Java code.
28
29Running
30=======
31To execute all the tests from this directory, use the Android llvm-lit tool
32from libbcc:
33$ ../../libbcc/tests/debuginfo/llvm-lit .
34
35The tool can be run from any directory.
36-j controls the number of parallel test executions
37-v enables additional verbosity (useful when examining unexpected failures)
38
39Adding new tests
40================
41To add new tests, just add .rs files to a test directory with similar
42RUN/CHECK directives in comments as the existing tests.
43