• Home
Name Date Size #Lines LOC

..--

P_alloc_in_struct/07-May-2024-125

P_array_init/07-May-2024-3112

P_compute/07-May-2024-199

P_ref_count/07-May-2024-2212

bitcode_wrapper/07-May-2024-5244

debug/07-May-2024-2210

opt/07-May-2024-14190

READMED07-May-20241.6 KiB4334

lit.cfgD07-May-20243.5 KiB7555

rs-filecheck-wrapper.shD07-May-2024447 156

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

scriptc-filecheck-wrapper.shD07-May-20241.3 KiB7761

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