-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
# Copyright (c) 2024, Trail of Bits, Inc. All rights reserved. This source code | ||
# is licensed in accordance with the terms specified in the LICENSE file found | ||
# in the root directory of this source tree. | ||
|
||
cmake_minimum_required(VERSION 3.25) | ||
|
||
include(CTest) | ||
|
||
add_executable(patchestry_test ghidra.cpp) | ||
target_link_libraries(patchestry_test | ||
PRIVATE | ||
patchestry_ghidra | ||
patchestry_settings | ||
# Configure the lit site configuration file | ||
configure_lit_site_cfg( | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in | ||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py | ||
MAIN_CONFIG | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py | ||
) | ||
|
||
# Define test dependencies | ||
set(TEST_DEPS | ||
FileCheck | ||
) | ||
|
||
# Add a lit test suite named "PatchestryTest" | ||
add_lit_testsuite(PatchestryTest "Running Patchestry tests" | ||
${CMAKE_CURRENT_SOURCE_DIR}/ghidra | ||
DEPENDS ${TEST_DEPS} | ||
) | ||
|
||
add_test(NAME patchestry_test COMMAND patchestry_test) | ||
# Add a CTest test that runs the lit test suite | ||
add_test(NAME lit | ||
COMMAND lit -v "${CMAKE_CURRENT_BINARY_DIR}/ghidra" | ||
--param BUILD_TYPE=$<CONFIG>) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// UNSUPPORTED: system-windows | ||
// RUN: %cc %s -o %t | ||
// RUN %t; if [ "$(uname)" = "Linux" ]; then %decompile-headless %t argc %t1 fi | ||
// RUN %t; if [ "$(uname)" = "Darwin" ]; then %decompile-headless %t _argc %t1 fi | ||
// RUN %t1; %file-check %s --input-file %t1 | ||
// CHECK: {{...}} | ||
|
||
int argc(int argc, char **argv) { | ||
return argc; | ||
} | ||
int main(int a, char **argv) | ||
{ | ||
return argc(a, argv); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// UNSUPPORTED: system-windows | ||
// RUN: %cc %s -o %t | ||
// RUN %t; if [ "$(uname)" = "Linux" ]; then %decompile-headless %t fibonacci %t1 fi | ||
// RUN %t; if [ "$(uname)" = "Darwin" ]; then %decompile-headless %t _fibonacci %t1 fi | ||
// RUN %t1; %file-check %s --input-file %t1 | ||
// CHECK: {{...}} | ||
|
||
#include <stdio.h> | ||
|
||
int fibonacci(int n) { | ||
if (n <= 1) return n; | ||
return fibonacci(n - 1) + fibonacci(n - 2); | ||
} | ||
|
||
int main() { | ||
int n = 10; | ||
printf("%d: %d\n", n, fibonacci(n)); | ||
return 0; | ||
} | ||
|