aboutsummaryrefslogtreecommitdiff
path: root/backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 19:46:28 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 19:46:28 +0800
commit2ef71f86a2b3e23967e8af08ba1eaaa950f0e1b5 (patch)
tree106812bfab46391030440d3f138333e815c4d053 /backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake
parentde2d87751e05f8f0a804be45284f1314ec39055d (diff)
downloadrcc-project-2ef71f86a2b3e23967e8af08ba1eaaa950f0e1b5.tar.gz
rcc-project-2ef71f86a2b3e23967e8af08ba1eaaa950f0e1b5.tar.xz
[Tooling] Remove the duplicate assembly emitter
Diffstat (limited to 'backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake')
-rw-r--r--backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake57
1 files changed, 0 insertions, 57 deletions
diff --git a/backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake b/backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake
deleted file mode 100644
index 85977df..0000000
--- a/backend/tools/AssemblyEmitter/AssemblyPipelineTest.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-if(NOT DEFINED EMITTER OR NOT DEFINED INPUT OR NOT DEFINED OUTPUT)
- message(FATAL_ERROR "assembly pipeline test is missing a required path")
-endif()
-
-execute_process(
- COMMAND "${EMITTER}" --input "${INPUT}"
- RESULT_VARIABLE FirstResult
- OUTPUT_VARIABLE FirstAssembly
- ERROR_VARIABLE FirstDiagnostics
-)
-if(NOT FirstResult EQUAL 0)
- message(FATAL_ERROR "assembly pipeline failed: ${FirstDiagnostics}")
-endif()
-if(NOT FirstAssembly MATCHES "\\.attribute arch, \"rv64gc\"" OR
- NOT FirstAssembly MATCHES "jalr x0, x1, 0")
- message(FATAL_ERROR "assembly pipeline output is missing required RV64GC content")
-endif()
-if(INPUT MATCHES "RISCVDataPipeline" AND
- (NOT FirstAssembly MATCHES "\\.LCPI[0-9]+_0:" OR
- NOT FirstAssembly MATCHES "\\.LJTI[0-9]+_0:"))
- message(FATAL_ERROR "assembly pipeline did not emit its constant pool and jump table")
-endif()
-if(INPUT MATCHES "RISCVStackFramePipeline" AND
- (NOT FirstAssembly MATCHES "addi x2, x2, -32" OR
- NOT FirstAssembly MATCHES "addi x2, x2, 32"))
- message(FATAL_ERROR "assembly pipeline did not balance its stack frame")
-endif()
-
-execute_process(
- COMMAND "${EMITTER}" --input "${INPUT}"
- RESULT_VARIABLE SecondResult
- OUTPUT_VARIABLE SecondAssembly
- ERROR_VARIABLE SecondDiagnostics
-)
-if(NOT SecondResult EQUAL 0)
- message(FATAL_ERROR "repeated assembly pipeline failed: ${SecondDiagnostics}")
-endif()
-if(NOT FirstAssembly STREQUAL SecondAssembly)
- message(FATAL_ERROR "assembly pipeline output is not deterministic")
-endif()
-
-if(DEFINED LLVM_MC AND NOT LLVM_MC STREQUAL "LLVM_MC-NOTFOUND" AND
- NOT LLVM_MC STREQUAL "")
- file(WRITE "${OUTPUT}" "${FirstAssembly}")
- execute_process(
- COMMAND "${LLVM_MC}" -triple=riscv64-unknown-linux-gnu -filetype=null "${OUTPUT}"
- RESULT_VARIABLE AssemblerResult
- OUTPUT_VARIABLE AssemblerOutput
- ERROR_VARIABLE AssemblerDiagnostics
- )
- file(REMOVE "${OUTPUT}")
- if(NOT AssemblerResult EQUAL 0)
- message(FATAL_ERROR "LLVM MC rejected generated assembly: ${AssemblerDiagnostics}")
- endif()
-endif()