Skip to content

Commit 983a349

Browse files
gumb0chfast
authored andcommitted
test: Add C compilation tests
1 parent 994beda commit 983a349

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ set(fizzy_include_dir ${PROJECT_SOURCE_DIR}/lib/fizzy)
2727
add_subdirectory(utils)
2828
add_subdirectory(bench)
2929
add_subdirectory(bench_internal)
30+
add_subdirectory(compilation)
3031
add_subdirectory(smoketests)
3132
add_subdirectory(spectests)
3233
add_subdirectory(testfloat)

test/compilation/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EVMC: Ethereum Client-VM Connector API.
2+
# Copyright 2018-2020 The EVMC Authors.
3+
# Licensed under the Apache License, Version 2.0.
4+
5+
# This CMake script creates multiple additional targets to test the compilation of public headers
6+
# with different C standards.
7+
8+
set(STANDARDS c_std_99 c_std_11)
9+
10+
foreach(STANDARD 99 11)
11+
set(target test-compile-c${STANDARD})
12+
add_library(${target} OBJECT compilation_test.c)
13+
target_link_libraries(${target} PRIVATE fizzy::fizzy)
14+
set_target_properties(${target} PROPERTIES C_STANDARD ${STANDARD} C_EXTENSIONS OFF C_STANDARD_REQUIRED TRUE)
15+
endforeach()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Fizzy: A fast WebAssembly interpreter
2+
// Copyright 2020 The Fizzy Authors.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
#include <fizzy/fizzy.h>
6+
7+
void dummy() {}

0 commit comments

Comments
 (0)