brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 6937bb0 Raw
29 lines · plain
1Notes:2------3As we should avoid committing binaries (.wasm) to be used in tests,4instead we provide the '.cpp' source files and the '.s' files.5 6- For the tests, only the '.s' files are required.7- We use the target 'wasm32' as the 'wasm64' is not standardized yet.8 9How to generate .s from .cpp10----------------------------11Use clang to generate the '.s'.12 13  clang --target=wasm32 -S -g Inputs/hello-world.cpp -o Inputs/hello-world-clang.s14  clang --target=wasm32 -S -g Inputs/pr-43860.cpp    -o Inputs/pr-43860-clang.s15  clang --target=wasm32 -S -g Inputs/pr-44884.cpp    -o Inputs/pr-44884-clang.s16  clang --target=wasm32 -S -g Inputs/pr-46466.cpp    -o Inputs/pr-46466-clang.s17  clang --target=wasm32 -S -g Inputs/test.cpp        -o Inputs/test-clang.s18 19How to generate .o from .s20--------------------------------21Each test executes one of the following commands in order to generate22the binary '.wasm' used by that specific test:23 24  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/hello-world-clang.s -o hello-world-clang.o25  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/pr-43860-clang.s    -o pr-43860-clang.o26  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/pr-44884-clang.s    -o pr-44884-clang.o27  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/pr-46466-clang.s    -o pr-46466-clang.o28  llvm-mc -arch=wasm32 -filetype=obj %p/Inputs/test-clang.s        -o test-clang.o29