diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8ed7b16 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required(VERSION 3.10) +project(vmir + DESCRIPTION "vmir project" +) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tlsf) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) + +set(SRCS + src/main.c + src/vmir.c + tlsf/tlsf.c + ) + +set(DEPS + src/vmir.h + src/vmir_instr.c + src/vmir_value.c + src/vmir_type.c + src/vmir_jit_arm.c + src/vmir_vm.c + src/vmir_vm.h + src/vmir_transform.c + src/vmir_bitstream.c + src/vmir_support.c + src/vmir_function.c + src/vmir_libc.c + src/vmir_bitcode_parser.c + src/vmir_bitcode_instr.c + src/vmir_wasm_parser.c + ) + +set(COMMON_FLAG + -std=gnu99 + -Wall + -Werror + -Wmissing-prototypes + -DVMIR_USE_TLSF + ) + +function(add_vmir_executable a_ExeFileName a_Flags) + add_executable(${a_ExeFileName} + ${SRCS} + ) + target_compile_options(${a_ExeFileName} PRIVATE ${a_Flags}) + target_link_libraries(${a_ExeFileName} m) + set_target_properties(${a_ExeFileName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/") +endfunction() + +set(VMIR_FLAG -O2 ${COMMON_FLAG} -g) +add_vmir_executable(vmir ${VMIR_FLAG}) + +set(VMIR_DBG_FLAG -Og -DVM_DONT_USE_COMPUTED_GOTO ${COMMON_FLAG} -g) +add_vmir_executable(vmir.dbg ${VMIR_DBG_FLAG}) + +set(VMIR_TRACE_FLAG -DVM_TRACE -Og -DVM_DONT_USE_COMPUTED_GOTO ${COMMON_FLAG} -g) +add_vmir_executable(vmir.trace ${VMIR_TRACE_FLAG}) + +set(VMIR_ASAN_FLAG -fno-omit-frame-pointer -fsanitize=address -O0 -DVM_DONT_USE_COMPUTED_GOTO ${COMMON_FLAG} -g) +add_vmir_executable(vmir.asan ${VMIR_ASAN_FLAG}) +target_link_libraries(vmir.asan asan) + +set(ARM_GCC arm-linux-gnueabihf-gcc) +find_package(${ARM_GCC}) +if (${ARM_GCC}_FOUND) + set(CMAKE_C_COMPILER ${ARM_GCC}) + + set(VMIR_ARMV7_FLAG -O2 -static -march=armv7-a -mtune=cortex-a8 -mfpu=neon ${COMMON_FLAG} -g) + add_vmir_executable(vmir.armv7 ${VMIR_ARMV7_FLAG}) +endif() + +set(POWERPC64_GCC arm-linux-gnueabihf-gcc) +find_package(${POWERPC64_GCC}) +if (${POWERPC64_GCC}_FOUND) + set(CMAKE_C_COMPILER ${POWERPC64_GCC}) + + set(VMIR_PPC64_FLAG -fno-omit-frame-pointer -fsanitize=address -O0 -DVM_DONT_USE_COMPUTED_GOTO -DVMIR_USE_TLSF ${COMMON_FLAG} -g) + add_vmir_executable(vmir.ppc64 ${VMIR_PPC64_FLAG}) +endif() + +enable_testing() +add_subdirectory(test) + + diff --git a/clean_build.bash b/clean_build.bash new file mode 100755 index 0000000..3929c44 --- /dev/null +++ b/clean_build.bash @@ -0,0 +1,11 @@ +#!/bin/bash + +# Clean +cd build +make clean +#make clean_extra + +# Remove build dir +cd .. +rm -rf build/ + diff --git a/run_build_and_test.bash b/run_build_and_test.bash new file mode 100755 index 0000000..080376e --- /dev/null +++ b/run_build_and_test.bash @@ -0,0 +1,14 @@ +#!/bin/bash + +# Clean +./clean_build.bash + +# Build +mkdir build +cd build +cmake .. +make -j + +# Run test +ctest + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..e242c8b --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.10) +project(test + DESCRIPTION "test project" +) + +enable_testing() +add_subdirectory(gcc-torture) +add_subdirectory(misc) +add_subdirectory(regress) diff --git a/test/TestFunc.cmake b/test/TestFunc.cmake new file mode 100644 index 0000000..cfedc63 --- /dev/null +++ b/test/TestFunc.cmake @@ -0,0 +1,73 @@ +set(SYSROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../sysroot) + +set(CLANG clang-3.9) # work only clang-3.9 and clang-4.0 +set(CFLAGS_BC -fno-vectorize -fno-slp-vectorize -emit-llvm -target le32-unknown-nacl + --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${CMAKE_CURRENT_SOURCE_DIR} -std=gnu99 + ) + +function(BuildFile a_OutFile a_InputFile a_Oprimization a_Index) + set(OUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/build-O${a_Oprimization}/${a_InputFile}.bc + ) + set(${a_OutFile} ${OUT_FILE} PARENT_SCOPE) + + get_filename_component(OUT_FILE_DIR ${OUT_FILE} DIRECTORY) + get_filename_component(OUT_FILE_NAME ${OUT_FILE} NAME) + + add_custom_command( + OUTPUT ${OUT_FILE} + COMMAND mkdir -p ${OUT_FILE_DIR} + COMMAND ${CLANG} -O0 ${CFLAGS_BC} -c ${CMAKE_CURRENT_SOURCE_DIR}/${a_InputFile} -o ${OUT_FILE} + COMMENT "Compile ${SRCS_TEST_C_FILE}" + ) + + add_custom_target(${OUT_FILE_NAME}_${a_Index}_${a_Oprimization} ALL DEPENDS ${OUT_FILE}) +endfunction() + +function(BuildFile_AndTest a_FileName a_Oprimization a_Index) + BuildFile(OUT_FILE ${a_FileName} ${a_Oprimization} ${a_Index}) + + add_test(NAME test_${INDEX}_${a_FileName}_${a_Oprimization} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../../vmir ${OUT_FILE} + ) +endfunction() + +function(BuildFile_AndRegressTest a_FileName a_Oprimization a_Index) + BuildFile(OUT_FILE ${a_FileName} ${a_Oprimization} ${a_Index}) + + add_test(NAME test_${INDEX}_${a_FileName}_${a_Oprimization} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../run_regress_test ${CMAKE_CURRENT_SOURCE_DIR}/../../vmir ${OUT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${a_FileName}.expected + ) +endfunction() + +function(BuildVmirTest a_InputFileTemplate) + file(GLOB SRCS_TEST_C_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${a_InputFileTemplate}) #_RECURSE + + set(INDEX 0) + + foreach(SRCS_TEST_C_FILE ${SRCS_TEST_C_FILES}) + math(EXPR INDEX "${INDEX} + 1") + + BuildFile_AndTest(${SRCS_TEST_C_FILE} 0 ${INDEX}) + + BuildFile_AndTest(${SRCS_TEST_C_FILE} 1 ${INDEX}) + + BuildFile_AndTest(${SRCS_TEST_C_FILE} 2 ${INDEX}) + endforeach() +endfunction() + +function(BuildRegressTest a_InputFileTemplate) + file(GLOB SRCS_TEST_C_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${a_InputFileTemplate}) #_RECURSE + + set(INDEX 0) + + foreach(SRCS_TEST_C_FILE ${SRCS_TEST_C_FILES}) + math(EXPR INDEX "${INDEX} + 1") + + BuildFile_AndRegressTest(${SRCS_TEST_C_FILE} 0 ${INDEX}) + + BuildFile_AndRegressTest(${SRCS_TEST_C_FILE} 1 ${INDEX}) + + BuildFile_AndRegressTest(${SRCS_TEST_C_FILE} 2 ${INDEX}) + endforeach() +endfunction() diff --git a/test/gcc-torture/CMakeLists.txt b/test/gcc-torture/CMakeLists.txt new file mode 100644 index 0000000..a529da9 --- /dev/null +++ b/test/gcc-torture/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.10) +project(gcc-torture + DESCRIPTION "gcc-torture project" +) + +enable_testing() + +include(../TestFunc.cmake) + +BuildVmirTest("src/*.c") + +# vector-src - not work +#BuildVmirTest("vector-src/*.c") diff --git a/test/misc/CMakeLists.txt b/test/misc/CMakeLists.txt new file mode 100644 index 0000000..ebce01d --- /dev/null +++ b/test/misc/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(test_misc + DESCRIPTION "test_misc project" +) + +enable_testing() + +include(../TestFunc.cmake) + +BuildVmirTest("src/*.c") diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt new file mode 100644 index 0000000..69d55db --- /dev/null +++ b/test/regress/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.10) +project(regress_test + DESCRIPTION "regress_test project" +) + +enable_testing() + +include(../TestFunc.cmake) + +BuildRegressTest("stackl_test/*.c") + +BuildRegressTest("c-testsuite/single-exec/*.c") + diff --git a/test/regress/c-testsuite/LICENSE b/test/regress/c-testsuite/LICENSE new file mode 100644 index 0000000..6503d80 --- /dev/null +++ b/test/regress/c-testsuite/LICENSE @@ -0,0 +1,29 @@ +https://github.com/c-testsuite/c-testsuite + +The licenses of individual test cases can be discovered +by a test cases .otag file. + +The following license is for all testing software, but +not for individual test cases. see tests/LICENSE for details. + +MIT License + +Copyright (c) 2018 Andrew Chambers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/regress/c-testsuite/single-exec/00001.c b/test/regress/c-testsuite/single-exec/00001.c new file mode 100644 index 0000000..3a6dc7e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00001.c @@ -0,0 +1,5 @@ +int +main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00001.c.expected b/test/regress/c-testsuite/single-exec/00001.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00001.c.tags b/test/regress/c-testsuite/single-exec/00001.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00001.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00002.c b/test/regress/c-testsuite/single-exec/00002.c new file mode 100644 index 0000000..40b2f51 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00002.c @@ -0,0 +1,5 @@ +int +main() +{ + return 3-3; +} diff --git a/test/regress/c-testsuite/single-exec/00002.c.expected b/test/regress/c-testsuite/single-exec/00002.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00002.c.otags b/test/regress/c-testsuite/single-exec/00002.c.otags new file mode 100644 index 0000000..8c3770b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00002.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0002-expr.c diff --git a/test/regress/c-testsuite/single-exec/00002.c.tags b/test/regress/c-testsuite/single-exec/00002.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00002.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00003.c b/test/regress/c-testsuite/single-exec/00003.c new file mode 100644 index 0000000..f957c29 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00003.c @@ -0,0 +1,8 @@ +int +main() +{ + int x; + + x = 4; + return x - 4; +} diff --git a/test/regress/c-testsuite/single-exec/00003.c.expected b/test/regress/c-testsuite/single-exec/00003.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00003.c.otags b/test/regress/c-testsuite/single-exec/00003.c.otags new file mode 100644 index 0000000..a4c25be --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00003.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0003-local.c diff --git a/test/regress/c-testsuite/single-exec/00003.c.tags b/test/regress/c-testsuite/single-exec/00003.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00003.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00004.c b/test/regress/c-testsuite/single-exec/00004.c new file mode 100644 index 0000000..e983f1b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00004.c @@ -0,0 +1,12 @@ +int +main() +{ + int x; + int *p; + + x = 4; + p = &x; + *p = 0; + + return *p; +} diff --git a/test/regress/c-testsuite/single-exec/00004.c.expected b/test/regress/c-testsuite/single-exec/00004.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00004.c.otags b/test/regress/c-testsuite/single-exec/00004.c.otags new file mode 100644 index 0000000..f3e06a8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00004.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0004-pointer.c diff --git a/test/regress/c-testsuite/single-exec/00004.c.tags b/test/regress/c-testsuite/single-exec/00004.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00004.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00005.c b/test/regress/c-testsuite/single-exec/00005.c new file mode 100644 index 0000000..abcaa05 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00005.c @@ -0,0 +1,23 @@ +int +main() +{ + int x; + int *p; + int **pp; + + x = 0; + p = &x; + pp = &p; + + if(*p) + return 1; + if(**pp) + return 1; + else + **pp = 1; + + if(x) + return 0; + else + return 1; +} diff --git a/test/regress/c-testsuite/single-exec/00005.c.expected b/test/regress/c-testsuite/single-exec/00005.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00005.c.otags b/test/regress/c-testsuite/single-exec/00005.c.otags new file mode 100644 index 0000000..e9644ae --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00005.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0005-ifstmt.c diff --git a/test/regress/c-testsuite/single-exec/00005.c.tags b/test/regress/c-testsuite/single-exec/00005.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00005.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00006.c b/test/regress/c-testsuite/single-exec/00006.c new file mode 100644 index 0000000..d3a1377 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00006.c @@ -0,0 +1,10 @@ +int +main() +{ + int x; + + x = 50; + while (x) + x = x - 1; + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00006.c.expected b/test/regress/c-testsuite/single-exec/00006.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00006.c.otags b/test/regress/c-testsuite/single-exec/00006.c.otags new file mode 100644 index 0000000..26205b1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00006.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0006-whilestmt.c diff --git a/test/regress/c-testsuite/single-exec/00006.c.tags b/test/regress/c-testsuite/single-exec/00006.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00006.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00007.c b/test/regress/c-testsuite/single-exec/00007.c new file mode 100644 index 0000000..acdc901 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00007.c @@ -0,0 +1,15 @@ +int +main() +{ + int x; + + x = 1; + for(x = 10; x; x = x - 1) + ; + if(x) + return 1; + x = 10; + for (;x;) + x = x - 1; + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00007.c.expected b/test/regress/c-testsuite/single-exec/00007.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00007.c.otags b/test/regress/c-testsuite/single-exec/00007.c.otags new file mode 100644 index 0000000..beda6d8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00007.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0007-forstmt.c diff --git a/test/regress/c-testsuite/single-exec/00007.c.tags b/test/regress/c-testsuite/single-exec/00007.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00007.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00008.c b/test/regress/c-testsuite/single-exec/00008.c new file mode 100644 index 0000000..115b8b9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00008.c @@ -0,0 +1,11 @@ +int +main() +{ + int x; + + x = 50; + do + x = x - 1; + while(x); + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00008.c.expected b/test/regress/c-testsuite/single-exec/00008.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00008.c.otags b/test/regress/c-testsuite/single-exec/00008.c.otags new file mode 100644 index 0000000..69ab3af --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00008.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0008-dowhilestmt.c diff --git a/test/regress/c-testsuite/single-exec/00008.c.tags b/test/regress/c-testsuite/single-exec/00008.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00008.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00009.c b/test/regress/c-testsuite/single-exec/00009.c new file mode 100644 index 0000000..3defb01 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00009.c @@ -0,0 +1,11 @@ +int +main() +{ + int x; + + x = 1; + x = x * 10; + x = x / 2; + x = x % 3; + return x - 2; +} diff --git a/test/regress/c-testsuite/single-exec/00009.c.expected b/test/regress/c-testsuite/single-exec/00009.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00009.c.otags b/test/regress/c-testsuite/single-exec/00009.c.otags new file mode 100644 index 0000000..5fe415a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00009.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0009-expr.c diff --git a/test/regress/c-testsuite/single-exec/00009.c.tags b/test/regress/c-testsuite/single-exec/00009.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00009.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00010.c b/test/regress/c-testsuite/single-exec/00010.c new file mode 100644 index 0000000..d5bfbbf --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00010.c @@ -0,0 +1,13 @@ +int +main() +{ + start: + goto next; + return 1; + success: + return 0; + next: + foo: + goto success; + return 1; +} diff --git a/test/regress/c-testsuite/single-exec/00010.c.expected b/test/regress/c-testsuite/single-exec/00010.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00010.c.otags b/test/regress/c-testsuite/single-exec/00010.c.otags new file mode 100644 index 0000000..38630be --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00010.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0010-goto.c diff --git a/test/regress/c-testsuite/single-exec/00010.c.tags b/test/regress/c-testsuite/single-exec/00010.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00010.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00011.c b/test/regress/c-testsuite/single-exec/00011.c new file mode 100644 index 0000000..aa29782 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00011.c @@ -0,0 +1,8 @@ +int +main() +{ + int x; + int y; + x = y = 0; + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00011.c.expected b/test/regress/c-testsuite/single-exec/00011.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00011.c.otags b/test/regress/c-testsuite/single-exec/00011.c.otags new file mode 100644 index 0000000..41ddedd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00011.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0011-assign.c diff --git a/test/regress/c-testsuite/single-exec/00011.c.tags b/test/regress/c-testsuite/single-exec/00011.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00011.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00012.c b/test/regress/c-testsuite/single-exec/00012.c new file mode 100644 index 0000000..c2bf7d0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00012.c @@ -0,0 +1,5 @@ +int +main() +{ + return (2 + 2) * 2 - 8; +} diff --git a/test/regress/c-testsuite/single-exec/00012.c.expected b/test/regress/c-testsuite/single-exec/00012.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00012.c.otags b/test/regress/c-testsuite/single-exec/00012.c.otags new file mode 100644 index 0000000..cf66993 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00012.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0012-expr.c diff --git a/test/regress/c-testsuite/single-exec/00012.c.tags b/test/regress/c-testsuite/single-exec/00012.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00012.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00013.c b/test/regress/c-testsuite/single-exec/00013.c new file mode 100644 index 0000000..87a9b5c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00013.c @@ -0,0 +1,10 @@ +int +main() +{ + int x; + int *p; + + x = 0; + p = &x; + return p[0]; +} diff --git a/test/regress/c-testsuite/single-exec/00013.c.expected b/test/regress/c-testsuite/single-exec/00013.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00013.c.otags b/test/regress/c-testsuite/single-exec/00013.c.otags new file mode 100644 index 0000000..7b03b72 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00013.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0013-addridx.c diff --git a/test/regress/c-testsuite/single-exec/00013.c.tags b/test/regress/c-testsuite/single-exec/00013.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00013.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00014.c b/test/regress/c-testsuite/single-exec/00014.c new file mode 100644 index 0000000..487b3de --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00014.c @@ -0,0 +1,11 @@ +int +main() +{ + int x; + int *p; + + x = 1; + p = &x; + p[0] = 0; + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00014.c.expected b/test/regress/c-testsuite/single-exec/00014.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00014.c.otags b/test/regress/c-testsuite/single-exec/00014.c.otags new file mode 100644 index 0000000..a4eaf98 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00014.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0014-assignidx.c diff --git a/test/regress/c-testsuite/single-exec/00014.c.tags b/test/regress/c-testsuite/single-exec/00014.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00014.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00015.c b/test/regress/c-testsuite/single-exec/00015.c new file mode 100644 index 0000000..829f2e4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00015.c @@ -0,0 +1,10 @@ +int +main() +{ + int arr[2]; + + arr[0] = 1; + arr[1] = 2; + + return arr[0] + arr[1] - 3; +} diff --git a/test/regress/c-testsuite/single-exec/00015.c.expected b/test/regress/c-testsuite/single-exec/00015.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00015.c.otags b/test/regress/c-testsuite/single-exec/00015.c.otags new file mode 100644 index 0000000..8d5386c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00015.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0015-localarray.c diff --git a/test/regress/c-testsuite/single-exec/00015.c.tags b/test/regress/c-testsuite/single-exec/00015.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00015.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00016.c b/test/regress/c-testsuite/single-exec/00016.c new file mode 100644 index 0000000..9db7edb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00016.c @@ -0,0 +1,10 @@ +int +main() +{ + int arr[2]; + int *p; + + p = &arr[1]; + *p = 0; + return arr[1]; +} diff --git a/test/regress/c-testsuite/single-exec/00016.c.expected b/test/regress/c-testsuite/single-exec/00016.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00016.c.otags b/test/regress/c-testsuite/single-exec/00016.c.otags new file mode 100644 index 0000000..5f98d5a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00016.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0016-addrarray.c diff --git a/test/regress/c-testsuite/single-exec/00016.c.tags b/test/regress/c-testsuite/single-exec/00016.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00016.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00017.c b/test/regress/c-testsuite/single-exec/00017.c new file mode 100644 index 0000000..af4e2c2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00017.c @@ -0,0 +1,9 @@ +int +main() +{ + struct { int x; int y; } s; + + s.x = 3; + s.y = 5; + return s.y - s.x - 2; +} diff --git a/test/regress/c-testsuite/single-exec/00017.c.expected b/test/regress/c-testsuite/single-exec/00017.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00017.c.otags b/test/regress/c-testsuite/single-exec/00017.c.otags new file mode 100644 index 0000000..ecbec72 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00017.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0017-struct.c diff --git a/test/regress/c-testsuite/single-exec/00017.c.tags b/test/regress/c-testsuite/single-exec/00017.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00017.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00018.c b/test/regress/c-testsuite/single-exec/00018.c new file mode 100644 index 0000000..6777a7c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00018.c @@ -0,0 +1,13 @@ +int +main() +{ + + struct S { int x; int y; } s; + struct S *p; + + p = &s; + s.x = 1; + p->y = 2; + return p->y + p->x - 3; +} + diff --git a/test/regress/c-testsuite/single-exec/00018.c.expected b/test/regress/c-testsuite/single-exec/00018.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00018.c.otags b/test/regress/c-testsuite/single-exec/00018.c.otags new file mode 100644 index 0000000..359191d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00018.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0018-structptr.c diff --git a/test/regress/c-testsuite/single-exec/00018.c.tags b/test/regress/c-testsuite/single-exec/00018.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00018.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00019.c b/test/regress/c-testsuite/single-exec/00019.c new file mode 100644 index 0000000..9383c2f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00019.c @@ -0,0 +1,10 @@ +int +main() +{ + struct S { struct S *p; int x; } s; + + s.x = 0; + s.p = &s; + return s.p->p->p->p->p->x; +} + diff --git a/test/regress/c-testsuite/single-exec/00019.c.expected b/test/regress/c-testsuite/single-exec/00019.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00019.c.otags b/test/regress/c-testsuite/single-exec/00019.c.otags new file mode 100644 index 0000000..5c42e0d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00019.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0019-selfrefstruct.c diff --git a/test/regress/c-testsuite/single-exec/00019.c.tags b/test/regress/c-testsuite/single-exec/00019.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00019.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00020.c b/test/regress/c-testsuite/single-exec/00020.c new file mode 100644 index 0000000..a7e5bee --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00020.c @@ -0,0 +1,10 @@ +int +main() +{ + int x, *p, **pp; + + x = 0; + p = &x; + pp = &p; + return **pp; +} diff --git a/test/regress/c-testsuite/single-exec/00020.c.expected b/test/regress/c-testsuite/single-exec/00020.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00020.c.otags b/test/regress/c-testsuite/single-exec/00020.c.otags new file mode 100644 index 0000000..cf44548 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00020.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0020-ptrptr.c diff --git a/test/regress/c-testsuite/single-exec/00020.c.tags b/test/regress/c-testsuite/single-exec/00020.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00020.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00021.c b/test/regress/c-testsuite/single-exec/00021.c new file mode 100644 index 0000000..a49cd78 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00021.c @@ -0,0 +1,12 @@ +int +foo(int a, int b) +{ + return 2 + a - b; +} + +int +main() +{ + return foo(1, 3); +} + diff --git a/test/regress/c-testsuite/single-exec/00021.c.expected b/test/regress/c-testsuite/single-exec/00021.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00021.c.otags b/test/regress/c-testsuite/single-exec/00021.c.otags new file mode 100644 index 0000000..abe0f16 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00021.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0021-intfunc.c diff --git a/test/regress/c-testsuite/single-exec/00021.c.tags b/test/regress/c-testsuite/single-exec/00021.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00021.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00022.c b/test/regress/c-testsuite/single-exec/00022.c new file mode 100644 index 0000000..5ecca98 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00022.c @@ -0,0 +1,10 @@ +typedef int x; + +int +main() +{ + x v; + v = 0; + return v; +} + diff --git a/test/regress/c-testsuite/single-exec/00022.c.expected b/test/regress/c-testsuite/single-exec/00022.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00022.c.otags b/test/regress/c-testsuite/single-exec/00022.c.otags new file mode 100644 index 0000000..a5ee0e4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00022.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0022-typedef.c diff --git a/test/regress/c-testsuite/single-exec/00022.c.tags b/test/regress/c-testsuite/single-exec/00022.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00022.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00023.c b/test/regress/c-testsuite/single-exec/00023.c new file mode 100644 index 0000000..0fadbd8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00023.c @@ -0,0 +1,9 @@ +int x; + +int +main() +{ + x = 0; + return x; +} + diff --git a/test/regress/c-testsuite/single-exec/00023.c.expected b/test/regress/c-testsuite/single-exec/00023.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00023.c.otags b/test/regress/c-testsuite/single-exec/00023.c.otags new file mode 100644 index 0000000..0c9b127 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00023.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0023-global.c diff --git a/test/regress/c-testsuite/single-exec/00023.c.tags b/test/regress/c-testsuite/single-exec/00023.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00023.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00024.c b/test/regress/c-testsuite/single-exec/00024.c new file mode 100644 index 0000000..405ea86 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00024.c @@ -0,0 +1,12 @@ +typedef struct { int x; int y; } s; + +s v; + +int +main() +{ + v.x = 1; + v.y = 2; + return 3 - v.x - v.y; +} + diff --git a/test/regress/c-testsuite/single-exec/00024.c.expected b/test/regress/c-testsuite/single-exec/00024.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00024.c.otags b/test/regress/c-testsuite/single-exec/00024.c.otags new file mode 100644 index 0000000..a03d57d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00024.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0024-typedefstruct.c diff --git a/test/regress/c-testsuite/single-exec/00024.c.tags b/test/regress/c-testsuite/single-exec/00024.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00024.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00025.c b/test/regress/c-testsuite/single-exec/00025.c new file mode 100644 index 0000000..cee08c5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00025.c @@ -0,0 +1,10 @@ +int strlen(char *); + +int +main() +{ + char *p; + + p = "hello"; + return strlen(p) - 5; +} diff --git a/test/regress/c-testsuite/single-exec/00025.c.expected b/test/regress/c-testsuite/single-exec/00025.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00025.c.otags b/test/regress/c-testsuite/single-exec/00025.c.otags new file mode 100644 index 0000000..900842e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00025.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0025-string.c diff --git a/test/regress/c-testsuite/single-exec/00025.c.tags b/test/regress/c-testsuite/single-exec/00025.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00025.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00026.c b/test/regress/c-testsuite/single-exec/00026.c new file mode 100644 index 0000000..62c747e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00026.c @@ -0,0 +1,8 @@ +int +main() +{ + char *p; + + p = "hello"; + return p[0] - 104; +} diff --git a/test/regress/c-testsuite/single-exec/00026.c.expected b/test/regress/c-testsuite/single-exec/00026.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00026.c.otags b/test/regress/c-testsuite/single-exec/00026.c.otags new file mode 100644 index 0000000..f3ebe1a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00026.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0027-charval.c diff --git a/test/regress/c-testsuite/single-exec/00026.c.tags b/test/regress/c-testsuite/single-exec/00026.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00026.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00027.c b/test/regress/c-testsuite/single-exec/00027.c new file mode 100644 index 0000000..3ee7bfe --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00027.c @@ -0,0 +1,10 @@ +int +main() +{ + int x; + + x = 1; + x = x | 4; + return x - 5; +} + diff --git a/test/regress/c-testsuite/single-exec/00027.c.expected b/test/regress/c-testsuite/single-exec/00027.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00027.c.otags b/test/regress/c-testsuite/single-exec/00027.c.otags new file mode 100644 index 0000000..fe37929 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00027.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0028-bor.c diff --git a/test/regress/c-testsuite/single-exec/00027.c.tags b/test/regress/c-testsuite/single-exec/00027.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00027.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00028.c b/test/regress/c-testsuite/single-exec/00028.c new file mode 100644 index 0000000..cb10630 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00028.c @@ -0,0 +1,10 @@ +int +main() +{ + int x; + + x = 1; + x = x & 3; + return x - 1; +} + diff --git a/test/regress/c-testsuite/single-exec/00028.c.expected b/test/regress/c-testsuite/single-exec/00028.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00028.c.otags b/test/regress/c-testsuite/single-exec/00028.c.otags new file mode 100644 index 0000000..866dea8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00028.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0029-band.c diff --git a/test/regress/c-testsuite/single-exec/00028.c.tags b/test/regress/c-testsuite/single-exec/00028.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00028.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00029.c b/test/regress/c-testsuite/single-exec/00029.c new file mode 100644 index 0000000..74180cb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00029.c @@ -0,0 +1,10 @@ +int +main() +{ + int x; + + x = 1; + x = x ^ 3; + return x - 2; +} + diff --git a/test/regress/c-testsuite/single-exec/00029.c.expected b/test/regress/c-testsuite/single-exec/00029.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00029.c.otags b/test/regress/c-testsuite/single-exec/00029.c.otags new file mode 100644 index 0000000..77966d6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00029.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0030-bxor.c diff --git a/test/regress/c-testsuite/single-exec/00029.c.tags b/test/regress/c-testsuite/single-exec/00029.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00029.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00030.c b/test/regress/c-testsuite/single-exec/00030.c new file mode 100644 index 0000000..5b4001f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00030.c @@ -0,0 +1,24 @@ +int +f() +{ + return 100; +} + +int +main() +{ + if (f() > 1000) + return 1; + if (f() >= 1000) + return 1; + if (1000 < f()) + return 1; + if (1000 <= f()) + return 1; + if (1000 == f()) + return 1; + if (100 != f()) + return 1; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00030.c.expected b/test/regress/c-testsuite/single-exec/00030.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00030.c.otags b/test/regress/c-testsuite/single-exec/00030.c.otags new file mode 100644 index 0000000..2b151e8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00030.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0031-relop.c diff --git a/test/regress/c-testsuite/single-exec/00030.c.tags b/test/regress/c-testsuite/single-exec/00030.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00030.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00031.c b/test/regress/c-testsuite/single-exec/00031.c new file mode 100644 index 0000000..09b43ce --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00031.c @@ -0,0 +1,48 @@ +int +zero() +{ + return 0; +} + +int +one() +{ + return 1; +} + +int +main() +{ + int x; + int y; + + x = zero(); + y = ++x; + if (x != 1) + return 1; + if (y != 1) + return 1; + + x = one(); + y = --x; + if (x != 0) + return 1; + if (y != 0) + return 1; + + x = zero(); + y = x++; + if (x != 1) + return 1; + if (y != 0) + return 1; + + x = one(); + y = x--; + if (x != 0) + return 1; + if (y != 1) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00031.c.expected b/test/regress/c-testsuite/single-exec/00031.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00031.c.otags b/test/regress/c-testsuite/single-exec/00031.c.otags new file mode 100644 index 0000000..b94e2ec --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00031.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0032-indec.c diff --git a/test/regress/c-testsuite/single-exec/00031.c.tags b/test/regress/c-testsuite/single-exec/00031.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00031.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00032.c b/test/regress/c-testsuite/single-exec/00032.c new file mode 100644 index 0000000..bc606ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00032.c @@ -0,0 +1,30 @@ +int +main() +{ + int arr[2]; + int *p; + + arr[0] = 2; + arr[1] = 3; + p = &arr[0]; + if(*(p++) != 2) + return 1; + if(*(p++) != 3) + return 2; + + p = &arr[1]; + if(*(p--) != 3) + return 1; + if(*(p--) != 2) + return 2; + + p = &arr[0]; + if(*(++p) != 3) + return 1; + + p = &arr[1]; + if(*(--p) != 2) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00032.c.expected b/test/regress/c-testsuite/single-exec/00032.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00032.c.otags b/test/regress/c-testsuite/single-exec/00032.c.otags new file mode 100644 index 0000000..d0e6ac1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00032.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0033-ptrindec.c diff --git a/test/regress/c-testsuite/single-exec/00032.c.tags b/test/regress/c-testsuite/single-exec/00032.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00032.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00033.c b/test/regress/c-testsuite/single-exec/00033.c new file mode 100644 index 0000000..cfc26f6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00033.c @@ -0,0 +1,45 @@ +int g; + +int +effect() +{ + g = 1; + return 1; +} + +int +main() +{ + int x; + + g = 0; + x = 0; + if(x && effect()) + return 1; + if(g) + return 2; + x = 1; + if(x && effect()) { + if(g != 1) + return 3; + } else { + return 4; + } + g = 0; + x = 1; + if(x || effect()) { + if(g) + return 5; + } else { + return 6; + } + x = 0; + if(x || effect()) { + if(g != 1) + return 7; + } else { + return 8; + } + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00033.c.expected b/test/regress/c-testsuite/single-exec/00033.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00033.c.otags b/test/regress/c-testsuite/single-exec/00033.c.otags new file mode 100644 index 0000000..941135d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00033.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0034-logandor.c diff --git a/test/regress/c-testsuite/single-exec/00033.c.tags b/test/regress/c-testsuite/single-exec/00033.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00033.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00034.c b/test/regress/c-testsuite/single-exec/00034.c new file mode 100644 index 0000000..891d5f8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00034.c @@ -0,0 +1,32 @@ +int +main() +{ + int x; + + x = 0; + while(1) + break; + while(1) { + if (x == 5) { + break; + } + x = x + 1; + continue; + } + for (;;) { + if (x == 10) { + break; + } + x = x + 1; + continue; + } + do { + if (x == 15) { + break; + } + x = x + 1; + continue; + } while(1); + return x - 15; +} + diff --git a/test/regress/c-testsuite/single-exec/00034.c.expected b/test/regress/c-testsuite/single-exec/00034.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00034.c.otags b/test/regress/c-testsuite/single-exec/00034.c.otags new file mode 100644 index 0000000..48ac03a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00034.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0035-breakcont.c diff --git a/test/regress/c-testsuite/single-exec/00034.c.tags b/test/regress/c-testsuite/single-exec/00034.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00034.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00035.c b/test/regress/c-testsuite/single-exec/00035.c new file mode 100644 index 0000000..e8bf709 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00035.c @@ -0,0 +1,15 @@ +int +main() +{ + int x; + + x = 4; + if(!x != 0) + return 1; + if(!!x != 1) + return 1; + if(-x != 0 - 4) + return 1; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00035.c.expected b/test/regress/c-testsuite/single-exec/00035.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00035.c.otags b/test/regress/c-testsuite/single-exec/00035.c.otags new file mode 100644 index 0000000..b39f8d9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00035.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0036-notneg.c diff --git a/test/regress/c-testsuite/single-exec/00035.c.tags b/test/regress/c-testsuite/single-exec/00035.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00035.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00036.c b/test/regress/c-testsuite/single-exec/00036.c new file mode 100644 index 0000000..f0f4583 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00036.c @@ -0,0 +1,19 @@ +int +main() +{ + int x; + + x = 0; + x += 2; + x += 2; + if (x != 4) + return 1; + x -= 1; + if (x != 3) + return 2; + x *= 2; + if (x != 6) + return 3; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00036.c.expected b/test/regress/c-testsuite/single-exec/00036.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00036.c.otags b/test/regress/c-testsuite/single-exec/00036.c.otags new file mode 100644 index 0000000..fc692ee --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00036.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0037-assignop.c diff --git a/test/regress/c-testsuite/single-exec/00036.c.tags b/test/regress/c-testsuite/single-exec/00036.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00036.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00037.c b/test/regress/c-testsuite/single-exec/00037.c new file mode 100644 index 0000000..a353946 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00037.c @@ -0,0 +1,17 @@ +int +main() +{ + int x[2]; + int *p; + + x[1] = 7; + p = &x[0]; + p = p + 1; + + if(*p != 7) + return 1; + if(&x[1] - &x[0] != 1) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00037.c.expected b/test/regress/c-testsuite/single-exec/00037.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00037.c.otags b/test/regress/c-testsuite/single-exec/00037.c.otags new file mode 100644 index 0000000..10a6610 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00037.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0038-ptradd.c diff --git a/test/regress/c-testsuite/single-exec/00037.c.tags b/test/regress/c-testsuite/single-exec/00037.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00037.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00038.c b/test/regress/c-testsuite/single-exec/00038.c new file mode 100644 index 0000000..35b23f4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00038.c @@ -0,0 +1,17 @@ +int +main() +{ + int x, *p; + + if (sizeof(0) < 2) + return 1; + if (sizeof 0 < 2) + return 1; + if (sizeof(char) < 1) + return 1; + if (sizeof(int) - 2 < 0) + return 1; + if (sizeof(&x) != sizeof p) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00038.c.expected b/test/regress/c-testsuite/single-exec/00038.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00038.c.otags b/test/regress/c-testsuite/single-exec/00038.c.otags new file mode 100644 index 0000000..3692a3f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00038.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0039-sizeof.c diff --git a/test/regress/c-testsuite/single-exec/00038.c.tags b/test/regress/c-testsuite/single-exec/00038.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00038.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00039.c b/test/regress/c-testsuite/single-exec/00039.c new file mode 100644 index 0000000..cc6b2e6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00039.c @@ -0,0 +1,13 @@ +int +main() +{ + void *p; + int x; + + x = 2; + p = &x; + + if(*((int*)p) != 2) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00039.c.expected b/test/regress/c-testsuite/single-exec/00039.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00039.c.otags b/test/regress/c-testsuite/single-exec/00039.c.otags new file mode 100644 index 0000000..76c7056 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00039.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0040-cast.c diff --git a/test/regress/c-testsuite/single-exec/00039.c.tags b/test/regress/c-testsuite/single-exec/00039.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00039.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00040.c b/test/regress/c-testsuite/single-exec/00040.c new file mode 100644 index 0000000..819dc9c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00040.c @@ -0,0 +1,55 @@ +#include + +int N; +int *t; + +int +chk(int x, int y) +{ + int i; + int r; + + for (r=i=0; i<8; i++) { + r = r + t[x + 8*i]; + r = r + t[i + 8*y]; + if (x+i < 8 & y+i < 8) + r = r + t[x+i + 8*(y+i)]; + if (x+i < 8 & y-i >= 0) + r = r + t[x+i + 8*(y-i)]; + if (x-i >= 0 & y+i < 8) + r = r + t[x-i + 8*(y+i)]; + if (x-i >= 0 & y-i >= 0) + r = r + t[x-i + 8*(y-i)]; + } + return r; +} + +int +go(int n, int x, int y) +{ + if (n == 8) { + N++; + return 0; + } + for (; y<8; y++) { + for (; x<8; x++) + if (chk(x, y) == 0) { + t[x + 8*y]++; + go(n+1, x, y); + t[x + 8*y]--; + } + x = 0; + } + return 0; +} + +int +main() +{ + t = calloc(64, sizeof(int)); + go(0, 0, 0); + if(N != 92) + return 1; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00040.c.expected b/test/regress/c-testsuite/single-exec/00040.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00040.c.otags b/test/regress/c-testsuite/single-exec/00040.c.otags new file mode 100644 index 0000000..752c24e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00040.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0041-queen.c diff --git a/test/regress/c-testsuite/single-exec/00040.c.tags b/test/regress/c-testsuite/single-exec/00040.c.tags new file mode 100644 index 0000000..ad96bdf --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00040.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-libc diff --git a/test/regress/c-testsuite/single-exec/00041.c b/test/regress/c-testsuite/single-exec/00041.c new file mode 100644 index 0000000..d240d10 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00041.c @@ -0,0 +1,26 @@ +int +main() { + int n; + int t; + int c; + int p; + + c = 0; + n = 2; + while (n < 5000) { + t = 2; + p = 1; + while (t*t <= n) { + if (n % t == 0) + p = 0; + t++; + } + n++; + if (p) + c++; + } + if (c != 669) + return 1; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00041.c.expected b/test/regress/c-testsuite/single-exec/00041.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00041.c.otags b/test/regress/c-testsuite/single-exec/00041.c.otags new file mode 100644 index 0000000..18ea9d7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00041.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0042-prime.c diff --git a/test/regress/c-testsuite/single-exec/00041.c.tags b/test/regress/c-testsuite/single-exec/00041.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00041.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00042.c b/test/regress/c-testsuite/single-exec/00042.c new file mode 100644 index 0000000..8b2b209 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00042.c @@ -0,0 +1,11 @@ +int +main() +{ + union { int a; int b; } u; + u.a = 1; + u.b = 3; + + if (u.a != 3 || u.b != 3) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00042.c.expected b/test/regress/c-testsuite/single-exec/00042.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00042.c.otags b/test/regress/c-testsuite/single-exec/00042.c.otags new file mode 100644 index 0000000..15c5a08 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00042.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0043-union.c diff --git a/test/regress/c-testsuite/single-exec/00042.c.tags b/test/regress/c-testsuite/single-exec/00042.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00042.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00043.c b/test/regress/c-testsuite/single-exec/00043.c new file mode 100644 index 0000000..895e55b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00043.c @@ -0,0 +1,19 @@ +struct s { + int x; + struct { + int y; + int z; + } nest; +}; + +int +main() { + struct s v; + v.x = 1; + v.nest.y = 2; + v.nest.z = 3; + if (v.x + v.nest.y + v.nest.z != 6) + return 1; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00043.c.expected b/test/regress/c-testsuite/single-exec/00043.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00043.c.otags b/test/regress/c-testsuite/single-exec/00043.c.otags new file mode 100644 index 0000000..46849bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00043.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0044-struct.c diff --git a/test/regress/c-testsuite/single-exec/00043.c.tags b/test/regress/c-testsuite/single-exec/00043.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00043.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00044.c b/test/regress/c-testsuite/single-exec/00044.c new file mode 100644 index 0000000..418a4a1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00044.c @@ -0,0 +1,16 @@ +struct T; + +struct T { + int x; +}; + +int +main() +{ + struct T v; + { struct T { int z; }; } + v.x = 2; + if(v.x != 2) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00044.c.expected b/test/regress/c-testsuite/single-exec/00044.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00044.c.otags b/test/regress/c-testsuite/single-exec/00044.c.otags new file mode 100644 index 0000000..926d618 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00044.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0045-struct.c diff --git a/test/regress/c-testsuite/single-exec/00044.c.tags b/test/regress/c-testsuite/single-exec/00044.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00044.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00045.c b/test/regress/c-testsuite/single-exec/00045.c new file mode 100644 index 0000000..d6a8d99 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00045.c @@ -0,0 +1,16 @@ +int x = 5; +long y = 6; +int *p = &x; + +int +main() +{ + if (x != 5) + return 1; + if (y != 6) + return 2; + if (*p != 5) + return 3; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00045.c.expected b/test/regress/c-testsuite/single-exec/00045.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00045.c.otags b/test/regress/c-testsuite/single-exec/00045.c.otags new file mode 100644 index 0000000..fdf4b59 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00045.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0046-inits.c diff --git a/test/regress/c-testsuite/single-exec/00045.c.tags b/test/regress/c-testsuite/single-exec/00045.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00045.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00046.c b/test/regress/c-testsuite/single-exec/00046.c new file mode 100644 index 0000000..9ebf52a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00046.c @@ -0,0 +1,33 @@ +typedef struct { + int a; + union { + int b1; + int b2; + }; + struct { union { struct { int c; }; }; }; + struct { + int d; + }; +} s; + +int +main() +{ + s v; + + v.a = 1; + v.b1 = 2; + v.c = 3; + v.d = 4; + + if (v.a != 1) + return 1; + if (v.b1 != 2 && v.b2 != 2) + return 2; + if (v.c != 3) + return 3; + if (v.d != 4) + return 4; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00046.c.expected b/test/regress/c-testsuite/single-exec/00046.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00046.c.otags b/test/regress/c-testsuite/single-exec/00046.c.otags new file mode 100644 index 0000000..334abb0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00046.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0047-anonexport.c diff --git a/test/regress/c-testsuite/single-exec/00046.c.tags b/test/regress/c-testsuite/single-exec/00046.c.tags new file mode 100644 index 0000000..b5a78a0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00046.c.tags @@ -0,0 +1,2 @@ +portable +c11 diff --git a/test/regress/c-testsuite/single-exec/00047.c b/test/regress/c-testsuite/single-exec/00047.c new file mode 100644 index 0000000..56d8e8d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00047.c @@ -0,0 +1,14 @@ +struct { int a; int b; int c; } s = {1, 2, 3}; + +int +main() +{ + if (s.a != 1) + return 1; + if (s.b != 2) + return 2; + if (s.c != 3) + return 3; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00047.c.expected b/test/regress/c-testsuite/single-exec/00047.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00047.c.otags b/test/regress/c-testsuite/single-exec/00047.c.otags new file mode 100644 index 0000000..ac8bc67 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00047.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0048-inits.c diff --git a/test/regress/c-testsuite/single-exec/00047.c.tags b/test/regress/c-testsuite/single-exec/00047.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00047.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00048.c b/test/regress/c-testsuite/single-exec/00048.c new file mode 100644 index 0000000..d9f36d7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00048.c @@ -0,0 +1,12 @@ +struct S {int a; int b;}; +struct S s = { .b = 2, .a = 1}; + +int +main() +{ + if(s.a != 1) + return 1; + if(s.b != 2) + return 2; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00048.c.expected b/test/regress/c-testsuite/single-exec/00048.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00048.c.otags b/test/regress/c-testsuite/single-exec/00048.c.otags new file mode 100644 index 0000000..62ec348 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00048.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0049-inits.c diff --git a/test/regress/c-testsuite/single-exec/00048.c.tags b/test/regress/c-testsuite/single-exec/00048.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00048.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00049.c b/test/regress/c-testsuite/single-exec/00049.c new file mode 100644 index 0000000..432c721 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00049.c @@ -0,0 +1,14 @@ +int x = 10; + +struct S {int a; int *p;}; +struct S s = { .p = &x, .a = 1}; + +int +main() +{ + if(s.a != 1) + return 1; + if(*s.p != 10) + return 2; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00049.c.expected b/test/regress/c-testsuite/single-exec/00049.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00049.c.otags b/test/regress/c-testsuite/single-exec/00049.c.otags new file mode 100644 index 0000000..2e53761 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00049.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0050-inits.c diff --git a/test/regress/c-testsuite/single-exec/00049.c.tags b/test/regress/c-testsuite/single-exec/00049.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00049.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00050.c b/test/regress/c-testsuite/single-exec/00050.c new file mode 100644 index 0000000..42591a1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00050.c @@ -0,0 +1,33 @@ +struct S1 { + int a; + int b; +}; + +struct S2 { + int a; + int b; + union { + int c; + int d; + }; + struct S1 s; +}; + +struct S2 v = {1, 2, 3, {4, 5}}; + +int +main() +{ + if(v.a != 1) + return 1; + if(v.b != 2) + return 2; + if(v.c != 3 || v.d != 3) + return 3; + if(v.s.a != 4) + return 4; + if(v.s.b != 5) + return 5; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00050.c.expected b/test/regress/c-testsuite/single-exec/00050.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00050.c.otags b/test/regress/c-testsuite/single-exec/00050.c.otags new file mode 100644 index 0000000..95119ac --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00050.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0051-inits.c diff --git a/test/regress/c-testsuite/single-exec/00050.c.tags b/test/regress/c-testsuite/single-exec/00050.c.tags new file mode 100644 index 0000000..b5a78a0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00050.c.tags @@ -0,0 +1,2 @@ +portable +c11 diff --git a/test/regress/c-testsuite/single-exec/00051.c b/test/regress/c-testsuite/single-exec/00051.c new file mode 100644 index 0000000..8168ab4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00051.c @@ -0,0 +1,38 @@ +int x = 0; + +int +main() +{ + switch(x) + case 0: + ; + switch(x) + case 0: + switch(x) { + case 0: + goto next; + default: + return 1; + } + return 1; + next: + switch(x) + case 1: + return 1; + switch(x) { + { + x = 1 + 1; + foo: + case 1: + return 1; + } + } + switch(x) { + case 0: + return x; + case 1: + return 1; + default: + return 1; + } +} diff --git a/test/regress/c-testsuite/single-exec/00051.c.expected b/test/regress/c-testsuite/single-exec/00051.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00051.c.otags b/test/regress/c-testsuite/single-exec/00051.c.otags new file mode 100644 index 0000000..a06d5d0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00051.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0052-switch.c diff --git a/test/regress/c-testsuite/single-exec/00051.c.tags b/test/regress/c-testsuite/single-exec/00051.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00051.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00052.c b/test/regress/c-testsuite/single-exec/00052.c new file mode 100644 index 0000000..960fbb0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00052.c @@ -0,0 +1,10 @@ +int +main() +{ + struct T { int x; }; + { + struct T s; + s.x = 0; + return s.x; + } +} diff --git a/test/regress/c-testsuite/single-exec/00052.c.expected b/test/regress/c-testsuite/single-exec/00052.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00052.c.otags b/test/regress/c-testsuite/single-exec/00052.c.otags new file mode 100644 index 0000000..7d9c5f7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00052.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0053-struct.c diff --git a/test/regress/c-testsuite/single-exec/00052.c.tags b/test/regress/c-testsuite/single-exec/00052.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00052.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00053.c b/test/regress/c-testsuite/single-exec/00053.c new file mode 100644 index 0000000..995209c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00053.c @@ -0,0 +1,13 @@ +int +main() +{ + struct T { int x; } s1; + s1.x = 1; + { + struct T { int y; } s2; + s2.y = 1; + if (s1.x - s2.y != 0) + return 1; + } + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00053.c.expected b/test/regress/c-testsuite/single-exec/00053.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00053.c.otags b/test/regress/c-testsuite/single-exec/00053.c.otags new file mode 100644 index 0000000..f032f7c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00053.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0054-struct.c diff --git a/test/regress/c-testsuite/single-exec/00053.c.tags b/test/regress/c-testsuite/single-exec/00053.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00053.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00054.c b/test/regress/c-testsuite/single-exec/00054.c new file mode 100644 index 0000000..d9e76e4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00054.c @@ -0,0 +1,22 @@ +enum E { + x, + y, + z, +}; + +int +main() +{ + enum E e; + + if(x != 0) + return 1; + if(y != 1) + return 2; + if(z != 2) + return 3; + + e = x; + return e; +} + diff --git a/test/regress/c-testsuite/single-exec/00054.c.expected b/test/regress/c-testsuite/single-exec/00054.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00054.c.otags b/test/regress/c-testsuite/single-exec/00054.c.otags new file mode 100644 index 0000000..69b16ce --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00054.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0055-enum.c diff --git a/test/regress/c-testsuite/single-exec/00054.c.tags b/test/regress/c-testsuite/single-exec/00054.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00054.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00055.c b/test/regress/c-testsuite/single-exec/00055.c new file mode 100644 index 0000000..0292124 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00055.c @@ -0,0 +1,22 @@ +enum E { + x, + y = 2, + z, +}; + +int +main() +{ + enum E e; + + if(x != 0) + return 1; + if(y != 2) + return 2; + if(z != 3) + return 3; + + e = x; + return e; +} + diff --git a/test/regress/c-testsuite/single-exec/00055.c.expected b/test/regress/c-testsuite/single-exec/00055.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00055.c.otags b/test/regress/c-testsuite/single-exec/00055.c.otags new file mode 100644 index 0000000..aaca900 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00055.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0056-enum.c diff --git a/test/regress/c-testsuite/single-exec/00055.c.tags b/test/regress/c-testsuite/single-exec/00055.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00055.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00056.c b/test/regress/c-testsuite/single-exec/00056.c new file mode 100644 index 0000000..c96109f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00056.c @@ -0,0 +1,18 @@ +#include + +int main() +{ + int a; + a = 42; + printf("%d\n", a); + + int b = 64; + printf("%d\n", b); + + int c = 12, d = 34; + printf("%d, %d\n", c, d); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00056.c.expected b/test/regress/c-testsuite/single-exec/00056.c.expected new file mode 100644 index 0000000..d4407f3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00056.c.expected @@ -0,0 +1,3 @@ +42 +64 +12, 34 diff --git a/test/regress/c-testsuite/single-exec/00056.c.otags b/test/regress/c-testsuite/single-exec/00056.c.otags new file mode 100644 index 0000000..475574b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00056.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/00_assignment.c diff --git a/test/regress/c-testsuite/single-exec/00056.c.tags b/test/regress/c-testsuite/single-exec/00056.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00056.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00057.c b/test/regress/c-testsuite/single-exec/00057.c new file mode 100644 index 0000000..e3dfef2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00057.c @@ -0,0 +1,9 @@ +int +main() +{ + char a[16], b[16]; + + if(sizeof(a) != sizeof(b)) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00057.c.expected b/test/regress/c-testsuite/single-exec/00057.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00057.c.otags b/test/regress/c-testsuite/single-exec/00057.c.otags new file mode 100644 index 0000000..605ccbc --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00057.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0058-bug.c diff --git a/test/regress/c-testsuite/single-exec/00057.c.tags b/test/regress/c-testsuite/single-exec/00057.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00057.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00058.c b/test/regress/c-testsuite/single-exec/00058.c new file mode 100644 index 0000000..59077df --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00058.c @@ -0,0 +1,15 @@ +int main() +{ + char * s; + + s = "abc" "def"; + if(s[0] != 'a') return 1; + if(s[1] != 'b') return 2; + if(s[2] != 'c') return 3; + if(s[3] != 'd') return 4; + if(s[4] != 'e') return 5; + if(s[5] != 'f') return 6; + if(s[6] != 0) return 7; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00058.c.expected b/test/regress/c-testsuite/single-exec/00058.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00058.c.otags b/test/regress/c-testsuite/single-exec/00058.c.otags new file mode 100644 index 0000000..6890420 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00058.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0059-multistring.c diff --git a/test/regress/c-testsuite/single-exec/00058.c.tags b/test/regress/c-testsuite/single-exec/00058.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00058.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00059.c b/test/regress/c-testsuite/single-exec/00059.c new file mode 100644 index 0000000..d1f7f34 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00059.c @@ -0,0 +1,8 @@ +int +main() +{ + if ('a' != 97) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00059.c.expected b/test/regress/c-testsuite/single-exec/00059.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00059.c.otags b/test/regress/c-testsuite/single-exec/00059.c.otags new file mode 100644 index 0000000..2610b3e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00059.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0060-charlit.c diff --git a/test/regress/c-testsuite/single-exec/00059.c.tags b/test/regress/c-testsuite/single-exec/00059.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00059.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00060.c b/test/regress/c-testsuite/single-exec/00060.c new file mode 100644 index 0000000..d2f5060 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00060.c @@ -0,0 +1,11 @@ +// line comment + +int +main() +{ + /* + multiline + comment + */ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00060.c.expected b/test/regress/c-testsuite/single-exec/00060.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00060.c.otags b/test/regress/c-testsuite/single-exec/00060.c.otags new file mode 100644 index 0000000..080807c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00060.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0061-comments.c diff --git a/test/regress/c-testsuite/single-exec/00060.c.tags b/test/regress/c-testsuite/single-exec/00060.c.tags new file mode 100644 index 0000000..345303b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00060.c.tags @@ -0,0 +1,3 @@ +portable +c99 +needs-cpp \ No newline at end of file diff --git a/test/regress/c-testsuite/single-exec/00061.c b/test/regress/c-testsuite/single-exec/00061.c new file mode 100644 index 0000000..c3abf01 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00061.c @@ -0,0 +1,7 @@ +#define FOO 0 + +int main() +{ + return FOO; +} + diff --git a/test/regress/c-testsuite/single-exec/00061.c.expected b/test/regress/c-testsuite/single-exec/00061.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00061.c.otags b/test/regress/c-testsuite/single-exec/00061.c.otags new file mode 100644 index 0000000..46d76a0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00061.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0063-define.c diff --git a/test/regress/c-testsuite/single-exec/00061.c.tags b/test/regress/c-testsuite/single-exec/00061.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00061.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00062.c b/test/regress/c-testsuite/single-exec/00062.c new file mode 100644 index 0000000..5fa23ef --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00062.c @@ -0,0 +1,25 @@ +#ifdef FOO + XXX +#ifdef BAR + XXX +#endif + XXX +#endif + +#define FOO 1 + +#ifdef FOO + +#ifdef FOO +int x = 0; +#endif + +int +main() +{ + return x; +} +#endif + + + diff --git a/test/regress/c-testsuite/single-exec/00062.c.expected b/test/regress/c-testsuite/single-exec/00062.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00062.c.otags b/test/regress/c-testsuite/single-exec/00062.c.otags new file mode 100644 index 0000000..885fd15 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00062.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0065-ifdef.c diff --git a/test/regress/c-testsuite/single-exec/00062.c.tags b/test/regress/c-testsuite/single-exec/00062.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00062.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00063.c b/test/regress/c-testsuite/single-exec/00063.c new file mode 100644 index 0000000..5020fb2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00063.c @@ -0,0 +1,20 @@ +#define BAR 0 +#ifdef BAR + #ifdef FOO + XXX + #ifdef FOO + XXX + #endif + #else + #define FOO + #ifdef FOO + int x = BAR; + #endif + #endif +#endif + +int +main() +{ + return BAR; +} diff --git a/test/regress/c-testsuite/single-exec/00063.c.expected b/test/regress/c-testsuite/single-exec/00063.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00063.c.otags b/test/regress/c-testsuite/single-exec/00063.c.otags new file mode 100644 index 0000000..b3329c6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00063.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0066-cppelse.c diff --git a/test/regress/c-testsuite/single-exec/00063.c.tags b/test/regress/c-testsuite/single-exec/00063.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00063.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00064.c b/test/regress/c-testsuite/single-exec/00064.c new file mode 100644 index 0000000..2b3d701 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00064.c @@ -0,0 +1,7 @@ +#define X 6 / 2 + +int +main() +{ + return X - 3; +} diff --git a/test/regress/c-testsuite/single-exec/00064.c.expected b/test/regress/c-testsuite/single-exec/00064.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00064.c.otags b/test/regress/c-testsuite/single-exec/00064.c.otags new file mode 100644 index 0000000..35d1ef8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00064.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0067-define.c diff --git a/test/regress/c-testsuite/single-exec/00064.c.tags b/test/regress/c-testsuite/single-exec/00064.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00064.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00065.c b/test/regress/c-testsuite/single-exec/00065.c new file mode 100644 index 0000000..850b6ce --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00065.c @@ -0,0 +1,8 @@ +#define ADD(X, Y) (X + Y) + + +int +main() +{ + return ADD(1, 2) - 3; +} diff --git a/test/regress/c-testsuite/single-exec/00065.c.expected b/test/regress/c-testsuite/single-exec/00065.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00065.c.otags b/test/regress/c-testsuite/single-exec/00065.c.otags new file mode 100644 index 0000000..4663028 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00065.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0068-funclikemacro.c diff --git a/test/regress/c-testsuite/single-exec/00065.c.tags b/test/regress/c-testsuite/single-exec/00065.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00065.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00066.c b/test/regress/c-testsuite/single-exec/00066.c new file mode 100644 index 0000000..f4f787c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00066.c @@ -0,0 +1,11 @@ +#define A 3 +#define FOO(X,Y,Z) X + Y + Z +#define SEMI ; + +int +main() +{ + if(FOO(1, 2, A) != 6) + return 1 SEMI + return FOO(0,0,0); +} diff --git a/test/regress/c-testsuite/single-exec/00066.c.expected b/test/regress/c-testsuite/single-exec/00066.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00066.c.otags b/test/regress/c-testsuite/single-exec/00066.c.otags new file mode 100644 index 0000000..59ddb85 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00066.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0069-funclikemacro.c diff --git a/test/regress/c-testsuite/single-exec/00066.c.tags b/test/regress/c-testsuite/single-exec/00066.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00066.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00067.c b/test/regress/c-testsuite/single-exec/00067.c new file mode 100644 index 0000000..d9ac000 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00067.c @@ -0,0 +1,18 @@ +#if 1 +int x = 0; +#endif + +#if 0 +int x = 1; +#if 1 + X +#endif +#ifndef AAA + X +#endif +#endif + +int main() +{ + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00067.c.expected b/test/regress/c-testsuite/single-exec/00067.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00067.c.otags b/test/regress/c-testsuite/single-exec/00067.c.otags new file mode 100644 index 0000000..2cc5bc6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00067.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0070-cppif.c diff --git a/test/regress/c-testsuite/single-exec/00067.c.tags b/test/regress/c-testsuite/single-exec/00067.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00067.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00068.c b/test/regress/c-testsuite/single-exec/00068.c new file mode 100644 index 0000000..0e28392 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00068.c @@ -0,0 +1,13 @@ +#if 0 +X +#elif 1 +int x = 0; +#else +X +#endif + +int +main() +{ + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00068.c.expected b/test/regress/c-testsuite/single-exec/00068.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00068.c.otags b/test/regress/c-testsuite/single-exec/00068.c.otags new file mode 100644 index 0000000..09e562c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00068.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0071-cppelif.c diff --git a/test/regress/c-testsuite/single-exec/00068.c.tags b/test/regress/c-testsuite/single-exec/00068.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00068.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00069.c b/test/regress/c-testsuite/single-exec/00069.c new file mode 100644 index 0000000..a3ca8ea --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00069.c @@ -0,0 +1,13 @@ +#if 0 +X +#elif 0 +X +#elif 1 +int x = 0; +#endif + +int +main() +{ + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00069.c.expected b/test/regress/c-testsuite/single-exec/00069.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00069.c.otags b/test/regress/c-testsuite/single-exec/00069.c.otags new file mode 100644 index 0000000..f038ad3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00069.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0072-cppelif.c diff --git a/test/regress/c-testsuite/single-exec/00069.c.tags b/test/regress/c-testsuite/single-exec/00069.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00069.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00070.c b/test/regress/c-testsuite/single-exec/00070.c new file mode 100644 index 0000000..b2711fc --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00070.c @@ -0,0 +1,15 @@ +#ifndef DEF +int x = 0; +#endif + +#define DEF + +#ifndef DEF +X +#endif + +int +main() +{ + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00070.c.expected b/test/regress/c-testsuite/single-exec/00070.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00070.c.otags b/test/regress/c-testsuite/single-exec/00070.c.otags new file mode 100644 index 0000000..9887167 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00070.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0073-ifndef.c diff --git a/test/regress/c-testsuite/single-exec/00070.c.tags b/test/regress/c-testsuite/single-exec/00070.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00070.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00071.c b/test/regress/c-testsuite/single-exec/00071.c new file mode 100644 index 0000000..0ff39e9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00071.c @@ -0,0 +1,12 @@ +#define X 1 +#undef X + +#ifdef X +FAIL +#endif + +int +main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00071.c.expected b/test/regress/c-testsuite/single-exec/00071.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00071.c.otags b/test/regress/c-testsuite/single-exec/00071.c.otags new file mode 100644 index 0000000..e491b38 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00071.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0074-undef.c diff --git a/test/regress/c-testsuite/single-exec/00071.c.tags b/test/regress/c-testsuite/single-exec/00071.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00071.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00072.c b/test/regress/c-testsuite/single-exec/00072.c new file mode 100644 index 0000000..172fcc6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00072.c @@ -0,0 +1,14 @@ +int +main() +{ + int arr[2]; + int *p; + + p = &arr[0]; + p += 1; + *p = 123; + + if(arr[1] != 123) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00072.c.expected b/test/regress/c-testsuite/single-exec/00072.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00072.c.otags b/test/regress/c-testsuite/single-exec/00072.c.otags new file mode 100644 index 0000000..8564863 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00072.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0075-ptraddasn.c diff --git a/test/regress/c-testsuite/single-exec/00072.c.tags b/test/regress/c-testsuite/single-exec/00072.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00072.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00073.c b/test/regress/c-testsuite/single-exec/00073.c new file mode 100644 index 0000000..0e8c50c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00073.c @@ -0,0 +1,14 @@ +int +main() +{ + int arr[2]; + int *p; + + p = &arr[1]; + p -= 1; + *p = 123; + + if(arr[0] != 123) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00073.c.expected b/test/regress/c-testsuite/single-exec/00073.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00073.c.otags b/test/regress/c-testsuite/single-exec/00073.c.otags new file mode 100644 index 0000000..fb4221b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00073.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0076-ptrsubasn.c diff --git a/test/regress/c-testsuite/single-exec/00073.c.tags b/test/regress/c-testsuite/single-exec/00073.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00073.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00074.c b/test/regress/c-testsuite/single-exec/00074.c new file mode 100644 index 0000000..706eb74 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00074.c @@ -0,0 +1,32 @@ +#if defined X +X +#endif + +#if defined(X) +X +#endif + +#if X +X +#endif + +#define X 0 + +#if X +X +#endif + +#if defined(X) +int x = 0; +#endif + +#undef X +#define X 1 + +#if X +int +main() +{ + return 0; +} +#endif diff --git a/test/regress/c-testsuite/single-exec/00074.c.expected b/test/regress/c-testsuite/single-exec/00074.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00074.c.otags b/test/regress/c-testsuite/single-exec/00074.c.otags new file mode 100644 index 0000000..25f9e9c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00074.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0077-defined.c diff --git a/test/regress/c-testsuite/single-exec/00074.c.tags b/test/regress/c-testsuite/single-exec/00074.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00074.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00075.c b/test/regress/c-testsuite/single-exec/00075.c new file mode 100644 index 0000000..975b6f6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00075.c @@ -0,0 +1,166 @@ +#if (-2) != -2 +#error fail +#endif + +#if (0 || 0) != 0 +#error fail +#endif + +#if (1 || 0) != 1 +#error fail +#endif + +#if (1 || 1) != 1 +#error fail +#endif + +#if (0 && 0) != 0 +#error fail +#endif + +#if (1 && 0) != 0 +#error fail +#endif + +#if (0 && 1) != 0 +#error fail +#endif + +#if (1 && 1) != 1 +#error fail +#endif + +#if (0xf0 | 1) != 0xf1 +#error fail +#endif + +#if (0xf0 & 1) != 0 +#error fail +#endif + +#if (0xf0 & 0x1f) != 0x10 +#error fail +#endif + +#if (1 ^ 1) != 0 +#error fail +#endif + +#if (1 == 1) != 1 +#error fail +#endif + +#if (1 == 0) != 0 +#error fail +#endif + +#if (1 != 1) != 0 +#error fail +#endif + +#if (0 != 1) != 1 +#error fail +#endif + +#if (0 > 1) != 0 +#error fail +#endif + +#if (0 < 1) != 1 +#error fail +#endif + +#if (0 > -1) != 1 +#error fail +#endif + +#if (0 < -1) != 0 +#error fail +#endif + +#if (0 >= 1) != 0 +#error fail +#endif + +#if (0 <= 1) != 1 +#error fail +#endif + +#if (0 >= -1) != 1 +#error fail +#endif + +#if (0 <= -1) != 0 +#error fail +#endif + +#if (0 < 0) != 0 +#error fail +#endif + +#if (0 <= 0) != 1 +#error fail +#endif + +#if (0 > 0) != 0 +#error fail +#endif + +#if (0 >= 0) != 1 +#error fail +#endif + +#if (1 << 1) != 2 +#error fail +#endif + +#if (2 >> 1) != 1 +#error fail +#endif + +#if (2 + 1) != 3 +#error fail +#endif + +#if (2 - 3) != -1 +#error fail +#endif + +#if (2 * 3) != 6 +#error fail +#endif + +#if (6 / 3) != 2 +#error fail +#endif + +#if (7 % 3) != 1 +#error fail +#endif + +#if (2+2*3+2) != 10 +#error fail +#endif + +#if ((2+2)*(3+2)) != 20 +#error fail +#endif + +#if (2 + 2 + 2 + 2 == 2 + 2 * 3) != 1 +#error fail +#endif + +#if (0 ? 1 : 3) != 3 +#error fail +#endif + +#if (1 ? 3 : 1) != 3 +#error fail +#endif + +int +main() +{ + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00075.c.expected b/test/regress/c-testsuite/single-exec/00075.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00075.c.otags b/test/regress/c-testsuite/single-exec/00075.c.otags new file mode 100644 index 0000000..3a9a419 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00075.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0078-dirifexpr.c diff --git a/test/regress/c-testsuite/single-exec/00075.c.tags b/test/regress/c-testsuite/single-exec/00075.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00075.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00076.c b/test/regress/c-testsuite/single-exec/00076.c new file mode 100644 index 0000000..c5c4f23 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00076.c @@ -0,0 +1,9 @@ +int +main() +{ + if(0 ? 1 : 0) + return 1; + if(1 ? 0 : 1) + return 2; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00076.c.expected b/test/regress/c-testsuite/single-exec/00076.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00076.c.otags b/test/regress/c-testsuite/single-exec/00076.c.otags new file mode 100644 index 0000000..bc9ef85 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00076.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0079-cond.c diff --git a/test/regress/c-testsuite/single-exec/00076.c.tags b/test/regress/c-testsuite/single-exec/00076.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00076.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00077.c b/test/regress/c-testsuite/single-exec/00077.c new file mode 100644 index 0000000..20792fe --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00077.c @@ -0,0 +1,48 @@ +int +foo(int x[100]) +{ + int y[100]; + int *p; + + y[0] = 2000; + + if(x[0] != 1000) + { + return 1; + } + + p = x; + + if(p[0] != 1000) + { + return 2; + } + + p = y; + + if(p[0] != 2000) + { + return 3; + } + + if(sizeof(x) != sizeof(void*)) + { + return 4; + } + + if(sizeof(y) <= sizeof(x)) + { + return 5; + } + + return 0; +} + +int +main() +{ + int x[100]; + x[0] = 1000; + + return foo(x); +} diff --git a/test/regress/c-testsuite/single-exec/00077.c.expected b/test/regress/c-testsuite/single-exec/00077.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00077.c.otags b/test/regress/c-testsuite/single-exec/00077.c.otags new file mode 100644 index 0000000..853610d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00077.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0080-arrays.c diff --git a/test/regress/c-testsuite/single-exec/00077.c.tags b/test/regress/c-testsuite/single-exec/00077.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00077.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00078.c b/test/regress/c-testsuite/single-exec/00078.c new file mode 100644 index 0000000..86c290d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00078.c @@ -0,0 +1,17 @@ +int +f1(char *p) +{ + return *p+1; +} + +int +main() +{ + char s = 1; + int v[1000]; + int f1(char *); + + if (f1(&s) != 2) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00078.c.expected b/test/regress/c-testsuite/single-exec/00078.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00078.c.otags b/test/regress/c-testsuite/single-exec/00078.c.otags new file mode 100644 index 0000000..9665f84 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00078.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0081-calls.c diff --git a/test/regress/c-testsuite/single-exec/00078.c.tags b/test/regress/c-testsuite/single-exec/00078.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00078.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00079.c b/test/regress/c-testsuite/single-exec/00079.c new file mode 100644 index 0000000..ad0af76 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00079.c @@ -0,0 +1,17 @@ +#define x(y) ((y) + 1) + +int +main() +{ + int x; + int y; + + y = 0; + x = x(y); + + if(x != 1) + return 1; + + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00079.c.expected b/test/regress/c-testsuite/single-exec/00079.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00079.c.otags b/test/regress/c-testsuite/single-exec/00079.c.otags new file mode 100644 index 0000000..ecb303a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00079.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0082-bug.c diff --git a/test/regress/c-testsuite/single-exec/00079.c.tags b/test/regress/c-testsuite/single-exec/00079.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00079.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00080.c b/test/regress/c-testsuite/single-exec/00080.c new file mode 100644 index 0000000..2c15f49 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00080.c @@ -0,0 +1,12 @@ +void +voidfn() +{ + return; +} + +int +main() +{ + voidfn(); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00080.c.expected b/test/regress/c-testsuite/single-exec/00080.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00080.c.otags b/test/regress/c-testsuite/single-exec/00080.c.otags new file mode 100644 index 0000000..ac340a6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00080.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0083-voidret.c diff --git a/test/regress/c-testsuite/single-exec/00080.c.tags b/test/regress/c-testsuite/single-exec/00080.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00080.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00081.c b/test/regress/c-testsuite/single-exec/00081.c new file mode 100644 index 0000000..45eb13c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00081.c @@ -0,0 +1,11 @@ +int +main() +{ + long long x; + + x = 0; + x = x + 1; + if (x != 1) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00081.c.expected b/test/regress/c-testsuite/single-exec/00081.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00081.c.otags b/test/regress/c-testsuite/single-exec/00081.c.otags new file mode 100644 index 0000000..e90a4ee --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00081.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0084-longlong.c diff --git a/test/regress/c-testsuite/single-exec/00081.c.tags b/test/regress/c-testsuite/single-exec/00081.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00081.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00082.c b/test/regress/c-testsuite/single-exec/00082.c new file mode 100644 index 0000000..6950858 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00082.c @@ -0,0 +1,11 @@ +int +main() +{ + unsigned long long x; + + x = 0; + x = x + 1; + if (x != 1) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00082.c.expected b/test/regress/c-testsuite/single-exec/00082.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00082.c.otags b/test/regress/c-testsuite/single-exec/00082.c.otags new file mode 100644 index 0000000..a0f9a45 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00082.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0085-ulonglong.c diff --git a/test/regress/c-testsuite/single-exec/00082.c.tags b/test/regress/c-testsuite/single-exec/00082.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00082.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00083.c b/test/regress/c-testsuite/single-exec/00083.c new file mode 100644 index 0000000..bf85784 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00083.c @@ -0,0 +1,47 @@ +#define CALL(FUN, ...) FUN(__VA_ARGS__) + +int +one(int a) +{ + if (a != 1) + return 1; + + return 0; +} + +int +two(int a, int b) +{ + if (a != 1) + return 1; + if (b != 2) + return 1; + + return 0; +} + +int +three(int a, int b, int c) +{ + if (a != 1) + return 1; + if (b != 2) + return 1; + if (c != 3) + return 1; + + return 0; +} + +int +main() +{ + if (CALL(one, 1)) + return 2; + if (CALL(two, 1, 2)) + return 3; + if (CALL(three, 1, 2, 3)) + return 4; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00083.c.expected b/test/regress/c-testsuite/single-exec/00083.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00083.c.otags b/test/regress/c-testsuite/single-exec/00083.c.otags new file mode 100644 index 0000000..f54ea5b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00083.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0086-variadic.c diff --git a/test/regress/c-testsuite/single-exec/00083.c.tags b/test/regress/c-testsuite/single-exec/00083.c.tags new file mode 100644 index 0000000..f7c08bd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00083.c.tags @@ -0,0 +1,3 @@ +portable +c99 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00084.c b/test/regress/c-testsuite/single-exec/00084.c new file mode 100644 index 0000000..cfd0fac --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00084.c @@ -0,0 +1,54 @@ +#define ARGS(...) __VA_ARGS__ + +int +none() +{ + return 0; +} + +int +one(int a) +{ + if (a != 1) + return 1; + + return 0; +} + +int +two(int a, int b) +{ + if (a != 1) + return 1; + if (b != 2) + return 1; + + return 0; +} + +int +three(int a, int b, int c) +{ + if (a != 1) + return 1; + if (b != 2) + return 1; + if (c != 3) + return 1; + + return 0; +} + +int +main() +{ + if (none(ARGS())) + return 1; + if (one(ARGS(1))) + return 2; + if (two(ARGS(1, 2))) + return 3; + if (three(ARGS(1, 2, 3))) + return 4; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00084.c.expected b/test/regress/c-testsuite/single-exec/00084.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00084.c.otags b/test/regress/c-testsuite/single-exec/00084.c.otags new file mode 100644 index 0000000..ef28153 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00084.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0087-variadic.c diff --git a/test/regress/c-testsuite/single-exec/00084.c.tags b/test/regress/c-testsuite/single-exec/00084.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00084.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00085.c b/test/regress/c-testsuite/single-exec/00085.c new file mode 100644 index 0000000..37156ea --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00085.c @@ -0,0 +1,26 @@ +#define ZERO_0() 0 +#define ZERO_1(A) 0 +#define ZERO_2(A, B) 0 +#define ZERO_VAR(...) 0 +#define ZERO_1_VAR(A, ...) 0 + +int +main() +{ + if (ZERO_0()) + return 1; + if (ZERO_1(1)) + return 1; + if (ZERO_2(1, 2)) + return 1; + if (ZERO_VAR(1)) + return 1; + if (ZERO_VAR(1, 2)) + return 1; + if (ZERO_1_VAR(1, 2)) + return 1; + if (ZERO_1_VAR(1, 2, 3)) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00085.c.expected b/test/regress/c-testsuite/single-exec/00085.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00085.c.otags b/test/regress/c-testsuite/single-exec/00085.c.otags new file mode 100644 index 0000000..628f3a0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00085.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0088-macros.c diff --git a/test/regress/c-testsuite/single-exec/00085.c.tags b/test/regress/c-testsuite/single-exec/00085.c.tags new file mode 100644 index 0000000..f7c08bd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00085.c.tags @@ -0,0 +1,3 @@ +portable +c99 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00086.c b/test/regress/c-testsuite/single-exec/00086.c new file mode 100644 index 0000000..0173773 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00086.c @@ -0,0 +1,11 @@ +int +main() +{ + short x; + + x = 0; + x = x + 1; + if (x != 1) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00086.c.expected b/test/regress/c-testsuite/single-exec/00086.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00086.c.otags b/test/regress/c-testsuite/single-exec/00086.c.otags new file mode 100644 index 0000000..5758c48 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00086.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0089-short.c diff --git a/test/regress/c-testsuite/single-exec/00086.c.tags b/test/regress/c-testsuite/single-exec/00086.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00086.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00087.c b/test/regress/c-testsuite/single-exec/00087.c new file mode 100644 index 0000000..d045edb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00087.c @@ -0,0 +1,20 @@ +struct S +{ + int (*fptr)(); +}; + +int +foo() +{ + return 0; +} + +int +main() +{ + struct S v; + + v.fptr = foo; + return v.fptr(); +} + diff --git a/test/regress/c-testsuite/single-exec/00087.c.expected b/test/regress/c-testsuite/single-exec/00087.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00087.c.otags b/test/regress/c-testsuite/single-exec/00087.c.otags new file mode 100644 index 0000000..ae0ff5b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00087.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0090-fptr.c diff --git a/test/regress/c-testsuite/single-exec/00087.c.tags b/test/regress/c-testsuite/single-exec/00087.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00087.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00088.c b/test/regress/c-testsuite/single-exec/00088.c new file mode 100644 index 0000000..f385cbc --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00088.c @@ -0,0 +1,11 @@ +int (*fptr)() = 0; + + +int +main() +{ + if (fptr) + return 1; + return 0; +} + diff --git a/test/regress/c-testsuite/single-exec/00088.c.expected b/test/regress/c-testsuite/single-exec/00088.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00088.c.otags b/test/regress/c-testsuite/single-exec/00088.c.otags new file mode 100644 index 0000000..e42e8a6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00088.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0091-fptr.c diff --git a/test/regress/c-testsuite/single-exec/00088.c.tags b/test/regress/c-testsuite/single-exec/00088.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00088.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00089.c b/test/regress/c-testsuite/single-exec/00089.c new file mode 100644 index 0000000..9331b2d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00089.c @@ -0,0 +1,30 @@ +int +zero() +{ + return 0; +} + +struct S +{ + int (*zerofunc)(); +} s = { &zero }; + +struct S * +anon() +{ + return &s; +} + +typedef struct S * (*fty)(); + +fty +go() +{ + return &anon; +} + +int +main() +{ + return go()()->zerofunc(); +} diff --git a/test/regress/c-testsuite/single-exec/00089.c.expected b/test/regress/c-testsuite/single-exec/00089.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00089.c.otags b/test/regress/c-testsuite/single-exec/00089.c.otags new file mode 100644 index 0000000..131e765 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00089.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0092-fptr.c diff --git a/test/regress/c-testsuite/single-exec/00089.c.tags b/test/regress/c-testsuite/single-exec/00089.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00089.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00090.c b/test/regress/c-testsuite/single-exec/00090.c new file mode 100644 index 0000000..e71a5ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00090.c @@ -0,0 +1,14 @@ +int a[3] = {0, 1, 2}; + +int +main() +{ + if (a[0] != 0) + return 1; + if (a[1] != 1) + return 2; + if (a[2] != 2) + return 3; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00090.c.expected b/test/regress/c-testsuite/single-exec/00090.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00090.c.otags b/test/regress/c-testsuite/single-exec/00090.c.otags new file mode 100644 index 0000000..5828ade --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00090.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0093-arrayinit.c diff --git a/test/regress/c-testsuite/single-exec/00090.c.tags b/test/regress/c-testsuite/single-exec/00090.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00090.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00091.c b/test/regress/c-testsuite/single-exec/00091.c new file mode 100644 index 0000000..a307890 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00091.c @@ -0,0 +1,19 @@ +typedef struct { + int v; + int sub[2]; +} S; + +S a[1] = {{1, {2, 3}}}; + +int +main() +{ + if (a[0].v != 1) + return 1; + if (a[0].sub[0] != 2) + return 2; + if (a[0].sub[1] != 3) + return 3; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00091.c.expected b/test/regress/c-testsuite/single-exec/00091.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00091.c.otags b/test/regress/c-testsuite/single-exec/00091.c.otags new file mode 100644 index 0000000..ed9e969 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00091.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0094-arrayinit.c diff --git a/test/regress/c-testsuite/single-exec/00091.c.tags b/test/regress/c-testsuite/single-exec/00091.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00091.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00092.c b/test/regress/c-testsuite/single-exec/00092.c new file mode 100644 index 0000000..aa78113 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00092.c @@ -0,0 +1,19 @@ +int a[] = {5, [2] = 2, 3}; + +int +main() +{ + if (sizeof(a) != 4*sizeof(int)) + return 1; + + if (a[0] != 5) + return 2; + if (a[1] != 0) + return 3; + if (a[2] != 2) + return 4; + if (a[3] != 3) + return 5; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00092.c.expected b/test/regress/c-testsuite/single-exec/00092.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00092.c.otags b/test/regress/c-testsuite/single-exec/00092.c.otags new file mode 100644 index 0000000..a984206 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00092.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0095-arrayselector.c diff --git a/test/regress/c-testsuite/single-exec/00092.c.tags b/test/regress/c-testsuite/single-exec/00092.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00092.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00093.c b/test/regress/c-testsuite/single-exec/00093.c new file mode 100644 index 0000000..6fb94fb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00093.c @@ -0,0 +1,10 @@ +int a[] = {1, 2, 3, 4}; + +int +main() +{ + if (sizeof(a) != 4*sizeof(int)) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00093.c.expected b/test/regress/c-testsuite/single-exec/00093.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00093.c.otags b/test/regress/c-testsuite/single-exec/00093.c.otags new file mode 100644 index 0000000..fd573f9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00093.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0096-inferredarraysize.c diff --git a/test/regress/c-testsuite/single-exec/00093.c.tags b/test/regress/c-testsuite/single-exec/00093.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00093.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00094.c b/test/regress/c-testsuite/single-exec/00094.c new file mode 100644 index 0000000..b71ada8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00094.c @@ -0,0 +1,6 @@ +extern int x; + +int main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00094.c.expected b/test/regress/c-testsuite/single-exec/00094.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00094.c.otags b/test/regress/c-testsuite/single-exec/00094.c.otags new file mode 100644 index 0000000..746b297 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00094.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0097-extern.c diff --git a/test/regress/c-testsuite/single-exec/00094.c.tags b/test/regress/c-testsuite/single-exec/00094.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00094.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00095.c b/test/regress/c-testsuite/single-exec/00095.c new file mode 100644 index 0000000..ffba25a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00095.c @@ -0,0 +1,22 @@ +int x; +int x = 3; +int x; + +int main(); + +void * +foo() +{ + return &main; +} + +int +main() +{ + if (x != 3) + return 0; + + x = 0; + return x; +} + diff --git a/test/regress/c-testsuite/single-exec/00095.c.expected b/test/regress/c-testsuite/single-exec/00095.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00095.c.otags b/test/regress/c-testsuite/single-exec/00095.c.otags new file mode 100644 index 0000000..e00bbf6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00095.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0098-tentative.c diff --git a/test/regress/c-testsuite/single-exec/00095.c.tags b/test/regress/c-testsuite/single-exec/00095.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00095.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00096.c b/test/regress/c-testsuite/single-exec/00096.c new file mode 100644 index 0000000..1503309 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00096.c @@ -0,0 +1,12 @@ +int x, x = 3, x; + +int +main() +{ + if (x != 3) + return 0; + + x = 0; + return x; +} + diff --git a/test/regress/c-testsuite/single-exec/00096.c.expected b/test/regress/c-testsuite/single-exec/00096.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00096.c.otags b/test/regress/c-testsuite/single-exec/00096.c.otags new file mode 100644 index 0000000..976188d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00096.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0099-tentative.c diff --git a/test/regress/c-testsuite/single-exec/00096.c.tags b/test/regress/c-testsuite/single-exec/00096.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00096.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00097.c b/test/regress/c-testsuite/single-exec/00097.c new file mode 100644 index 0000000..1fbdd83 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00097.c @@ -0,0 +1,14 @@ +#define NULL ((void*)0) +#define NULL ((void*)0) + +#define FOO(X, Y) (X + Y + Z) +#define FOO(X, Y) (X + Y + Z) + +#define BAR(X, Y, ...) (X + Y + Z) +#define BAR(X, Y, ...) (X + Y + Z) + +int +main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00097.c.expected b/test/regress/c-testsuite/single-exec/00097.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00097.c.otags b/test/regress/c-testsuite/single-exec/00097.c.otags new file mode 100644 index 0000000..fe27c8f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00097.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0100-redeclaremacro.c diff --git a/test/regress/c-testsuite/single-exec/00097.c.tags b/test/regress/c-testsuite/single-exec/00097.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00097.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00098.c b/test/regress/c-testsuite/single-exec/00098.c new file mode 100644 index 0000000..79f7cc3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00098.c @@ -0,0 +1,5 @@ +int +main() +{ + return L'\0'; +} diff --git a/test/regress/c-testsuite/single-exec/00098.c.expected b/test/regress/c-testsuite/single-exec/00098.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00098.c.otags b/test/regress/c-testsuite/single-exec/00098.c.otags new file mode 100644 index 0000000..363d752 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00098.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0101-wcharlit.c diff --git a/test/regress/c-testsuite/single-exec/00098.c.tags b/test/regress/c-testsuite/single-exec/00098.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00098.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00099.c b/test/regress/c-testsuite/single-exec/00099.c new file mode 100644 index 0000000..4603116 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00099.c @@ -0,0 +1,13 @@ + +typedef struct { int n; } Vec; + +static void +vecresize(Vec *v, int cap) +{ + return; +} + +int main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00099.c.expected b/test/regress/c-testsuite/single-exec/00099.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00099.c.otags b/test/regress/c-testsuite/single-exec/00099.c.otags new file mode 100644 index 0000000..d04839c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00099.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0102-bug.c diff --git a/test/regress/c-testsuite/single-exec/00099.c.tags b/test/regress/c-testsuite/single-exec/00099.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00099.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00100.c b/test/regress/c-testsuite/single-exec/00100.c new file mode 100644 index 0000000..c8f2cf5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00100.c @@ -0,0 +1,11 @@ +int +foo(void) +{ + return 0; +} + +int +main() +{ + return foo(); +} diff --git a/test/regress/c-testsuite/single-exec/00100.c.expected b/test/regress/c-testsuite/single-exec/00100.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00100.c.otags b/test/regress/c-testsuite/single-exec/00100.c.otags new file mode 100644 index 0000000..d54b4c0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00100.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0103-voidparm.c diff --git a/test/regress/c-testsuite/single-exec/00100.c.tags b/test/regress/c-testsuite/single-exec/00100.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00100.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00101.c b/test/regress/c-testsuite/single-exec/00101.c new file mode 100644 index 0000000..d530802 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00101.c @@ -0,0 +1,10 @@ +int +main() +{ + int c; + c = 0; + do + ; + while (0); + return c; +} diff --git a/test/regress/c-testsuite/single-exec/00101.c.expected b/test/regress/c-testsuite/single-exec/00101.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00101.c.otags b/test/regress/c-testsuite/single-exec/00101.c.otags new file mode 100644 index 0000000..beb784b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00101.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0104-qbebug.c diff --git a/test/regress/c-testsuite/single-exec/00101.c.tags b/test/regress/c-testsuite/single-exec/00101.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00101.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00102.c b/test/regress/c-testsuite/single-exec/00102.c new file mode 100644 index 0000000..ab47243 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00102.c @@ -0,0 +1,11 @@ +int +main() +{ + int x; + + x = 1; + if ((x << 1) != 2) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00102.c.expected b/test/regress/c-testsuite/single-exec/00102.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00102.c.otags b/test/regress/c-testsuite/single-exec/00102.c.otags new file mode 100644 index 0000000..514d2a9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00102.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0105-shl.c diff --git a/test/regress/c-testsuite/single-exec/00102.c.tags b/test/regress/c-testsuite/single-exec/00102.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00102.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00103.c b/test/regress/c-testsuite/single-exec/00103.c new file mode 100644 index 0000000..099c2b3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00103.c @@ -0,0 +1,14 @@ +int +main() +{ + int x; + void *foo; + void **bar; + + x = 0; + + foo = (void*)&x; + bar = &foo; + + return **(int**)bar; +} diff --git a/test/regress/c-testsuite/single-exec/00103.c.expected b/test/regress/c-testsuite/single-exec/00103.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00103.c.otags b/test/regress/c-testsuite/single-exec/00103.c.otags new file mode 100644 index 0000000..0fb40c4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00103.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0106-ppcast.c diff --git a/test/regress/c-testsuite/single-exec/00103.c.tags b/test/regress/c-testsuite/single-exec/00103.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00103.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00104.c b/test/regress/c-testsuite/single-exec/00104.c new file mode 100644 index 0000000..d28acef --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00104.c @@ -0,0 +1,22 @@ +#include + +int +main() +{ + int32_t x; + int64_t l; + + x = 0; + l = 0; + + x = ~x; + if (x != 0xffffffff) + return 1; + + l = ~l; + if (x != 0xffffffffffffffff) + return 2; + + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00104.c.expected b/test/regress/c-testsuite/single-exec/00104.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00104.c.otags b/test/regress/c-testsuite/single-exec/00104.c.otags new file mode 100644 index 0000000..bbfdac3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00104.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0107-bnot.c diff --git a/test/regress/c-testsuite/single-exec/00104.c.tags b/test/regress/c-testsuite/single-exec/00104.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00104.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00105.c b/test/regress/c-testsuite/single-exec/00105.c new file mode 100644 index 0000000..919ec6d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00105.c @@ -0,0 +1,11 @@ +int +main() +{ + int i; + + for(i = 0; i < 10; i++) + if (!i) + continue; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00105.c.expected b/test/regress/c-testsuite/single-exec/00105.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00105.c.otags b/test/regress/c-testsuite/single-exec/00105.c.otags new file mode 100644 index 0000000..4f9bc00 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00105.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0108-bug.c diff --git a/test/regress/c-testsuite/single-exec/00105.c.tags b/test/regress/c-testsuite/single-exec/00105.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00105.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00106.c b/test/regress/c-testsuite/single-exec/00106.c new file mode 100644 index 0000000..3bc0296 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00106.c @@ -0,0 +1,10 @@ +struct S1 { int x; }; +struct S2 { struct S1 s1; }; + +int +main() +{ + struct S2 s2; + s2.s1.x = 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00106.c.expected b/test/regress/c-testsuite/single-exec/00106.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00106.c.otags b/test/regress/c-testsuite/single-exec/00106.c.otags new file mode 100644 index 0000000..ac2635b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00106.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0109-struct.c diff --git a/test/regress/c-testsuite/single-exec/00106.c.tags b/test/regress/c-testsuite/single-exec/00106.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00106.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00107.c b/test/regress/c-testsuite/single-exec/00107.c new file mode 100644 index 0000000..fb608eb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00107.c @@ -0,0 +1,8 @@ +typedef int myint; +myint x = (myint)1; + +int +main(void) +{ + return x-1; +} diff --git a/test/regress/c-testsuite/single-exec/00107.c.expected b/test/regress/c-testsuite/single-exec/00107.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00107.c.otags b/test/regress/c-testsuite/single-exec/00107.c.otags new file mode 100644 index 0000000..f938599 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00107.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0110-typedefcast.c diff --git a/test/regress/c-testsuite/single-exec/00107.c.tags b/test/regress/c-testsuite/single-exec/00107.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00107.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00108.c b/test/regress/c-testsuite/single-exec/00108.c new file mode 100644 index 0000000..612ffd1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00108.c @@ -0,0 +1,9 @@ +int foo(void); +int foo(void); +#define FOO 0 + +int +main() +{ + return FOO; +} diff --git a/test/regress/c-testsuite/single-exec/00108.c.expected b/test/regress/c-testsuite/single-exec/00108.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00108.c.otags b/test/regress/c-testsuite/single-exec/00108.c.otags new file mode 100644 index 0000000..230fd55 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00108.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0111-doubledef.c diff --git a/test/regress/c-testsuite/single-exec/00108.c.tags b/test/regress/c-testsuite/single-exec/00108.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00108.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00109.c b/test/regress/c-testsuite/single-exec/00109.c new file mode 100644 index 0000000..77c1b04 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00109.c @@ -0,0 +1,11 @@ +int +main() +{ + int x = 0; + int y = 1; + if(x ? 1 : 0) + return 1; + if(y ? 0 : 1) + return 2; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00109.c.expected b/test/regress/c-testsuite/single-exec/00109.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00109.c.otags b/test/regress/c-testsuite/single-exec/00109.c.otags new file mode 100644 index 0000000..8a00493 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00109.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0112-cond.c diff --git a/test/regress/c-testsuite/single-exec/00109.c.tags b/test/regress/c-testsuite/single-exec/00109.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00109.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00110.c b/test/regress/c-testsuite/single-exec/00110.c new file mode 100644 index 0000000..0e76572 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00110.c @@ -0,0 +1,8 @@ +extern int x; +int x; + +int +main() +{ + return x; +} diff --git a/test/regress/c-testsuite/single-exec/00110.c.expected b/test/regress/c-testsuite/single-exec/00110.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00110.c.otags b/test/regress/c-testsuite/single-exec/00110.c.otags new file mode 100644 index 0000000..023df15 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00110.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0113-externredecl.c diff --git a/test/regress/c-testsuite/single-exec/00110.c.tags b/test/regress/c-testsuite/single-exec/00110.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00110.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00111.c b/test/regress/c-testsuite/single-exec/00111.c new file mode 100644 index 0000000..976098b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00111.c @@ -0,0 +1,9 @@ +int +main() +{ + short s = 1; + long l = 1; + + s -= l; + return s; +} diff --git a/test/regress/c-testsuite/single-exec/00111.c.expected b/test/regress/c-testsuite/single-exec/00111.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00111.c.otags b/test/regress/c-testsuite/single-exec/00111.c.otags new file mode 100644 index 0000000..0bc57ab --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00111.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0114-shortassig.c diff --git a/test/regress/c-testsuite/single-exec/00111.c.tags b/test/regress/c-testsuite/single-exec/00111.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00111.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00112.c b/test/regress/c-testsuite/single-exec/00112.c new file mode 100644 index 0000000..7f1084e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00112.c @@ -0,0 +1,5 @@ +int +main() +{ + return "abc" == (void *)0; +} diff --git a/test/regress/c-testsuite/single-exec/00112.c.expected b/test/regress/c-testsuite/single-exec/00112.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00112.c.otags b/test/regress/c-testsuite/single-exec/00112.c.otags new file mode 100644 index 0000000..4132178 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00112.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0115-null-comparision.c diff --git a/test/regress/c-testsuite/single-exec/00112.c.tags b/test/regress/c-testsuite/single-exec/00112.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00112.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00113.c b/test/regress/c-testsuite/single-exec/00113.c new file mode 100644 index 0000000..5783868 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00113.c @@ -0,0 +1,8 @@ +int +main() +{ + int a = 0; + float f = a + 1; + + return f == a; +} diff --git a/test/regress/c-testsuite/single-exec/00113.c.expected b/test/regress/c-testsuite/single-exec/00113.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00113.c.otags b/test/regress/c-testsuite/single-exec/00113.c.otags new file mode 100644 index 0000000..df1070b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00113.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0116-floatcmp.c diff --git a/test/regress/c-testsuite/single-exec/00113.c.tags b/test/regress/c-testsuite/single-exec/00113.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00113.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00114.c b/test/regress/c-testsuite/single-exec/00114.c new file mode 100644 index 0000000..845293b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00114.c @@ -0,0 +1,7 @@ +int main(void); + +int +main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00114.c.expected b/test/regress/c-testsuite/single-exec/00114.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00114.c.otags b/test/regress/c-testsuite/single-exec/00114.c.otags new file mode 100644 index 0000000..3b81a4b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00114.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0118-voidmain.c diff --git a/test/regress/c-testsuite/single-exec/00114.c.tags b/test/regress/c-testsuite/single-exec/00114.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00114.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00115.c b/test/regress/c-testsuite/single-exec/00115.c new file mode 100644 index 0000000..fa2e021 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00115.c @@ -0,0 +1,17 @@ +#define B "b" + +char s[] = "a" B "c"; + +int +main() +{ + if (s[0] != 'a') + return 1; + if (s[1] != 'b') + return 2; + if (s[2] != 'c') + return 3; + if (s[3] != '\0') + return 4; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00115.c.expected b/test/regress/c-testsuite/single-exec/00115.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00115.c.otags b/test/regress/c-testsuite/single-exec/00115.c.otags new file mode 100644 index 0000000..5880950 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00115.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0119-macrostr.c diff --git a/test/regress/c-testsuite/single-exec/00115.c.tags b/test/regress/c-testsuite/single-exec/00115.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00115.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00116.c b/test/regress/c-testsuite/single-exec/00116.c new file mode 100644 index 0000000..8bca625 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00116.c @@ -0,0 +1,11 @@ +int +f(int f) +{ + return f; +} + +int +main() +{ + return f(0); +} diff --git a/test/regress/c-testsuite/single-exec/00116.c.expected b/test/regress/c-testsuite/single-exec/00116.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00116.c.otags b/test/regress/c-testsuite/single-exec/00116.c.otags new file mode 100644 index 0000000..8700696 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00116.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0120-funpar.c diff --git a/test/regress/c-testsuite/single-exec/00116.c.tags b/test/regress/c-testsuite/single-exec/00116.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00116.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00117.c b/test/regress/c-testsuite/single-exec/00117.c new file mode 100644 index 0000000..1852c12 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00117.c @@ -0,0 +1,5 @@ +int main() +{ + int x[] = { 1, 0 }; + return x[1]; +} diff --git a/test/regress/c-testsuite/single-exec/00117.c.expected b/test/regress/c-testsuite/single-exec/00117.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00117.c.otags b/test/regress/c-testsuite/single-exec/00117.c.otags new file mode 100644 index 0000000..b8fc42e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00117.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0121-localinit.c diff --git a/test/regress/c-testsuite/single-exec/00117.c.tags b/test/regress/c-testsuite/single-exec/00117.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00117.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00118.c b/test/regress/c-testsuite/single-exec/00118.c new file mode 100644 index 0000000..0cfe3df --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00118.c @@ -0,0 +1,6 @@ +int +main() +{ + struct { int x; } s = { 0 }; + return s.x; +} diff --git a/test/regress/c-testsuite/single-exec/00118.c.expected b/test/regress/c-testsuite/single-exec/00118.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00118.c.otags b/test/regress/c-testsuite/single-exec/00118.c.otags new file mode 100644 index 0000000..d4b6bd6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00118.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0122-localinit.c diff --git a/test/regress/c-testsuite/single-exec/00118.c.tags b/test/regress/c-testsuite/single-exec/00118.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00118.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00119.c b/test/regress/c-testsuite/single-exec/00119.c new file mode 100644 index 0000000..c879aab --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00119.c @@ -0,0 +1,7 @@ +double x = 100; + +int +main() +{ + return x < 1; +} diff --git a/test/regress/c-testsuite/single-exec/00119.c.expected b/test/regress/c-testsuite/single-exec/00119.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00119.c.otags b/test/regress/c-testsuite/single-exec/00119.c.otags new file mode 100644 index 0000000..91fbc96 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00119.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0123-doubleconst.c diff --git a/test/regress/c-testsuite/single-exec/00119.c.tags b/test/regress/c-testsuite/single-exec/00119.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00119.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00120.c b/test/regress/c-testsuite/single-exec/00120.c new file mode 100644 index 0000000..086bf10 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00120.c @@ -0,0 +1,10 @@ +struct { + enum { X } x; +} s; + + +int +main() +{ + return X; +} diff --git a/test/regress/c-testsuite/single-exec/00120.c.expected b/test/regress/c-testsuite/single-exec/00120.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00120.c.otags b/test/regress/c-testsuite/single-exec/00120.c.otags new file mode 100644 index 0000000..041dcd9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00120.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0124-enumstruct.c diff --git a/test/regress/c-testsuite/single-exec/00120.c.tags b/test/regress/c-testsuite/single-exec/00120.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00120.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00121.c b/test/regress/c-testsuite/single-exec/00121.c new file mode 100644 index 0000000..1dafa86 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00121.c @@ -0,0 +1,20 @@ +int f(int a), g(int a), a; + + +int +main() +{ + return f(1) - g(1); +} + +int +f(int a) +{ + return a; +} + +int +g(int a) +{ + return a; +} diff --git a/test/regress/c-testsuite/single-exec/00121.c.expected b/test/regress/c-testsuite/single-exec/00121.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00121.c.otags b/test/regress/c-testsuite/single-exec/00121.c.otags new file mode 100644 index 0000000..1f42e0a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00121.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0125-fundcl.c diff --git a/test/regress/c-testsuite/single-exec/00121.c.tags b/test/regress/c-testsuite/single-exec/00121.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00121.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00122.c b/test/regress/c-testsuite/single-exec/00122.c new file mode 100644 index 0000000..1fbeeed --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00122.c @@ -0,0 +1,6 @@ +#define F(a, b) a +int +main() +{ + return F(, 1) 0; +} diff --git a/test/regress/c-testsuite/single-exec/00122.c.expected b/test/regress/c-testsuite/single-exec/00122.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00122.c.otags b/test/regress/c-testsuite/single-exec/00122.c.otags new file mode 100644 index 0000000..cae4611 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00122.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0126-macropar.c diff --git a/test/regress/c-testsuite/single-exec/00122.c.tags b/test/regress/c-testsuite/single-exec/00122.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00122.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00123.c b/test/regress/c-testsuite/single-exec/00123.c new file mode 100644 index 0000000..eb7f282 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00123.c @@ -0,0 +1,7 @@ +double x = 100.0; + +int +main() +{ + return x < 1; +} diff --git a/test/regress/c-testsuite/single-exec/00123.c.expected b/test/regress/c-testsuite/single-exec/00123.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00123.c.otags b/test/regress/c-testsuite/single-exec/00123.c.otags new file mode 100644 index 0000000..8e8eba9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00123.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0127-doublecte.c diff --git a/test/regress/c-testsuite/single-exec/00123.c.tags b/test/regress/c-testsuite/single-exec/00123.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00123.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00124.c b/test/regress/c-testsuite/single-exec/00124.c new file mode 100644 index 0000000..3a31d8a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00124.c @@ -0,0 +1,22 @@ +int +f2(int c, int b) +{ + return c - b; +} + +int (* +f1(int a, int b))(int c, int b) +{ + if (a != b) + return f2; + return 0; +} + +int +main() +{ + int (* (*p)(int a, int b))(int c, int d) = f1; + + + return (*(*p)(0, 2))(2, 2); +} diff --git a/test/regress/c-testsuite/single-exec/00124.c.expected b/test/regress/c-testsuite/single-exec/00124.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00124.c.otags b/test/regress/c-testsuite/single-exec/00124.c.otags new file mode 100644 index 0000000..af7d883 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00124.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0130-mulpars.c diff --git a/test/regress/c-testsuite/single-exec/00124.c.tags b/test/regress/c-testsuite/single-exec/00124.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00124.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00125.c b/test/regress/c-testsuite/single-exec/00125.c new file mode 100644 index 0000000..1cfa18d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00125.c @@ -0,0 +1,8 @@ +#include + +int +main(void) +{ + printf("hello world\n"); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00125.c.expected b/test/regress/c-testsuite/single-exec/00125.c.expected new file mode 100644 index 0000000..3b18e51 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00125.c.expected @@ -0,0 +1 @@ +hello world diff --git a/test/regress/c-testsuite/single-exec/00125.c.otags b/test/regress/c-testsuite/single-exec/00125.c.otags new file mode 100644 index 0000000..2d6268a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00125.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0131-hello.c diff --git a/test/regress/c-testsuite/single-exec/00125.c.tags b/test/regress/c-testsuite/single-exec/00125.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00125.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00126.c b/test/regress/c-testsuite/single-exec/00126.c new file mode 100644 index 0000000..8e48d35 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00126.c @@ -0,0 +1,14 @@ +int +main() +{ + int x; + + x = 3; + x = !x; + x = !x; + x = ~x; + x = -x; + if(x != 2) + return 1; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00126.c.expected b/test/regress/c-testsuite/single-exec/00126.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00126.c.otags b/test/regress/c-testsuite/single-exec/00126.c.otags new file mode 100644 index 0000000..5518278 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00126.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0135-unary.c diff --git a/test/regress/c-testsuite/single-exec/00126.c.tags b/test/regress/c-testsuite/single-exec/00126.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00126.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00127.c b/test/regress/c-testsuite/single-exec/00127.c new file mode 100644 index 0000000..78e3cef --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00127.c @@ -0,0 +1,20 @@ +int c; + +int +main() +{ + if(0) { + return 1; + } else if(0) { + } else { + if(1) { + if(c) + return 1; + else + return 0; + } else { + return 1; + } + } + return 1; +} diff --git a/test/regress/c-testsuite/single-exec/00127.c.expected b/test/regress/c-testsuite/single-exec/00127.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00127.c.otags b/test/regress/c-testsuite/single-exec/00127.c.otags new file mode 100644 index 0000000..ba02d3d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00127.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0136-if.c diff --git a/test/regress/c-testsuite/single-exec/00127.c.tags b/test/regress/c-testsuite/single-exec/00127.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00127.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00128.c b/test/regress/c-testsuite/single-exec/00128.c new file mode 100644 index 0000000..beea01f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00128.c @@ -0,0 +1,139 @@ + +int a; +unsigned b; +char c; +signed char d; +unsigned char e; +long f; +unsigned long g; +long long h; +unsigned long long i; +short j; +unsigned short k; + +int +main(void) +{ + a = b; + a = c; + a = d; + a = e; + a = f; + a = g; + a = h; + a = i; + a = j; + a = k; + + b = a; + b = c; + b = d; + b = e; + b = f; + b = g; + b = h; + b = i; + b = j; + b = k; + + c = a; + c = b; + c = d; + c = e; + c = f; + c = g; + c = h; + c = i; + c = j; + c = k; + + d = a; + d = b; + d = c; + d = e; + d = f; + d = g; + d = h; + d = i; + d = j; + d = k; + + e = a; + e = b; + e = c; + e = d; + e = f; + e = g; + e = h; + e = i; + e = j; + e = k; + + f = a; + f = b; + f = c; + f = d; + f = e; + f = g; + f = h; + f = i; + f = j; + f = k; + + g = a; + g = b; + g = c; + g = d; + g = e; + g = f; + g = h; + g = i; + g = j; + g = k; + + h = a; + h = b; + h = c; + h = d; + h = e; + h = f; + h = g; + h = i; + h = j; + h = k; + + i = a; + i = b; + i = c; + i = d; + i = e; + i = f; + i = g; + i = h; + i = j; + i = k; + + j = a; + j = b; + j = c; + j = d; + j = e; + j = f; + j = g; + j = h; + j = i; + j = k; + + k = a; + k = b; + k = c; + k = d; + k = e; + k = f; + k = g; + k = h; + k = j; + k = i; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00128.c.expected b/test/regress/c-testsuite/single-exec/00128.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00128.c.otags b/test/regress/c-testsuite/single-exec/00128.c.otags new file mode 100644 index 0000000..19ae143 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00128.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0137-int-cast.c diff --git a/test/regress/c-testsuite/single-exec/00128.c.tags b/test/regress/c-testsuite/single-exec/00128.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00128.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00129.c b/test/regress/c-testsuite/single-exec/00129.c new file mode 100644 index 0000000..96bdc35 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00129.c @@ -0,0 +1,30 @@ +typedef struct s s; + +struct s { + struct s1 { + int s; + struct s2 { + int s; + } s1; + } s; +} s2; + +#define s s + +int +main(void) +{ +#undef s + goto s; + struct s s; + { + int s; + return s; + } + return s.s.s + s.s.s1.s; + s: + { + return 0; + } + return 1; +} diff --git a/test/regress/c-testsuite/single-exec/00129.c.expected b/test/regress/c-testsuite/single-exec/00129.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00129.c.otags b/test/regress/c-testsuite/single-exec/00129.c.otags new file mode 100644 index 0000000..232b80b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00129.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0138-namespace.c diff --git a/test/regress/c-testsuite/single-exec/00129.c.tags b/test/regress/c-testsuite/single-exec/00129.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00129.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00130.c b/test/regress/c-testsuite/single-exec/00130.c new file mode 100644 index 0000000..6405f7b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00130.c @@ -0,0 +1,22 @@ +int +main() +{ + char arr[2][4], (*p)[4], *q; + int v[4]; + + p = arr; + q = &arr[1][3]; + arr[1][3] = 2; + v[0] = 2; + + if (arr[1][3] != 2) + return 1; + if (p[1][3] != 2) + return 1; + if (*q != 2) + return 1; + if (*v != 2) + return 1; + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00130.c.expected b/test/regress/c-testsuite/single-exec/00130.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00130.c.otags b/test/regress/c-testsuite/single-exec/00130.c.otags new file mode 100644 index 0000000..2798372 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00130.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0139-ptr-ary.c diff --git a/test/regress/c-testsuite/single-exec/00130.c.tags b/test/regress/c-testsuite/single-exec/00130.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00130.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00131.c b/test/regress/c-testsuite/single-exec/00131.c new file mode 100644 index 0000000..a2e6bc6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00131.c @@ -0,0 +1,14 @@ +#include + +int main() +{ + printf("Hello\n"); + printf("Hello\n"); /* this is a comment */ printf("Hello\n"); + printf("Hello\n"); + // this is also a comment sayhello(); + printf("Hello\n"); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00131.c.expected b/test/regress/c-testsuite/single-exec/00131.c.expected new file mode 100644 index 0000000..b1387ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00131.c.expected @@ -0,0 +1,5 @@ +Hello +Hello +Hello +Hello +Hello diff --git a/test/regress/c-testsuite/single-exec/00131.c.otags b/test/regress/c-testsuite/single-exec/00131.c.otags new file mode 100644 index 0000000..806a7c4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00131.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/01_comment.c diff --git a/test/regress/c-testsuite/single-exec/00131.c.tags b/test/regress/c-testsuite/single-exec/00131.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00131.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00132.c b/test/regress/c-testsuite/single-exec/00132.c new file mode 100644 index 0000000..4c34dd8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00132.c @@ -0,0 +1,18 @@ +#include + +int main() +{ + printf("Hello world\n"); + + int Count; + for (Count = -5; Count <= 5; Count++) + printf("Count = %d\n", Count); + + printf("String 'hello', 'there' is '%s', '%s'\n", "hello", "there"); + printf("Character 'A' is '%c'\n", 65); + printf("Character 'a' is '%c'\n", 'a'); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00132.c.expected b/test/regress/c-testsuite/single-exec/00132.c.expected new file mode 100644 index 0000000..f67a0f6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00132.c.expected @@ -0,0 +1,15 @@ +Hello world +Count = -5 +Count = -4 +Count = -3 +Count = -2 +Count = -1 +Count = 0 +Count = 1 +Count = 2 +Count = 3 +Count = 4 +Count = 5 +String 'hello', 'there' is 'hello', 'there' +Character 'A' is 'A' +Character 'a' is 'a' diff --git a/test/regress/c-testsuite/single-exec/00132.c.otags b/test/regress/c-testsuite/single-exec/00132.c.otags new file mode 100644 index 0000000..e828a67 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00132.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/02_printf.c diff --git a/test/regress/c-testsuite/single-exec/00132.c.tags b/test/regress/c-testsuite/single-exec/00132.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00132.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00133.c b/test/regress/c-testsuite/single-exec/00133.c new file mode 100644 index 0000000..6a4c078 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00133.c @@ -0,0 +1,24 @@ +int main(void) +{ + int i; + unsigned u; + + i = 1; + i = -1; + i = -1l; + i = -1u; + i = -1ll; + i = 32766 + 1 & 3; + i = (int) 32768 < 0; + i = -1u < 0; + + u = 1; + u = -1; + u = -1l; + u = -1u; + u = -1ll; + u = (unsigned) 32768 < 0; + u = 32766 + 1 & 3; + u = -1u < 0; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00133.c.expected b/test/regress/c-testsuite/single-exec/00133.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00133.c.otags b/test/regress/c-testsuite/single-exec/00133.c.otags new file mode 100644 index 0000000..f998aab --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00133.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0143-int-const.c diff --git a/test/regress/c-testsuite/single-exec/00133.c.tags b/test/regress/c-testsuite/single-exec/00133.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00133.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00134.c b/test/regress/c-testsuite/single-exec/00134.c new file mode 100644 index 0000000..41b6b36 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00134.c @@ -0,0 +1,25 @@ +int +main(void) +{ + long i; + unsigned long u; + + i = 1; + i = -1; + i = -1l; + i = -1u; + i = -1ll; + i = (1ll << 32) - 1 & 3; + i = (long) ((1ll << 32) - 1) < 0; + i = -1u < 0; + + u = 1; + u = -1; + u = -1l; + u = -1u; + u = -1ll; + u = (1ll << 32) - 1 & 3; + u = (long) ((1ll << 32) - 1) < 0; + u = -1u < 0; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00134.c.expected b/test/regress/c-testsuite/single-exec/00134.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00134.c.otags b/test/regress/c-testsuite/single-exec/00134.c.otags new file mode 100644 index 0000000..8ddc441 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00134.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0144-long-const.c diff --git a/test/regress/c-testsuite/single-exec/00134.c.tags b/test/regress/c-testsuite/single-exec/00134.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00134.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00135.c b/test/regress/c-testsuite/single-exec/00135.c new file mode 100644 index 0000000..5a5a8a1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00135.c @@ -0,0 +1,23 @@ +int +main(void) +{ + long long i; + unsigned long long u; + + i = 1; + i = -1; + i = -1l; + i = -1u; + i = -1ll; + i = -1ll & 3; + i = -1ll < 0; + + u = 1; + u = -1; + u = -1l; + u = -1u; + u = -1ll; + u = -1llu & 3; + u = -1llu < 0; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00135.c.expected b/test/regress/c-testsuite/single-exec/00135.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00135.c.otags b/test/regress/c-testsuite/single-exec/00135.c.otags new file mode 100644 index 0000000..a3bf9b0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00135.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0145-llong-const.c diff --git a/test/regress/c-testsuite/single-exec/00135.c.tags b/test/regress/c-testsuite/single-exec/00135.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00135.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00136.c b/test/regress/c-testsuite/single-exec/00136.c new file mode 100644 index 0000000..3df8c87 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00136.c @@ -0,0 +1,52 @@ +#define FOO + +#ifdef FOO + int a; + int b; + #undef FOO + #ifndef FOO + int c; + int d; + #else + int e; + int f; + #endif + int e; + int f; + #ifdef FOO + int c_; + int d_; + #else + int e_; + int f_; + #endif + int e_; + int f_; +int +main() +{ + return 0; +} +#else + int j; + int k; + #ifdef FOO + int j; + int k; + #else + int n; + int o; + #endif + int n; + int o; + #ifndef FOO + int r; + int s; + #else + int t; + int u; + #endif + int t; + int u; + #error bad branch +#endif diff --git a/test/regress/c-testsuite/single-exec/00136.c.expected b/test/regress/c-testsuite/single-exec/00136.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00136.c.otags b/test/regress/c-testsuite/single-exec/00136.c.otags new file mode 100644 index 0000000..7452a1c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00136.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0146-ifdef.c diff --git a/test/regress/c-testsuite/single-exec/00136.c.tags b/test/regress/c-testsuite/single-exec/00136.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00136.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00137.c b/test/regress/c-testsuite/single-exec/00137.c new file mode 100644 index 0000000..2f0f054 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00137.c @@ -0,0 +1,10 @@ +#define x(y) #y + +int +main(void) +{ + char *p; + p = x(hello) " is better than bye"; + + return (*p == 'h') ? 0 : 1; +} diff --git a/test/regress/c-testsuite/single-exec/00137.c.expected b/test/regress/c-testsuite/single-exec/00137.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00137.c.otags b/test/regress/c-testsuite/single-exec/00137.c.otags new file mode 100644 index 0000000..dcfe92f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00137.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0148-cpp-string.c diff --git a/test/regress/c-testsuite/single-exec/00137.c.tags b/test/regress/c-testsuite/single-exec/00137.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00137.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00138.c b/test/regress/c-testsuite/single-exec/00138.c new file mode 100644 index 0000000..a81c486 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00138.c @@ -0,0 +1,10 @@ +#define M(x) x +#define A(a,b) a(b) + +int +main(void) +{ + char *a = A(M,"hi"); + + return (a[1] == 'i') ? 0 : 1; +} diff --git a/test/regress/c-testsuite/single-exec/00138.c.expected b/test/regress/c-testsuite/single-exec/00138.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00138.c.otags b/test/regress/c-testsuite/single-exec/00138.c.otags new file mode 100644 index 0000000..0bf9af4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00138.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0149-define.c diff --git a/test/regress/c-testsuite/single-exec/00138.c.tags b/test/regress/c-testsuite/single-exec/00138.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00138.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00139.c b/test/regress/c-testsuite/single-exec/00139.c new file mode 100644 index 0000000..32c0ef4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00139.c @@ -0,0 +1,15 @@ +/* + * f(2) will expand to 2*g, which will expand to 2*f, and in this + * moment f will not be expanded because the macro definition is + * a function alike macro, and in this case there is no arguments. + */ +#define f(a) a*g +#define g f + +int +main(void) +{ + int f = 0; + + return f(2); +} diff --git a/test/regress/c-testsuite/single-exec/00139.c.expected b/test/regress/c-testsuite/single-exec/00139.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00139.c.otags b/test/regress/c-testsuite/single-exec/00139.c.otags new file mode 100644 index 0000000..39630d7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00139.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0150-define.c diff --git a/test/regress/c-testsuite/single-exec/00139.c.tags b/test/regress/c-testsuite/single-exec/00139.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00139.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00140.c b/test/regress/c-testsuite/single-exec/00140.c new file mode 100644 index 0000000..f7ddb89 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00140.c @@ -0,0 +1,25 @@ +struct foo { + int i, j, k; + char *p; + float v; +}; + +int +f1(struct foo f, struct foo *p, int n, ...) +{ + if (f.i != p->i) + return 0; + return p->j + n; +} + +int +main(void) +{ + struct foo f; + + f.i = f.j = 1; + f1(f, &f, 2); + f1(f, &f, 2, 1, f, &f); + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00140.c.expected b/test/regress/c-testsuite/single-exec/00140.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00140.c.otags b/test/regress/c-testsuite/single-exec/00140.c.otags new file mode 100644 index 0000000..b231c0f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00140.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0151-vararg.c diff --git a/test/regress/c-testsuite/single-exec/00140.c.tags b/test/regress/c-testsuite/single-exec/00140.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00140.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00141.c b/test/regress/c-testsuite/single-exec/00141.c new file mode 100644 index 0000000..3fc4648 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00141.c @@ -0,0 +1,14 @@ +#define CAT(x,y) x ## y +#define XCAT(x,y) CAT(x,y) +#define FOO foo +#define BAR bar + +int +main(void) +{ + int foo, bar, foobar; + + CAT(foo,bar) = foo + bar; + XCAT(FOO,BAR) = foo + bar; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00141.c.expected b/test/regress/c-testsuite/single-exec/00141.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00141.c.otags b/test/regress/c-testsuite/single-exec/00141.c.otags new file mode 100644 index 0000000..9bc0d11 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00141.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0152-cat.c diff --git a/test/regress/c-testsuite/single-exec/00141.c.tags b/test/regress/c-testsuite/single-exec/00141.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00141.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00142.c b/test/regress/c-testsuite/single-exec/00142.c new file mode 100644 index 0000000..3a5d80b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00142.c @@ -0,0 +1,15 @@ +#if defined(FOO) +int a; +#elif !defined(FOO) && defined(BAR) +int b; +#elif !defined(FOO) && !defined(BAR) +int c; +#else +int d; +#endif + +int +main(void) +{ + return c; +} diff --git a/test/regress/c-testsuite/single-exec/00142.c.expected b/test/regress/c-testsuite/single-exec/00142.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00142.c.otags b/test/regress/c-testsuite/single-exec/00142.c.otags new file mode 100644 index 0000000..cf191e6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00142.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0154-if-defined.c diff --git a/test/regress/c-testsuite/single-exec/00142.c.tags b/test/regress/c-testsuite/single-exec/00142.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00142.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00143.c b/test/regress/c-testsuite/single-exec/00143.c new file mode 100644 index 0000000..12f33c9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00143.c @@ -0,0 +1,37 @@ +/* Disgusting, no? But it compiles and runs just fine. I feel a combination of + pride and revulsion at this discovery. If no one's thought of it before, + I think I'll name it after myself. + It amazes me that after 10 years of writing C there are still + little corners that I haven't explored fully. + - Tom Duff */ + +int main() +{ + int count, n; + short *from, *to; + short a[39], b[39]; + + for(n = 0; n < 39; n++) { + a[n] = n; + b[n] = 0; + } + from = a; + to = b; + count = 39; + n = (count + 7) / 8; + switch (count % 8) { + case 0: do { *to++ = *from++; + case 7: *to++ = *from++; + case 6: *to++ = *from++; + case 5: *to++ = *from++; + case 4: *to++ = *from++; + case 3: *to++ = *from++; + case 2: *to++ = *from++; + case 1: *to++ = *from++; + } while (--n > 0); + } + for(n = 0; n < 39; n++) + if(a[n] != b[n]) + return 1; + return 0; +} \ No newline at end of file diff --git a/test/regress/c-testsuite/single-exec/00143.c.expected b/test/regress/c-testsuite/single-exec/00143.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00143.c.otags b/test/regress/c-testsuite/single-exec/00143.c.otags new file mode 100644 index 0000000..26cc3f9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00143.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0156-duff2.c diff --git a/test/regress/c-testsuite/single-exec/00143.c.tags b/test/regress/c-testsuite/single-exec/00143.c.tags new file mode 100644 index 0000000..0d6188f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00143.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp \ No newline at end of file diff --git a/test/regress/c-testsuite/single-exec/00144.c b/test/regress/c-testsuite/single-exec/00144.c new file mode 100644 index 0000000..bcf7316 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00144.c @@ -0,0 +1,17 @@ +int +main(void) +{ + int i, *q; + void *p; + + i = i ? 0 : 0l; + p = i ? (void *) 0 : 0; + p = i ? 0 : (void *) 0; + p = i ? 0 : (const void *) 0; + q = i ? 0 : p; + q = i ? p : 0; + q = i ? q : 0; + q = i ? 0 : q; + + return (int) q; +} diff --git a/test/regress/c-testsuite/single-exec/00144.c.expected b/test/regress/c-testsuite/single-exec/00144.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00144.c.otags b/test/regress/c-testsuite/single-exec/00144.c.otags new file mode 100644 index 0000000..d190c56 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00144.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0158-ternary.c diff --git a/test/regress/c-testsuite/single-exec/00144.c.tags b/test/regress/c-testsuite/single-exec/00144.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00144.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00145.c b/test/regress/c-testsuite/single-exec/00145.c new file mode 100644 index 0000000..6085174 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00145.c @@ -0,0 +1,17 @@ +#if 0 != (0 && (0/0)) + #error 0 != (0 && (0/0)) +#endif + +#if 1 != (-1 || (0/0)) + #error 1 != (-1 || (0/0)) +#endif + +#if 3 != (-1 ? 3 : (0/0)) + #error 3 != (-1 ? 3 : (0/0)) +#endif + +int +main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00145.c.expected b/test/regress/c-testsuite/single-exec/00145.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00145.c.otags b/test/regress/c-testsuite/single-exec/00145.c.otags new file mode 100644 index 0000000..c711f39 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00145.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0160-cpp-if.c diff --git a/test/regress/c-testsuite/single-exec/00145.c.tags b/test/regress/c-testsuite/single-exec/00145.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00145.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00146.c b/test/regress/c-testsuite/single-exec/00146.c new file mode 100644 index 0000000..b001f9a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00146.c @@ -0,0 +1,12 @@ +struct S { int a; int b; }; +struct S s = {1, 2}; + +int +main() +{ + if(s.a != 1) + return 1; + if(s.b != 2) + return 2; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00146.c.expected b/test/regress/c-testsuite/single-exec/00146.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00146.c.otags b/test/regress/c-testsuite/single-exec/00146.c.otags new file mode 100644 index 0000000..077b3a3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00146.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0161-struct.c diff --git a/test/regress/c-testsuite/single-exec/00146.c.tags b/test/regress/c-testsuite/single-exec/00146.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00146.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00147.c b/test/regress/c-testsuite/single-exec/00147.c new file mode 100644 index 0000000..d3eeff1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00147.c @@ -0,0 +1,13 @@ +int arr[3] = {[2] = 2, [0] = 0, [1] = 1}; + +int +main() +{ + if(arr[0] != 0) + return 1; + if(arr[1] != 1) + return 2; + if(arr[2] != 2) + return 3; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00147.c.expected b/test/regress/c-testsuite/single-exec/00147.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00147.c.otags b/test/regress/c-testsuite/single-exec/00147.c.otags new file mode 100644 index 0000000..bd65b0a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00147.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0162-array.c diff --git a/test/regress/c-testsuite/single-exec/00147.c.tags b/test/regress/c-testsuite/single-exec/00147.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00147.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00148.c b/test/regress/c-testsuite/single-exec/00148.c new file mode 100644 index 0000000..ebc5c65 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00148.c @@ -0,0 +1,16 @@ +struct S {int a; int b;}; +struct S arr[2] = {[1] = {3, 4}, [0] = {1, 2}}; + +int +main() +{ + if(arr[0].a != 1) + return 1; + if(arr[0].b != 2) + return 2; + if(arr[1].a != 3) + return 3; + if(arr[1].b != 4) + return 4; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00148.c.expected b/test/regress/c-testsuite/single-exec/00148.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00148.c.otags b/test/regress/c-testsuite/single-exec/00148.c.otags new file mode 100644 index 0000000..3e9da06 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00148.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0163-array.c diff --git a/test/regress/c-testsuite/single-exec/00148.c.tags b/test/regress/c-testsuite/single-exec/00148.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00148.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00149.c b/test/regress/c-testsuite/single-exec/00149.c new file mode 100644 index 0000000..8da7b2b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00149.c @@ -0,0 +1,12 @@ +struct S { int a; int b; }; +struct S *s = &(struct S) { 1, 2 }; + +int +main() +{ + if(s->a != 1) + return 1; + if(s->b != 2) + return 2; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00149.c.expected b/test/regress/c-testsuite/single-exec/00149.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00149.c.otags b/test/regress/c-testsuite/single-exec/00149.c.otags new file mode 100644 index 0000000..1becd03 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00149.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0164-struct.c diff --git a/test/regress/c-testsuite/single-exec/00149.c.tags b/test/regress/c-testsuite/single-exec/00149.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00149.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00150.c b/test/regress/c-testsuite/single-exec/00150.c new file mode 100644 index 0000000..1c94454 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00150.c @@ -0,0 +1,33 @@ +struct S1 { + int a; + int b; +}; +struct S2 { + struct S1 s1; + struct S1 *ps1; + int arr[2]; +}; +struct S1 gs1 = { .a = 1, 2 }; +struct S2 *s = &(struct S2) { + {.b = 2, .a = 1}, + &gs1, + {[0] = 1, 1+1} +}; + +int +main() +{ + if(s->s1.a != 1) + return 1; + if(s->s1.b != 2) + return 2; + if(s->ps1->a != 1) + return 3; + if(s->ps1->b != 2) + return 4; + if(s->arr[0] != 1) + return 5; + if(s->arr[1] != 2) + return 6; + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00150.c.expected b/test/regress/c-testsuite/single-exec/00150.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00150.c.otags b/test/regress/c-testsuite/single-exec/00150.c.otags new file mode 100644 index 0000000..3095a7a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00150.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0165-struct.c diff --git a/test/regress/c-testsuite/single-exec/00150.c.tags b/test/regress/c-testsuite/single-exec/00150.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00150.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00151.c b/test/regress/c-testsuite/single-exec/00151.c new file mode 100644 index 0000000..e7893a0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00151.c @@ -0,0 +1,16 @@ +int arr[][3][5] = { + { + { 0, 0, 3, 5 }, + { 1, [3] = 6, 7 }, + }, + { + { 1, 2 }, + { [4] = 7, }, + }, +}; + +int +main(void) +{ + return !(arr[0][1][4] == arr[1][1][4]); +} diff --git a/test/regress/c-testsuite/single-exec/00151.c.expected b/test/regress/c-testsuite/single-exec/00151.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00151.c.otags b/test/regress/c-testsuite/single-exec/00151.c.otags new file mode 100644 index 0000000..c38b70d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00151.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0168-array.c diff --git a/test/regress/c-testsuite/single-exec/00151.c.tags b/test/regress/c-testsuite/single-exec/00151.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00151.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00152.c b/test/regress/c-testsuite/single-exec/00152.c new file mode 100644 index 0000000..252d026 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00152.c @@ -0,0 +1,13 @@ +#undef line +#define line 1000 + +#line line +#if 1000 != __LINE__ + #error " # line line" not work as expected +#endif + +int +main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00152.c.expected b/test/regress/c-testsuite/single-exec/00152.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00152.c.otags b/test/regress/c-testsuite/single-exec/00152.c.otags new file mode 100644 index 0000000..76b075a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00152.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0170-line.c diff --git a/test/regress/c-testsuite/single-exec/00152.c.tags b/test/regress/c-testsuite/single-exec/00152.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00152.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00153.c b/test/regress/c-testsuite/single-exec/00153.c new file mode 100644 index 0000000..eabbaae --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00153.c @@ -0,0 +1,13 @@ +#define x f +#define y() f + +typedef struct { int f; } S; + +int +main() +{ + S s; + + s.x = 0; + return s.y(); +} diff --git a/test/regress/c-testsuite/single-exec/00153.c.expected b/test/regress/c-testsuite/single-exec/00153.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00153.c.otags b/test/regress/c-testsuite/single-exec/00153.c.otags new file mode 100644 index 0000000..7eb79a1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00153.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0173-macro.c diff --git a/test/regress/c-testsuite/single-exec/00153.c.tags b/test/regress/c-testsuite/single-exec/00153.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00153.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00154.c b/test/regress/c-testsuite/single-exec/00154.c new file mode 100644 index 0000000..c5d48c5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00154.c @@ -0,0 +1,31 @@ +#include + +struct fred +{ + int boris; + int natasha; +}; + +int main() +{ + struct fred bloggs; + + bloggs.boris = 12; + bloggs.natasha = 34; + + printf("%d\n", bloggs.boris); + printf("%d\n", bloggs.natasha); + + struct fred jones[2]; + jones[0].boris = 12; + jones[0].natasha = 34; + jones[1].boris = 56; + jones[1].natasha = 78; + + printf("%d\n", jones[0].boris); + printf("%d\n", jones[0].natasha); + printf("%d\n", jones[1].boris); + printf("%d\n", jones[1].natasha); + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00154.c.expected b/test/regress/c-testsuite/single-exec/00154.c.expected new file mode 100644 index 0000000..ecbf589 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00154.c.expected @@ -0,0 +1,6 @@ +12 +34 +12 +34 +56 +78 diff --git a/test/regress/c-testsuite/single-exec/00154.c.otags b/test/regress/c-testsuite/single-exec/00154.c.otags new file mode 100644 index 0000000..757ba7e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00154.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/03_struct.c diff --git a/test/regress/c-testsuite/single-exec/00154.c.tags b/test/regress/c-testsuite/single-exec/00154.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00154.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00155.c b/test/regress/c-testsuite/single-exec/00155.c new file mode 100644 index 0000000..ead3cae --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00155.c @@ -0,0 +1,7 @@ + +int +main(void) +{ + sizeof((int) 1); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00155.c.expected b/test/regress/c-testsuite/single-exec/00155.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00155.c.otags b/test/regress/c-testsuite/single-exec/00155.c.otags new file mode 100644 index 0000000..f8542b2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00155.c.otags @@ -0,0 +1,4 @@ +org=www.simple-cc.org +repository=git://git.simple-cc.org/scc +version=355356a9836e487939cf5e98b5332a63e5264e27 +path=tests/scc/execute/0179-sizeof.c diff --git a/test/regress/c-testsuite/single-exec/00155.c.tags b/test/regress/c-testsuite/single-exec/00155.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00155.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00156.c b/test/regress/c-testsuite/single-exec/00156.c new file mode 100644 index 0000000..312fed8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00156.c @@ -0,0 +1,15 @@ +#include + +int main() +{ + int Count; + + for (Count = 1; Count <= 10; Count++) + { + printf("%d\n", Count); + } + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00156.c.expected b/test/regress/c-testsuite/single-exec/00156.c.expected new file mode 100644 index 0000000..f00c965 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00156.c.expected @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/test/regress/c-testsuite/single-exec/00156.c.otags b/test/regress/c-testsuite/single-exec/00156.c.otags new file mode 100644 index 0000000..fa17493 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00156.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/04_for.c diff --git a/test/regress/c-testsuite/single-exec/00156.c.tags b/test/regress/c-testsuite/single-exec/00156.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00156.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00157.c b/test/regress/c-testsuite/single-exec/00157.c new file mode 100644 index 0000000..c218f31 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00157.c @@ -0,0 +1,21 @@ +#include + +int main() +{ + int Count; + int Array[10]; + + for (Count = 1; Count <= 10; Count++) + { + Array[Count-1] = Count * Count; + } + + for (Count = 0; Count < 10; Count++) + { + printf("%d\n", Array[Count]); + } + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00157.c.expected b/test/regress/c-testsuite/single-exec/00157.c.expected new file mode 100644 index 0000000..bc7257c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00157.c.expected @@ -0,0 +1,10 @@ +1 +4 +9 +16 +25 +36 +49 +64 +81 +100 diff --git a/test/regress/c-testsuite/single-exec/00157.c.otags b/test/regress/c-testsuite/single-exec/00157.c.otags new file mode 100644 index 0000000..bb00515 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00157.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/05_array.c diff --git a/test/regress/c-testsuite/single-exec/00157.c.tags b/test/regress/c-testsuite/single-exec/00157.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00157.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00158.c b/test/regress/c-testsuite/single-exec/00158.c new file mode 100644 index 0000000..c0191e2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00158.c @@ -0,0 +1,29 @@ +#include + +int main() +{ + int Count; + + for (Count = 0; Count < 4; Count++) + { + printf("%d\n", Count); + switch (Count) + { + case 1: + printf("%d\n", 1); + break; + + case 2: + printf("%d\n", 2); + break; + + default: + printf("%d\n", 0); + break; + } + } + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00158.c.expected b/test/regress/c-testsuite/single-exec/00158.c.expected new file mode 100644 index 0000000..fab2c20 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00158.c.expected @@ -0,0 +1,8 @@ +0 +0 +1 +1 +2 +2 +3 +0 diff --git a/test/regress/c-testsuite/single-exec/00158.c.otags b/test/regress/c-testsuite/single-exec/00158.c.otags new file mode 100644 index 0000000..953593d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00158.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/06_case.c diff --git a/test/regress/c-testsuite/single-exec/00158.c.tags b/test/regress/c-testsuite/single-exec/00158.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00158.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00159.c.disable b/test/regress/c-testsuite/single-exec/00159.c.disable new file mode 100644 index 0000000..bfb0974 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00159.c.disable @@ -0,0 +1,35 @@ +#include + +int myfunc(int x) +{ + return x * x; +} + +void vfunc(int a) +{ + printf("a=%d\n", a); +} + +void qfunc() +{ + printf("qfunc()\n"); +} + +void zfunc() +{ + ((void (*)(void))0) (); +} + +int main() +{ + printf("%d\n", myfunc(3)); + printf("%d\n", myfunc(4)); + + vfunc(1234); + + qfunc(); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00159.c.expected b/test/regress/c-testsuite/single-exec/00159.c.expected new file mode 100644 index 0000000..8ffb0a7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00159.c.expected @@ -0,0 +1,4 @@ +9 +16 +a=1234 +qfunc() diff --git a/test/regress/c-testsuite/single-exec/00159.c.otags b/test/regress/c-testsuite/single-exec/00159.c.otags new file mode 100644 index 0000000..73d6021 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00159.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/07_function.c diff --git a/test/regress/c-testsuite/single-exec/00159.c.tags b/test/regress/c-testsuite/single-exec/00159.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00159.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00160.c b/test/regress/c-testsuite/single-exec/00160.c new file mode 100644 index 0000000..602ffc7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00160.c @@ -0,0 +1,24 @@ +#include + +int main() +{ + int a; + int p; + int t; + + a = 1; + p = 0; + t = 0; + + while (a < 100) + { + printf("%d\n", a); + t = a; + a = t + p; + p = t; + } + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00160.c.expected b/test/regress/c-testsuite/single-exec/00160.c.expected new file mode 100644 index 0000000..702d4c0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00160.c.expected @@ -0,0 +1,11 @@ +1 +1 +2 +3 +5 +8 +13 +21 +34 +55 +89 diff --git a/test/regress/c-testsuite/single-exec/00160.c.otags b/test/regress/c-testsuite/single-exec/00160.c.otags new file mode 100644 index 0000000..b75eb11 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00160.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/08_while.c diff --git a/test/regress/c-testsuite/single-exec/00160.c.tags b/test/regress/c-testsuite/single-exec/00160.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00160.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00161.c b/test/regress/c-testsuite/single-exec/00161.c new file mode 100644 index 0000000..1d3315d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00161.c @@ -0,0 +1,24 @@ +#include + +int main() +{ + int a; + int p; + int t; + + a = 1; + p = 0; + t = 0; + + do + { + printf("%d\n", a); + t = a; + a = t + p; + p = t; + } while (a < 100); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00161.c.expected b/test/regress/c-testsuite/single-exec/00161.c.expected new file mode 100644 index 0000000..702d4c0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00161.c.expected @@ -0,0 +1,11 @@ +1 +1 +2 +3 +5 +8 +13 +21 +34 +55 +89 diff --git a/test/regress/c-testsuite/single-exec/00161.c.otags b/test/regress/c-testsuite/single-exec/00161.c.otags new file mode 100644 index 0000000..d21148b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00161.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/09_do_while.c diff --git a/test/regress/c-testsuite/single-exec/00161.c.tags b/test/regress/c-testsuite/single-exec/00161.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00161.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00162.c b/test/regress/c-testsuite/single-exec/00162.c new file mode 100644 index 0000000..46950aa --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00162.c @@ -0,0 +1,34 @@ +void foo(int [5]); +void fooc(int x[const 5]); +void foos(int x[static 5]); +void foov(int x[volatile 5]); +void foor(int x[restrict 5]); +void fooc(int [const 5]); +void foos(int [static 5]); +void foov(int [volatile 5]); +void foor(int [restrict 5]); +void fooc(int (* const x)); +void foos(int *x); +void foov(int * volatile x); +void foor(int * restrict x); +void fooc(int x[volatile 5]) +{ + x[3] = 42; +#ifdef INVALID + x = 0; +#endif +} +void foovm(int x[const *]); +void foovm(int * const x); +#ifdef INVALID +void wrongc(int x[3][const 4]); +void wrongvm(int x[static *]); +void foovm(int x[const *]) +{ + x[2] = 1; +} +#endif +int main() +{ + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00162.c.expected b/test/regress/c-testsuite/single-exec/00162.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00162.c.otags b/test/regress/c-testsuite/single-exec/00162.c.otags new file mode 100644 index 0000000..ab51ef1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00162.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/100_c99array-decls.c diff --git a/test/regress/c-testsuite/single-exec/00162.c.tags b/test/regress/c-testsuite/single-exec/00162.c.tags new file mode 100644 index 0000000..f7c08bd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00162.c.tags @@ -0,0 +1,3 @@ +portable +c99 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00163.c b/test/regress/c-testsuite/single-exec/00163.c new file mode 100644 index 0000000..0177f4d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00163.c @@ -0,0 +1,40 @@ +#include + +struct ziggy +{ + int a; + int b; + int c; +} bolshevic; + +int main() +{ + int a; + int *b; + int c; + + a = 42; + b = &a; + printf("a = %d\n", *b); + + bolshevic.a = 12; + bolshevic.b = 34; + bolshevic.c = 56; + + printf("bolshevic.a = %d\n", bolshevic.a); + printf("bolshevic.b = %d\n", bolshevic.b); + printf("bolshevic.c = %d\n", bolshevic.c); + + struct ziggy *tsar = &bolshevic; + + printf("tsar->a = %d\n", tsar->a); + printf("tsar->b = %d\n", tsar->b); + printf("tsar->c = %d\n", tsar->c); + + b = &(bolshevic.b); + printf("bolshevic.b = %d\n", *b); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00163.c.expected b/test/regress/c-testsuite/single-exec/00163.c.expected new file mode 100644 index 0000000..1e3c473 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00163.c.expected @@ -0,0 +1,8 @@ +a = 42 +bolshevic.a = 12 +bolshevic.b = 34 +bolshevic.c = 56 +tsar->a = 12 +tsar->b = 34 +tsar->c = 56 +bolshevic.b = 34 diff --git a/test/regress/c-testsuite/single-exec/00163.c.otags b/test/regress/c-testsuite/single-exec/00163.c.otags new file mode 100644 index 0000000..5960846 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00163.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/10_pointer.c diff --git a/test/regress/c-testsuite/single-exec/00163.c.tags b/test/regress/c-testsuite/single-exec/00163.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00163.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00164.c b/test/regress/c-testsuite/single-exec/00164.c new file mode 100644 index 0000000..db2049d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00164.c @@ -0,0 +1,40 @@ +#include + +int main() +{ + int a; + int b; + int c; + int d; + int e; + int f; + int x; + int y; + + a = 12; + b = 34; + c = 56; + d = 78; + e = 0; + f = 1; + + printf("%d\n", c + d); + printf("%d\n", (y = c + d)); + printf("%d\n", e || e && f); + printf("%d\n", e || f && f); + printf("%d\n", e && e || f); + printf("%d\n", e && f || f); + printf("%d\n", a && f | f); + printf("%d\n", a | b ^ c & d); + printf("%d, %d\n", a == a, a == b); + printf("%d, %d\n", a != a, a != b); + printf("%d\n", a != b && c != d); + printf("%d\n", a + b * c / f); + printf("%d\n", a + b * c / f); + printf("%d\n", (4 << 4)); + printf("%d\n", (64 >> 4)); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00164.c.expected b/test/regress/c-testsuite/single-exec/00164.c.expected new file mode 100644 index 0000000..b692396 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00164.c.expected @@ -0,0 +1,15 @@ +134 +134 +0 +1 +1 +1 +1 +46 +1, 0 +0, 1 +1 +1916 +1916 +64 +4 diff --git a/test/regress/c-testsuite/single-exec/00164.c.otags b/test/regress/c-testsuite/single-exec/00164.c.otags new file mode 100644 index 0000000..3312682 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00164.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/11_precedence.c diff --git a/test/regress/c-testsuite/single-exec/00164.c.tags b/test/regress/c-testsuite/single-exec/00164.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00164.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00165.c b/test/regress/c-testsuite/single-exec/00165.c new file mode 100644 index 0000000..5c521e0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00165.c @@ -0,0 +1,14 @@ +#include + +#define FRED 12 +#define BLOGGS(x) (12*(x)) + +int main() +{ + printf("%d\n", FRED); + printf("%d, %d, %d\n", BLOGGS(1), BLOGGS(2), BLOGGS(3)); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00165.c.expected b/test/regress/c-testsuite/single-exec/00165.c.expected new file mode 100644 index 0000000..99f2ed5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00165.c.expected @@ -0,0 +1,2 @@ +12 +12, 24, 36 diff --git a/test/regress/c-testsuite/single-exec/00165.c.otags b/test/regress/c-testsuite/single-exec/00165.c.otags new file mode 100644 index 0000000..e88a1f0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00165.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/12_hashdefine.c diff --git a/test/regress/c-testsuite/single-exec/00165.c.tags b/test/regress/c-testsuite/single-exec/00165.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00165.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00166.c b/test/regress/c-testsuite/single-exec/00166.c new file mode 100644 index 0000000..e67db4a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00166.c @@ -0,0 +1,18 @@ +#include + +int main() +{ + int a = 24680; + int b = 01234567; + int c = 0x2468ac; + int d = 0x2468AC; + + printf("%d\n", a); + printf("%d\n", b); + printf("%d\n", c); + printf("%d\n", d); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00166.c.expected b/test/regress/c-testsuite/single-exec/00166.c.expected new file mode 100644 index 0000000..7e219ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00166.c.expected @@ -0,0 +1,4 @@ +24680 +342391 +2386092 +2386092 diff --git a/test/regress/c-testsuite/single-exec/00166.c.otags b/test/regress/c-testsuite/single-exec/00166.c.otags new file mode 100644 index 0000000..defb334 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00166.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/13_integer_literals.c diff --git a/test/regress/c-testsuite/single-exec/00166.c.tags b/test/regress/c-testsuite/single-exec/00166.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00166.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00167.c b/test/regress/c-testsuite/single-exec/00167.c new file mode 100644 index 0000000..2bd2550 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00167.c @@ -0,0 +1,21 @@ +#include + +int main() +{ + int a = 1; + + if (a) + printf("a is true\n"); + else + printf("a is false\n"); + + int b = 0; + if (b) + printf("b is true\n"); + else + printf("b is false\n"); + + return 0; +} + +// vim: set expandtab ts=4 sw=3 sts=3 tw=80 : diff --git a/test/regress/c-testsuite/single-exec/00167.c.expected b/test/regress/c-testsuite/single-exec/00167.c.expected new file mode 100644 index 0000000..c32c415 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00167.c.expected @@ -0,0 +1,2 @@ +a is true +b is false diff --git a/test/regress/c-testsuite/single-exec/00167.c.otags b/test/regress/c-testsuite/single-exec/00167.c.otags new file mode 100644 index 0000000..0c80a0a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00167.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/14_if.c diff --git a/test/regress/c-testsuite/single-exec/00167.c.tags b/test/regress/c-testsuite/single-exec/00167.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00167.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00168.c b/test/regress/c-testsuite/single-exec/00168.c new file mode 100644 index 0000000..f79a00d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00168.c @@ -0,0 +1,21 @@ +#include + +int factorial(int i) +{ + if (i < 2) + return i; + else + return i * factorial(i - 1); +} + +int main() +{ + int Count; + + for (Count = 1; Count <= 10; Count++) + printf("%d\n", factorial(Count)); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00168.c.expected b/test/regress/c-testsuite/single-exec/00168.c.expected new file mode 100644 index 0000000..db47b28 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00168.c.expected @@ -0,0 +1,10 @@ +1 +2 +6 +24 +120 +720 +5040 +40320 +362880 +3628800 diff --git a/test/regress/c-testsuite/single-exec/00168.c.otags b/test/regress/c-testsuite/single-exec/00168.c.otags new file mode 100644 index 0000000..b2e3712 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00168.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/15_recursion.c diff --git a/test/regress/c-testsuite/single-exec/00168.c.tags b/test/regress/c-testsuite/single-exec/00168.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00168.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00169.c b/test/regress/c-testsuite/single-exec/00169.c new file mode 100644 index 0000000..2b72cc0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00169.c @@ -0,0 +1,21 @@ +#include + +int main() +{ + int x, y, z; + + for (x = 0; x < 2; x++) + { + for (y = 0; y < 3; y++) + { + for (z = 0; z < 3; z++) + { + printf("%d %d %d\n", x, y, z); + } + } + } + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00169.c.expected b/test/regress/c-testsuite/single-exec/00169.c.expected new file mode 100644 index 0000000..5a3431e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00169.c.expected @@ -0,0 +1,18 @@ +0 0 0 +0 0 1 +0 0 2 +0 1 0 +0 1 1 +0 1 2 +0 2 0 +0 2 1 +0 2 2 +1 0 0 +1 0 1 +1 0 2 +1 1 0 +1 1 1 +1 1 2 +1 2 0 +1 2 1 +1 2 2 diff --git a/test/regress/c-testsuite/single-exec/00169.c.otags b/test/regress/c-testsuite/single-exec/00169.c.otags new file mode 100644 index 0000000..c21bd61 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00169.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/16_nesting.c diff --git a/test/regress/c-testsuite/single-exec/00169.c.tags b/test/regress/c-testsuite/single-exec/00169.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00169.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00170.c b/test/regress/c-testsuite/single-exec/00170.c new file mode 100644 index 0000000..e2bc736 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00170.c @@ -0,0 +1,72 @@ +#include + +enum fred +{ + a, + b, + c, + d, + e = 54, + f = 73, + g, + h +}; + +/* All following uses of enum efoo should compile + without warning. While forward enums aren't ISO C, + it's accepted by GCC also in strict mode, and only warned + about with -pedantic. This happens in the real world. */ +/* Strict ISO C doesn't allow this kind of forward declaration of + enums, but GCC accepts it (and gives only pedantic warning), and + it occurs in the wild. */ +enum efoo; +struct Sforward_use { + int (*fmember) (enum efoo x); +}; + +extern enum efoo it_real_fn(void); +enum efoo { + ONE, + TWO, +}; +struct S2 { + enum efoo (*f2) (void); +}; +void should_compile(struct S2 *s) +{ + s->f2 = it_real_fn; +} + +enum efoo it_real_fn(void) +{ + return TWO; +} + +static unsigned int deref_uintptr(unsigned int *p) +{ + return *p; +} + +enum Epositive { + epos_one, epos_two +}; + +int main() +{ + enum fred frod; + enum Epositive epos = epos_two; + + printf("%d %d %d %d %d %d %d %d\n", a, b, c, d, e, f, g, h); + /* printf("%d\n", frod); */ + frod = 12; + printf("%d\n", frod); + frod = e; + printf("%d\n", frod); + + /* Following should compile without warning. */ + printf ("enum to int: %u\n", deref_uintptr(&epos)); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00170.c.expected b/test/regress/c-testsuite/single-exec/00170.c.expected new file mode 100644 index 0000000..d453a61 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00170.c.expected @@ -0,0 +1,4 @@ +0 1 2 3 54 73 74 75 +12 +54 +enum to int: 1 diff --git a/test/regress/c-testsuite/single-exec/00170.c.otags b/test/regress/c-testsuite/single-exec/00170.c.otags new file mode 100644 index 0000000..d458568 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00170.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/17_enum.c diff --git a/test/regress/c-testsuite/single-exec/00170.c.tags b/test/regress/c-testsuite/single-exec/00170.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00170.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00171.c b/test/regress/c-testsuite/single-exec/00171.c new file mode 100644 index 0000000..aff65e5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00171.c @@ -0,0 +1,28 @@ +#include + +int main() +{ + int a; + int *b; + int *c; + + a = 42; + b = &a; + c = NULL; + + printf("%d\n", *b); + + if (b == NULL) + printf("b is NULL\n"); + else + printf("b is not NULL\n"); + + if (c == NULL) + printf("c is NULL\n"); + else + printf("c is not NULL\n"); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00171.c.expected b/test/regress/c-testsuite/single-exec/00171.c.expected new file mode 100644 index 0000000..0cf781b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00171.c.expected @@ -0,0 +1,3 @@ +42 +b is not NULL +c is NULL diff --git a/test/regress/c-testsuite/single-exec/00171.c.otags b/test/regress/c-testsuite/single-exec/00171.c.otags new file mode 100644 index 0000000..85a48be --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00171.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/19_pointer_arithmetic.c diff --git a/test/regress/c-testsuite/single-exec/00171.c.tags b/test/regress/c-testsuite/single-exec/00171.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00171.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00172.c b/test/regress/c-testsuite/single-exec/00172.c new file mode 100644 index 0000000..825f778 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00172.c @@ -0,0 +1,24 @@ +#include + +int main() +{ + int a; + int b; + int *d; + int *e; + d = &a; + e = &b; + a = 12; + b = 34; + printf("%d\n", *d); + printf("%d\n", *e); + printf("%d\n", d == e); + printf("%d\n", d != e); + d = e; + printf("%d\n", d == e); + printf("%d\n", d != e); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00172.c.expected b/test/regress/c-testsuite/single-exec/00172.c.expected new file mode 100644 index 0000000..5d1e5f5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00172.c.expected @@ -0,0 +1,6 @@ +12 +34 +0 +1 +1 +0 diff --git a/test/regress/c-testsuite/single-exec/00172.c.otags b/test/regress/c-testsuite/single-exec/00172.c.otags new file mode 100644 index 0000000..7d71221 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00172.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/20_pointer_comparison.c diff --git a/test/regress/c-testsuite/single-exec/00172.c.tags b/test/regress/c-testsuite/single-exec/00172.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00172.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00173.c b/test/regress/c-testsuite/single-exec/00173.c new file mode 100644 index 0000000..f22f527 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00173.c @@ -0,0 +1,33 @@ +#include + +int main() +{ + int x = 'a'; + char y = x; + + char *a = "hello"; + + printf("%s\n", a); + + int c; + c = *a; + + char *b; + for (b = a; *b != 0; b++) + printf("%c: %d\n", *b, *b); + + char destarray[10]; + char *dest = &destarray[0]; + char *src = a; + + while (*src != 0) + *dest++ = *src++; + + *dest = 0; + + printf("copied string is %s\n", destarray); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00173.c.expected b/test/regress/c-testsuite/single-exec/00173.c.expected new file mode 100644 index 0000000..dbc6068 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00173.c.expected @@ -0,0 +1,7 @@ +hello +h: 104 +e: 101 +l: 108 +l: 108 +o: 111 +copied string is hello diff --git a/test/regress/c-testsuite/single-exec/00173.c.otags b/test/regress/c-testsuite/single-exec/00173.c.otags new file mode 100644 index 0000000..ab1d4ab --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00173.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/21_char_array.c diff --git a/test/regress/c-testsuite/single-exec/00173.c.tags b/test/regress/c-testsuite/single-exec/00173.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00173.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00174.c b/test/regress/c-testsuite/single-exec/00174.c new file mode 100644 index 0000000..e3491f5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00174.c @@ -0,0 +1,50 @@ +#include +#include + +int main() +{ + // variables + float a = 12.34 + 56.78; + printf("%f\n", a); + + // infix operators + printf("%f\n", 12.34 + 56.78); + printf("%f\n", 12.34 - 56.78); + printf("%f\n", 12.34 * 56.78); + printf("%f\n", 12.34 / 56.78); + + // comparison operators + printf("%d %d %d %d %d %d\n", 12.34 < 56.78, 12.34 <= 56.78, 12.34 == 56.78, 12.34 >= 56.78, 12.34 > 56.78, 12.34 != 56.78); + printf("%d %d %d %d %d %d\n", 12.34 < 12.34, 12.34 <= 12.34, 12.34 == 12.34, 12.34 >= 12.34, 12.34 > 12.34, 12.34 != 12.34); + printf("%d %d %d %d %d %d\n", 56.78 < 12.34, 56.78 <= 12.34, 56.78 == 12.34, 56.78 >= 12.34, 56.78 > 12.34, 56.78 != 12.34); + + // assignment operators + a = 12.34; + a += 56.78; + printf("%f\n", a); + + a = 12.34; + a -= 56.78; + printf("%f\n", a); + + a = 12.34; + a *= 56.78; + printf("%f\n", a); + + a = 12.34; + a /= 56.78; + printf("%f\n", a); + + // prefix operators + printf("%f\n", +12.34); + printf("%f\n", -12.34); + + // type coercion + a = 2; + printf("%f\n", a); + printf("%f\n", sin(2)); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00174.c.expected b/test/regress/c-testsuite/single-exec/00174.c.expected new file mode 100644 index 0000000..75ea3a7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00174.c.expected @@ -0,0 +1,16 @@ +69.120003 +69.120000 +-44.440000 +700.665200 +0.217330 +1 1 0 0 0 1 +0 1 1 1 0 0 +0 0 0 1 1 1 +69.120003 +-44.439999 +700.665222 +0.217330 +12.340000 +-12.340000 +2.000000 +0.909297 diff --git a/test/regress/c-testsuite/single-exec/00174.c.otags b/test/regress/c-testsuite/single-exec/00174.c.otags new file mode 100644 index 0000000..6cb2d63 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00174.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/22_floating_point.c diff --git a/test/regress/c-testsuite/single-exec/00174.c.tags b/test/regress/c-testsuite/single-exec/00174.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00174.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00175.c b/test/regress/c-testsuite/single-exec/00175.c new file mode 100644 index 0000000..1fcc335 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00175.c @@ -0,0 +1,54 @@ +#include + +void charfunc(char a) +{ + printf("char: %c\n", a); +} + +void intfunc(int a) +{ + printf("int: %d\n", a); +} + +void floatfunc(float a) +{ + printf("float: %f\n", a); +} + +int main() +{ + charfunc('a'); + charfunc(98); + charfunc(99.0); + + intfunc('a'); + intfunc(98); + intfunc(99.0); + + floatfunc('a'); + floatfunc(98); + floatfunc(99.0); + + /* printf("%c %d %f\n", 'a', 'b', 'c'); */ + /* printf("%c %d %f\n", 97, 98, 99); */ + /* printf("%c %d %f\n", 97.0, 98.0, 99.0); */ + + char b = 97; + char c = 97.0; + + printf("%d %d\n", b, c); + + int d = 'a'; + int e = 97.0; + + printf("%d %d\n", d, e); + + float f = 'a'; + float g = 97; + + printf("%f %f\n", f, g); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00175.c.expected b/test/regress/c-testsuite/single-exec/00175.c.expected new file mode 100644 index 0000000..d9076f0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00175.c.expected @@ -0,0 +1,12 @@ +char: a +char: b +char: c +int: 97 +int: 98 +int: 99 +float: 97.000000 +float: 98.000000 +float: 99.000000 +97 97 +97 97 +97.000000 97.000000 diff --git a/test/regress/c-testsuite/single-exec/00175.c.otags b/test/regress/c-testsuite/single-exec/00175.c.otags new file mode 100644 index 0000000..79130a6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00175.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/23_type_coercion.c diff --git a/test/regress/c-testsuite/single-exec/00175.c.tags b/test/regress/c-testsuite/single-exec/00175.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00175.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00176.c b/test/regress/c-testsuite/single-exec/00176.c new file mode 100644 index 0000000..5cc08bd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00176.c @@ -0,0 +1,83 @@ +#include + +int array[16]; + +//Swap integer values by array indexes +void swap(int a, int b) +{ + int tmp = array[a]; + array[a] = array[b]; + array[b] = tmp; +} + +//Partition the array into two halves and return the +//index about which the array is partitioned +int partition(int left, int right) +{ + int pivotIndex = left; + int pivotValue = array[pivotIndex]; + int index = left; + int i; + + swap(pivotIndex, right); + for(i = left; i < right; i++) + { + if(array[i] < pivotValue) + { + swap(i, index); + index += 1; + } + } + swap(right, index); + + return index; +} + +//Quicksort the array +void quicksort(int left, int right) +{ + if(left >= right) + return; + + int index = partition(left, right); + quicksort(left, index - 1); + quicksort(index + 1, right); +} + +int main() +{ + int i; + + array[0] = 62; + array[1] = 83; + array[2] = 4; + array[3] = 89; + array[4] = 36; + array[5] = 21; + array[6] = 74; + array[7] = 37; + array[8] = 65; + array[9] = 33; + array[10] = 96; + array[11] = 38; + array[12] = 53; + array[13] = 16; + array[14] = 74; + array[15] = 55; + + for (i = 0; i < 16; i++) + printf("%d ", array[i]); + + printf("\n"); + + quicksort(0, 15); + + for (i = 0; i < 16; i++) + printf("%d ", array[i]); + + printf("\n"); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00176.c.expected b/test/regress/c-testsuite/single-exec/00176.c.expected new file mode 100644 index 0000000..2d39cd3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00176.c.expected @@ -0,0 +1,2 @@ +62 83 4 89 36 21 74 37 65 33 96 38 53 16 74 55 +4 16 21 33 36 37 38 53 55 62 65 74 74 83 89 96 diff --git a/test/regress/c-testsuite/single-exec/00176.c.otags b/test/regress/c-testsuite/single-exec/00176.c.otags new file mode 100644 index 0000000..e3e263b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00176.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/25_quicksort.c diff --git a/test/regress/c-testsuite/single-exec/00176.c.tags b/test/regress/c-testsuite/single-exec/00176.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00176.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00177.c b/test/regress/c-testsuite/single-exec/00177.c new file mode 100644 index 0000000..95c4423 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00177.c @@ -0,0 +1,17 @@ +#include + +int main() +{ + printf("%d\n", '\1'); + printf("%d\n", '\10'); + printf("%d\n", '\100'); + printf("%d\n", '\x01'); + printf("%d\n", '\x0e'); + printf("%d\n", '\x10'); + printf("%d\n", '\x40'); + printf("test \x40\n"); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00177.c.expected b/test/regress/c-testsuite/single-exec/00177.c.expected new file mode 100644 index 0000000..8f8bfa4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00177.c.expected @@ -0,0 +1,8 @@ +1 +8 +64 +1 +14 +16 +64 +test @ diff --git a/test/regress/c-testsuite/single-exec/00177.c.otags b/test/regress/c-testsuite/single-exec/00177.c.otags new file mode 100644 index 0000000..a9e3375 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00177.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/26_character_constants.c diff --git a/test/regress/c-testsuite/single-exec/00177.c.tags b/test/regress/c-testsuite/single-exec/00177.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00177.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00178.c b/test/regress/c-testsuite/single-exec/00178.c new file mode 100644 index 0000000..5ae0ede --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00178.c @@ -0,0 +1,18 @@ +#include + +int main() +{ + char a; + int b; + double c; + + printf("%d\n", sizeof(a)); + printf("%d\n", sizeof(b)); + printf("%d\n", sizeof(c)); + + printf("%d\n", sizeof(!a)); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00178.c.expected b/test/regress/c-testsuite/single-exec/00178.c.expected new file mode 100644 index 0000000..a47ea3a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00178.c.expected @@ -0,0 +1,4 @@ +1 +4 +8 +4 diff --git a/test/regress/c-testsuite/single-exec/00178.c.otags b/test/regress/c-testsuite/single-exec/00178.c.otags new file mode 100644 index 0000000..496a249 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00178.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/27_sizeof.c diff --git a/test/regress/c-testsuite/single-exec/00178.c.tags b/test/regress/c-testsuite/single-exec/00178.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00178.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00179.c b/test/regress/c-testsuite/single-exec/00179.c new file mode 100644 index 0000000..2db2298 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00179.c @@ -0,0 +1,45 @@ +#include +#include + +int main() +{ + char a[10]; + + strcpy(a, "hello"); + printf("%s\n", a); + + strncpy(a, "gosh", 2); + printf("%s\n", a); + + printf("%d\n", strcmp(a, "apple") > 0); + printf("%d\n", strcmp(a, "goere") > 0); + printf("%d\n", strcmp(a, "zebra") < 0); + + printf("%d\n", strlen(a)); + + strcat(a, "!"); + printf("%s\n", a); + + printf("%d\n", strncmp(a, "apple", 2) > 0); + printf("%d\n", strncmp(a, "goere", 2) == 0); + printf("%d\n", strncmp(a, "goerg", 2) == 0); + printf("%d\n", strncmp(a, "zebra", 2) < 0); + + printf("%s\n", strchr(a, 'o')); + printf("%s\n", strrchr(a, 'l')); + printf("%d\n", strrchr(a, 'x') == NULL); + + memset(&a[1], 'r', 4); + printf("%s\n", a); + + memcpy(&a[2], a, 2); + printf("%s\n", a); + + printf("%d\n", memcmp(a, "apple", 4) > 0); + printf("%d\n", memcmp(a, "grgr", 4) == 0); + printf("%d\n", memcmp(a, "zebra", 4) < 0); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00179.c.expected b/test/regress/c-testsuite/single-exec/00179.c.expected new file mode 100644 index 0000000..fd9217a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00179.c.expected @@ -0,0 +1,19 @@ +hello +gollo +1 +1 +1 +5 +gollo! +1 +1 +1 +1 +ollo! +lo! +1 +grrrr! +grgrr! +1 +1 +1 diff --git a/test/regress/c-testsuite/single-exec/00179.c.otags b/test/regress/c-testsuite/single-exec/00179.c.otags new file mode 100644 index 0000000..f906e3f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00179.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/28_strings.c diff --git a/test/regress/c-testsuite/single-exec/00179.c.tags b/test/regress/c-testsuite/single-exec/00179.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00179.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00180.c b/test/regress/c-testsuite/single-exec/00180.c new file mode 100644 index 0000000..bda5ddd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00180.c @@ -0,0 +1,13 @@ +#include +#include + +int main() +{ + char a[10]; + strcpy(a, "abcdef"); + printf("%s\n", &a[1]); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00180.c.expected b/test/regress/c-testsuite/single-exec/00180.c.expected new file mode 100644 index 0000000..9bc8683 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00180.c.expected @@ -0,0 +1 @@ +bcdef diff --git a/test/regress/c-testsuite/single-exec/00180.c.otags b/test/regress/c-testsuite/single-exec/00180.c.otags new file mode 100644 index 0000000..97aa5a5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00180.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/29_array_address.c diff --git a/test/regress/c-testsuite/single-exec/00180.c.tags b/test/regress/c-testsuite/single-exec/00180.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00180.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00181.c b/test/regress/c-testsuite/single-exec/00181.c new file mode 100644 index 0000000..7c0893b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00181.c @@ -0,0 +1,122 @@ +/* example from http://barnyard.syr.edu/quickies/hanoi.c */ + +/* hanoi.c: solves the tower of hanoi problem. (Programming exercise.) */ +/* By Terry R. McConnell (12/2/97) */ +/* Compile: cc -o hanoi hanoi.c */ + +/* This program does no error checking. But then, if it's right, + it's right ... right ? */ + + +/* The original towers of hanoi problem seems to have been originally posed + by one M. Claus in 1883. There is a popular legend that goes along with + it that has been often repeated and paraphrased. It goes something like this: + In the great temple at Benares there are 3 golden spikes. On one of them, + God placed 64 disks increasing in size from bottom to top, at the beginning + of time. Since then, and to this day, the priest on duty constantly transfers + disks, one at a time, in such a way that no larger disk is ever put on top + of a smaller one. When the disks have been transferred entirely to another + spike the Universe will come to an end in a large thunderclap. + + This paraphrases the original legend due to DeParville, La Nature, Paris 1884, + Part I, 285-286. For this and further information see: Mathematical + Recreations & Essays, W.W. Rouse Ball, MacMillan, NewYork, 11th Ed. 1967, + 303-305. + * + * + */ + +#include +#include + +#define TRUE 1 +#define FALSE 0 + +/* This is the number of "disks" on tower A initially. Taken to be 64 in the + * legend. The number of moves required, in general, is 2^N - 1. For N = 64, + * this is 18,446,744,073,709,551,615 */ +#define N 4 + +/* These are the three towers. For example if the state of A is 0,1,3,4, that + * means that there are three discs on A of sizes 1, 3, and 4. (Think of right + * as being the "down" direction.) */ +int A[N], B[N], C[N]; + +void Hanoi(int,int*,int*,int*); + +/* Print the current configuration of A, B, and C to the screen */ +void PrintAll() +{ + int i; + + printf("A: "); + for(i=0;i +#include + +#define MAX_DIGITS 32 +#define NO_MAIN + + +/* Print the top line of the digit d into buffer. + Does not null terminate buffer. */ + +void topline(int d, char *p){ + + *p++ = ' '; + switch(d){ + + /* all these have _ on top line */ + + case 0: + case 2: + case 3: + case 5: + case 7: + case 8: + case 9: + *p++ = '_'; + break; + default: + *p++=' '; + + } + *p++=' '; +} + +/* Print the middle line of the digit d into the buffer. + Does not null terminate. */ + +void midline(int d, char *p){ + + switch(d){ + + /* those that have leading | on middle line */ + + case 0: + case 4: + case 5: + case 6: + case 8: + case 9: + *p++='|'; + break; + default: + *p++=' '; + } + switch(d){ + + /* those that have _ on middle line */ + + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + *p++='_'; + break; + default: + *p++=' '; + + } + switch(d){ + + /* those that have closing | on middle line */ + + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + case 8: + case 9: + *p++='|'; + break; + default: + *p++=' '; + + } +} + +/* Print the bottom line of the digit d. Does not null terminate. */ + +void botline(int d, char *p){ + + + switch(d){ + + /* those that have leading | on bottom line */ + + case 0: + case 2: + case 6: + case 8: + *p++='|'; + break; + default: + *p++=' '; + } + switch(d){ + + /* those that have _ on bottom line */ + + case 0: + case 2: + case 3: + case 5: + case 6: + case 8: + *p++='_'; + break; + default: + *p++=' '; + + } + switch(d){ + + /* those that have closing | on bottom line */ + + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + *p++='|'; + break; + default: + *p++=' '; + + } +} + +/* Write the led representation of integer to string buffer. */ + +void print_led(unsigned long x, char *buf) +{ + + int i=0,n; + static int d[MAX_DIGITS]; + + + /* extract digits from x */ + + n = ( x == 0L ? 1 : 0 ); /* 0 is a digit, hence a special case */ + + while(x){ + d[n++] = (int)(x%10L); + if(n >= MAX_DIGITS)break; + x = x/10L; + } + + /* print top lines of all digits */ + + for(i=n-1;i>=0;i--){ + topline(d[i],buf); + buf += 3; + *buf++=' '; + } + *buf++='\n'; /* move teletype to next line */ + + /* print middle lines of all digits */ + + for(i=n-1;i>=0;i--){ + midline(d[i],buf); + buf += 3; + *buf++=' '; + } + *buf++='\n'; + + /* print bottom lines of all digits */ + + for(i=n-1;i>=0;i--){ + botline(d[i],buf); + buf += 3; + *buf++=' '; + } + *buf++='\n'; + *buf='\0'; +} + +int main() +{ + char buf[5*MAX_DIGITS]; + print_led(1234567, buf); + printf("%s\n",buf); + + return 0; +} + +#ifndef NO_MAIN +int main(int argc, char **argv) +{ + + int i=0,n; + long x; + static int d[MAX_DIGITS]; + char buf[5*MAX_DIGITS]; + + if(argc != 2){ + fprintf(stderr,"led: usage: led integer\n"); + return 1; + } + + /* fetch argument from command line */ + + x = atol(argv[1]); + + /* sanity check */ + + if(x<0){ + fprintf(stderr,"led: %d must be non-negative\n",x); + return 1; + } + + print_led(x,buf); + printf("%s\n",buf); + + return 0; + +} +#endif + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00182.c.expected b/test/regress/c-testsuite/single-exec/00182.c.expected new file mode 100644 index 0000000..c53b58a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00182.c.expected @@ -0,0 +1,4 @@ + _ _ _ _ + | _| _| |_| |_ |_ | + | |_ _| | _| |_| | + diff --git a/test/regress/c-testsuite/single-exec/00182.c.otags b/test/regress/c-testsuite/single-exec/00182.c.otags new file mode 100644 index 0000000..8ab5873 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00182.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/32_led.c diff --git a/test/regress/c-testsuite/single-exec/00182.c.tags b/test/regress/c-testsuite/single-exec/00182.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00182.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00183.c b/test/regress/c-testsuite/single-exec/00183.c new file mode 100644 index 0000000..8579b50 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00183.c @@ -0,0 +1,15 @@ +#include + +int main() +{ + int Count; + + for (Count = 0; Count < 10; Count++) + { + printf("%d\n", (Count < 5) ? (Count*Count) : (Count * 3)); + } + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00183.c.expected b/test/regress/c-testsuite/single-exec/00183.c.expected new file mode 100644 index 0000000..45ea507 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00183.c.expected @@ -0,0 +1,10 @@ +0 +1 +4 +9 +16 +15 +18 +21 +24 +27 diff --git a/test/regress/c-testsuite/single-exec/00183.c.otags b/test/regress/c-testsuite/single-exec/00183.c.otags new file mode 100644 index 0000000..4c4254e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00183.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/33_ternary_op.c diff --git a/test/regress/c-testsuite/single-exec/00183.c.tags b/test/regress/c-testsuite/single-exec/00183.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00183.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00184.c b/test/regress/c-testsuite/single-exec/00184.c new file mode 100644 index 0000000..672e87e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00184.c @@ -0,0 +1,14 @@ +#include + +int main() +{ + char a; + short b; + + printf("%d %d\n", sizeof(char), sizeof(a)); + printf("%d %d\n", sizeof(short), sizeof(b)); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00184.c.expected b/test/regress/c-testsuite/single-exec/00184.c.expected new file mode 100644 index 0000000..534fb83 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00184.c.expected @@ -0,0 +1,2 @@ +1 1 +2 2 diff --git a/test/regress/c-testsuite/single-exec/00184.c.otags b/test/regress/c-testsuite/single-exec/00184.c.otags new file mode 100644 index 0000000..c4fef20 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00184.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/35_sizeof.c diff --git a/test/regress/c-testsuite/single-exec/00184.c.tags b/test/regress/c-testsuite/single-exec/00184.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00184.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00185.c b/test/regress/c-testsuite/single-exec/00185.c new file mode 100644 index 0000000..1bc8ee0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00185.c @@ -0,0 +1,21 @@ +#include + +int main() +{ + int Count; + + int Array[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753 }; + + for (Count = 0; Count < 10; Count++) + printf("%d: %d\n", Count, Array[Count]); + + int Array2[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753, }; + + for (Count = 0; Count < 10; Count++) + printf("%d: %d\n", Count, Array2[Count]); + + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00185.c.expected b/test/regress/c-testsuite/single-exec/00185.c.expected new file mode 100644 index 0000000..3ac6c77 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00185.c.expected @@ -0,0 +1,20 @@ +0: 12 +1: 34 +2: 56 +3: 78 +4: 90 +5: 123 +6: 456 +7: 789 +8: 8642 +9: 9753 +0: 12 +1: 34 +2: 56 +3: 78 +4: 90 +5: 123 +6: 456 +7: 789 +8: 8642 +9: 9753 diff --git a/test/regress/c-testsuite/single-exec/00185.c.otags b/test/regress/c-testsuite/single-exec/00185.c.otags new file mode 100644 index 0000000..70e911c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00185.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/36_array_initialisers.c diff --git a/test/regress/c-testsuite/single-exec/00185.c.tags b/test/regress/c-testsuite/single-exec/00185.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00185.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00186.c b/test/regress/c-testsuite/single-exec/00186.c new file mode 100644 index 0000000..1dd1dce --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00186.c @@ -0,0 +1,17 @@ +#include + +int main() +{ + char Buf[100]; + int Count; + + for (Count = 1; Count <= 20; Count++) + { + sprintf(Buf, "->%02d<-\n", Count); + printf("%s", Buf); + } + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00186.c.expected b/test/regress/c-testsuite/single-exec/00186.c.expected new file mode 100644 index 0000000..a643da8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00186.c.expected @@ -0,0 +1,20 @@ +->01<- +->02<- +->03<- +->04<- +->05<- +->06<- +->07<- +->08<- +->09<- +->10<- +->11<- +->12<- +->13<- +->14<- +->15<- +->16<- +->17<- +->18<- +->19<- +->20<- diff --git a/test/regress/c-testsuite/single-exec/00186.c.otags b/test/regress/c-testsuite/single-exec/00186.c.otags new file mode 100644 index 0000000..08c66f7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00186.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/37_sprintf.c diff --git a/test/regress/c-testsuite/single-exec/00186.c.tags b/test/regress/c-testsuite/single-exec/00186.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00186.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00187.c.disable b/test/regress/c-testsuite/single-exec/00187.c.disable new file mode 100644 index 0000000..b986093 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00187.c.disable @@ -0,0 +1,52 @@ +#include + +int main() +{ + FILE *f = fopen("fred.txt", "w"); + fwrite("hello\nhello\n", 1, 12, f); + fclose(f); + + char freddy[7]; + f = fopen("fred.txt", "r"); + if (fread(freddy, 1, 6, f) != 6) + printf("couldn't read fred.txt\n"); + + freddy[6] = '\0'; + fclose(f); + + printf("%s", freddy); + + int InChar; + char ShowChar; + f = fopen("fred.txt", "r"); + while ( (InChar = fgetc(f)) != EOF) + { + ShowChar = InChar; + if (ShowChar < ' ') + ShowChar = '.'; + + printf("ch: %d '%c'\n", InChar, ShowChar); + } + fclose(f); + + f = fopen("fred.txt", "r"); + while ( (InChar = getc(f)) != EOF) + { + ShowChar = InChar; + if (ShowChar < ' ') + ShowChar = '.'; + + printf("ch: %d '%c'\n", InChar, ShowChar); + } + fclose(f); + + f = fopen("fred.txt", "r"); + while (fgets(freddy, sizeof(freddy), f) != NULL) + printf("x: %s", freddy); + + fclose(f); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00187.c.expected b/test/regress/c-testsuite/single-exec/00187.c.expected new file mode 100644 index 0000000..e08167a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00187.c.expected @@ -0,0 +1,27 @@ +hello +ch: 104 'h' +ch: 101 'e' +ch: 108 'l' +ch: 108 'l' +ch: 111 'o' +ch: 10 '.' +ch: 104 'h' +ch: 101 'e' +ch: 108 'l' +ch: 108 'l' +ch: 111 'o' +ch: 10 '.' +ch: 104 'h' +ch: 101 'e' +ch: 108 'l' +ch: 108 'l' +ch: 111 'o' +ch: 10 '.' +ch: 104 'h' +ch: 101 'e' +ch: 108 'l' +ch: 108 'l' +ch: 111 'o' +ch: 10 '.' +x: hello +x: hello diff --git a/test/regress/c-testsuite/single-exec/00187.c.otags b/test/regress/c-testsuite/single-exec/00187.c.otags new file mode 100644 index 0000000..36dd4b1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00187.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/40_stdio.c diff --git a/test/regress/c-testsuite/single-exec/00187.c.tags b/test/regress/c-testsuite/single-exec/00187.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00187.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00188.c b/test/regress/c-testsuite/single-exec/00188.c new file mode 100644 index 0000000..cb37b9e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00188.c @@ -0,0 +1,85 @@ +#include + +int main() +{ + printf("#include test\n"); + +#if 1 +#if 0 + printf("a\n"); +#else + printf("b\n"); +#endif +#else +#if 0 + printf("c\n"); +#else + printf("d\n"); +#endif +#endif + +#if 0 +#if 1 + printf("e\n"); +#else + printf("f\n"); +#endif +#else +#if 1 + printf("g\n"); +#else + printf("h\n"); +#endif +#endif + +#define DEF + +#ifdef DEF +#ifdef DEF + printf("i\n"); +#else + printf("j\n"); +#endif +#else +#ifdef DEF + printf("k\n"); +#else + printf("l\n"); +#endif +#endif + +#ifndef DEF +#ifndef DEF + printf("m\n"); +#else + printf("n\n"); +#endif +#else +#ifndef DEF + printf("o\n"); +#else + printf("p\n"); +#endif +#endif + +#define ONE 1 +#define ZERO 0 + +#if ONE +#if ZERO + printf("q\n"); +#else + printf("r\n"); +#endif +#else +#if ZERO + printf("s\n"); +#else + printf("t\n"); +#endif +#endif + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00188.c.expected b/test/regress/c-testsuite/single-exec/00188.c.expected new file mode 100644 index 0000000..5fd414b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00188.c.expected @@ -0,0 +1,6 @@ +#include test +b +g +i +p +r diff --git a/test/regress/c-testsuite/single-exec/00188.c.otags b/test/regress/c-testsuite/single-exec/00188.c.otags new file mode 100644 index 0000000..e0af000 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00188.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/41_hashif.c diff --git a/test/regress/c-testsuite/single-exec/00188.c.tags b/test/regress/c-testsuite/single-exec/00188.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00188.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00189.c b/test/regress/c-testsuite/single-exec/00189.c new file mode 100644 index 0000000..697bd79 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00189.c @@ -0,0 +1,22 @@ +#include + +int fred(int p) +{ + printf("yo %d\n", p); + return 42; +} + +int (*f)(int) = &fred; + +/* To test what this is supposed to test the destination function + (fprint here) must not be called directly anywhere in the test. */ +int (*fprintfptr)(FILE *, const char *, ...) = &fprintf; + +int main() +{ + fprintfptr(stdout, "%d\n", (*f)(24)); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00189.c.expected b/test/regress/c-testsuite/single-exec/00189.c.expected new file mode 100644 index 0000000..6c8b6ce --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00189.c.expected @@ -0,0 +1,2 @@ +yo 24 +42 diff --git a/test/regress/c-testsuite/single-exec/00189.c.otags b/test/regress/c-testsuite/single-exec/00189.c.otags new file mode 100644 index 0000000..de71e1b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00189.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/42_function_pointer.c diff --git a/test/regress/c-testsuite/single-exec/00189.c.tags b/test/regress/c-testsuite/single-exec/00189.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00189.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00190.c b/test/regress/c-testsuite/single-exec/00190.c new file mode 100644 index 0000000..de17098 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00190.c @@ -0,0 +1,15 @@ +#include + +void fred(void) +{ + printf("yo\n"); +} + +int main() +{ + fred(); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00190.c.expected b/test/regress/c-testsuite/single-exec/00190.c.expected new file mode 100644 index 0000000..092bfb9 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00190.c.expected @@ -0,0 +1 @@ +yo diff --git a/test/regress/c-testsuite/single-exec/00190.c.otags b/test/regress/c-testsuite/single-exec/00190.c.otags new file mode 100644 index 0000000..769296e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00190.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/43_void_param.c diff --git a/test/regress/c-testsuite/single-exec/00190.c.tags b/test/regress/c-testsuite/single-exec/00190.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00190.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00191.c b/test/regress/c-testsuite/single-exec/00191.c new file mode 100644 index 0000000..f38664f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00191.c @@ -0,0 +1,17 @@ +#include + +int main() +{ + int a; + + for (a = 0; a < 2; a++) + { + int b = a; + } + + printf("it's all good\n"); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00191.c.expected b/test/regress/c-testsuite/single-exec/00191.c.expected new file mode 100644 index 0000000..231ccc0 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00191.c.expected @@ -0,0 +1 @@ +it's all good diff --git a/test/regress/c-testsuite/single-exec/00191.c.otags b/test/regress/c-testsuite/single-exec/00191.c.otags new file mode 100644 index 0000000..fa7fe1e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00191.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/44_scoped_declarations.c diff --git a/test/regress/c-testsuite/single-exec/00191.c.tags b/test/regress/c-testsuite/single-exec/00191.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00191.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00192.c b/test/regress/c-testsuite/single-exec/00192.c new file mode 100644 index 0000000..7cef513 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00192.c @@ -0,0 +1,18 @@ +#include + +int main() +{ + int Count = 0; + + for (;;) + { + Count++; + printf("%d\n", Count); + if (Count >= 10) + break; + } + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00192.c.expected b/test/regress/c-testsuite/single-exec/00192.c.expected new file mode 100644 index 0000000..f00c965 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00192.c.expected @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/test/regress/c-testsuite/single-exec/00192.c.otags b/test/regress/c-testsuite/single-exec/00192.c.otags new file mode 100644 index 0000000..f2ab9c1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00192.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/45_empty_for.c diff --git a/test/regress/c-testsuite/single-exec/00192.c.tags b/test/regress/c-testsuite/single-exec/00192.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00192.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00193.c b/test/regress/c-testsuite/single-exec/00193.c new file mode 100644 index 0000000..1ec7924 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00193.c @@ -0,0 +1,24 @@ +#include + +void fred(int x) +{ + switch (x) + { + case 1: printf("1\n"); return; + case 2: printf("2\n"); break; + case 3: printf("3\n"); return; + } + + printf("out\n"); +} + +int main() +{ + fred(1); + fred(2); + fred(3); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00193.c.expected b/test/regress/c-testsuite/single-exec/00193.c.expected new file mode 100644 index 0000000..b6deb7e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00193.c.expected @@ -0,0 +1,4 @@ +1 +2 +out +3 diff --git a/test/regress/c-testsuite/single-exec/00193.c.otags b/test/regress/c-testsuite/single-exec/00193.c.otags new file mode 100644 index 0000000..e4d2203 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00193.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/47_switch_return.c diff --git a/test/regress/c-testsuite/single-exec/00193.c.tags b/test/regress/c-testsuite/single-exec/00193.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00193.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00194.c b/test/regress/c-testsuite/single-exec/00194.c new file mode 100644 index 0000000..5bc5ba4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00194.c @@ -0,0 +1,26 @@ +#include + +int main() +{ + int a; + char b; + + a = 0; + while (a < 2) + { + printf("%d", a++); + break; + + b = 'A'; + while (b < 'C') + { + printf("%c", b++); + } + printf("e"); + } + printf("\n"); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00194.c.expected b/test/regress/c-testsuite/single-exec/00194.c.expected new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00194.c.expected @@ -0,0 +1 @@ +0 diff --git a/test/regress/c-testsuite/single-exec/00194.c.otags b/test/regress/c-testsuite/single-exec/00194.c.otags new file mode 100644 index 0000000..e83482a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00194.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/48_nested_break.c diff --git a/test/regress/c-testsuite/single-exec/00194.c.tags b/test/regress/c-testsuite/single-exec/00194.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00194.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00195.c b/test/regress/c-testsuite/single-exec/00195.c new file mode 100644 index 0000000..0cbe57d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00195.c @@ -0,0 +1,23 @@ +#include + +struct point +{ + double x; + double y; +}; + +struct point point_array[100]; + +int main() +{ + int my_point = 10; + + point_array[my_point].x = 12.34; + point_array[my_point].y = 56.78; + + printf("%f, %f\n", point_array[my_point].x, point_array[my_point].y); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00195.c.expected b/test/regress/c-testsuite/single-exec/00195.c.expected new file mode 100644 index 0000000..1da66db --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00195.c.expected @@ -0,0 +1 @@ +12.340000, 56.780000 diff --git a/test/regress/c-testsuite/single-exec/00195.c.otags b/test/regress/c-testsuite/single-exec/00195.c.otags new file mode 100644 index 0000000..ec6977a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00195.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/49_bracket_evaluation.c diff --git a/test/regress/c-testsuite/single-exec/00195.c.tags b/test/regress/c-testsuite/single-exec/00195.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00195.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00196.c b/test/regress/c-testsuite/single-exec/00196.c new file mode 100644 index 0000000..ddec08c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00196.c @@ -0,0 +1,29 @@ +#include + +int fred() +{ + printf("fred\n"); + return 0; +} + +int joe() +{ + printf("joe\n"); + return 1; +} + +int main() +{ + printf("%d\n", fred() && joe()); + printf("%d\n", fred() || joe()); + printf("%d\n", joe() && fred()); + printf("%d\n", joe() || fred()); + printf("%d\n", fred() && (1 + joe())); + printf("%d\n", fred() || (0 + joe())); + printf("%d\n", joe() && (0 + fred())); + printf("%d\n", joe() || (1 + fred())); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00196.c.expected b/test/regress/c-testsuite/single-exec/00196.c.expected new file mode 100644 index 0000000..d6174ae --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00196.c.expected @@ -0,0 +1,20 @@ +fred +0 +fred +joe +1 +joe +fred +0 +joe +1 +fred +0 +fred +joe +1 +joe +fred +0 +joe +1 diff --git a/test/regress/c-testsuite/single-exec/00196.c.otags b/test/regress/c-testsuite/single-exec/00196.c.otags new file mode 100644 index 0000000..348b2df --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00196.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/50_logical_second_arg.c diff --git a/test/regress/c-testsuite/single-exec/00196.c.tags b/test/regress/c-testsuite/single-exec/00196.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00196.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00197.c b/test/regress/c-testsuite/single-exec/00197.c new file mode 100644 index 0000000..d6c0917 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00197.c @@ -0,0 +1,30 @@ +#include + +static int fred = 1234; +static int joe; + +void henry() +{ + static int fred = 4567; + + printf("%d\n", fred); + fred++; +} + +int main() +{ + printf("%d\n", fred); + henry(); + henry(); + henry(); + henry(); + printf("%d\n", fred); + fred = 8901; + joe = 2345; + printf("%d\n", fred); + printf("%d\n", joe); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00197.c.expected b/test/regress/c-testsuite/single-exec/00197.c.expected new file mode 100644 index 0000000..18224fa --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00197.c.expected @@ -0,0 +1,8 @@ +1234 +4567 +4568 +4569 +4570 +1234 +8901 +2345 diff --git a/test/regress/c-testsuite/single-exec/00197.c.otags b/test/regress/c-testsuite/single-exec/00197.c.otags new file mode 100644 index 0000000..39d18a6 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00197.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/51_static.c diff --git a/test/regress/c-testsuite/single-exec/00197.c.tags b/test/regress/c-testsuite/single-exec/00197.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00197.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00198.c b/test/regress/c-testsuite/single-exec/00198.c new file mode 100644 index 0000000..d0395b2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00198.c @@ -0,0 +1,27 @@ +#include + +enum fred { a, b, c }; + +int main() +{ + printf("a=%d\n", a); + printf("b=%d\n", b); + printf("c=%d\n", c); + + enum fred d; + + typedef enum { e, f, g } h; + typedef enum { i, j, k } m; + + printf("e=%d\n", e); + printf("f=%d\n", f); + printf("g=%d\n", g); + + printf("i=%d\n", i); + printf("j=%d\n", j); + printf("k=%d\n", k); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00198.c.expected b/test/regress/c-testsuite/single-exec/00198.c.expected new file mode 100644 index 0000000..84f2ac8 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00198.c.expected @@ -0,0 +1,9 @@ +a=0 +b=1 +c=2 +e=0 +f=1 +g=2 +i=0 +j=1 +k=2 diff --git a/test/regress/c-testsuite/single-exec/00198.c.otags b/test/regress/c-testsuite/single-exec/00198.c.otags new file mode 100644 index 0000000..b593357 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00198.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/52_unnamed_enum.c diff --git a/test/regress/c-testsuite/single-exec/00198.c.tags b/test/regress/c-testsuite/single-exec/00198.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00198.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00199.c b/test/regress/c-testsuite/single-exec/00199.c new file mode 100644 index 0000000..2e151bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00199.c @@ -0,0 +1,56 @@ +#include + +void fred() +{ + printf("In fred()\n"); + goto done; + printf("In middle\n"); +done: + printf("At end\n"); +} + +void joe() +{ + int b = 5678; + + printf("In joe()\n"); + + { + int c = 1234; + printf("c = %d\n", c); + goto outer; + printf("uh-oh\n"); + } + +outer: + + printf("done\n"); +} + +void henry() +{ + int a; + + printf("In henry()\n"); + goto inner; + + { + int b; +inner: + b = 1234; + printf("b = %d\n", b); + } + + printf("done\n"); +} + +int main() +{ + fred(); + joe(); + henry(); + + return 0; +} + +/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ diff --git a/test/regress/c-testsuite/single-exec/00199.c.expected b/test/regress/c-testsuite/single-exec/00199.c.expected new file mode 100644 index 0000000..8e553fa --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00199.c.expected @@ -0,0 +1,8 @@ +In fred() +At end +In joe() +c = 1234 +done +In henry() +b = 1234 +done diff --git a/test/regress/c-testsuite/single-exec/00199.c.otags b/test/regress/c-testsuite/single-exec/00199.c.otags new file mode 100644 index 0000000..f438255 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00199.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/54_goto.c diff --git a/test/regress/c-testsuite/single-exec/00199.c.tags b/test/regress/c-testsuite/single-exec/00199.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00199.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00200.c b/test/regress/c-testsuite/single-exec/00200.c new file mode 100644 index 0000000..aa3e51a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00200.c @@ -0,0 +1,52 @@ +/* $Id: lshift-type.c 53089 2012-07-06 11:18:26Z vinc17/ypig $ + +Tests on left-shift type, written by Vincent Lefevre . + +ISO C99 TC3 says: [6.5.7#3] "The integer promotions are performed on +each of the operands. The type of the result is that of the promoted +left operand." +*/ + +#include + +#define PTYPE(M) ((M) < 0 || -(M) < 0 ? -1 : 1) * (int) sizeof((M)+0) +#define CHECK(X,T) check(#X, PTYPE(X), PTYPE((X) << (T) 1)) +#define TEST1(X,T) do { CHECK(X,T); CHECK(X,unsigned T); } while (0) +#define TEST2(X) \ + do \ + { \ + TEST1((X),short); \ + TEST1((X),int); \ + TEST1((X),long); \ + TEST1((X),long long); \ + } \ + while (0) +#define TEST3(X,T) do { TEST2((T)(X)); TEST2((unsigned T)(X)); } while (0) +#define TEST4(X) \ + do \ + { \ + TEST3((X),short); \ + TEST3((X),int); \ + TEST3((X),long); \ + TEST3((X),long long); \ + } \ + while (0) + +static int debug, nfailed = 0; + +static void check (const char *s, int arg1, int shift) +{ + int failed = arg1 != shift; + if (debug || failed) + printf ("%s %d %d\n", s, arg1, shift); + nfailed += failed; +} + +int main (int argc, char **argv) +{ + debug = argc > 1; + TEST4(1); + TEST4(-1); + printf ("%d test(s) failed\n", nfailed); + return nfailed != 0; +} diff --git a/test/regress/c-testsuite/single-exec/00200.c.expected b/test/regress/c-testsuite/single-exec/00200.c.expected new file mode 100644 index 0000000..8523767 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00200.c.expected @@ -0,0 +1 @@ +0 test(s) failed diff --git a/test/regress/c-testsuite/single-exec/00200.c.otags b/test/regress/c-testsuite/single-exec/00200.c.otags new file mode 100644 index 0000000..d969a16 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00200.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/55_lshift_type.c diff --git a/test/regress/c-testsuite/single-exec/00200.c.tags b/test/regress/c-testsuite/single-exec/00200.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00200.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00201.c b/test/regress/c-testsuite/single-exec/00201.c new file mode 100644 index 0000000..676e5d3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00201.c @@ -0,0 +1,12 @@ +#include // printf() + +#define CAT2(a,b) a##b +#define CAT(a,b) CAT2(a,b) +#define AB(x) CAT(x,y) + +int main(void) +{ + int xy = 42; + printf("%d\n", CAT(A,B)(x)); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00201.c.expected b/test/regress/c-testsuite/single-exec/00201.c.expected new file mode 100644 index 0000000..d81cc07 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00201.c.expected @@ -0,0 +1 @@ +42 diff --git a/test/regress/c-testsuite/single-exec/00201.c.otags b/test/regress/c-testsuite/single-exec/00201.c.otags new file mode 100644 index 0000000..b989511 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00201.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/64_macro_nesting.c diff --git a/test/regress/c-testsuite/single-exec/00201.c.tags b/test/regress/c-testsuite/single-exec/00201.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00201.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00202.c b/test/regress/c-testsuite/single-exec/00202.c new file mode 100644 index 0000000..c580d3a --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00202.c @@ -0,0 +1,14 @@ +#include + +#define P(A,B) A ## B ; bob +#define Q(A,B) A ## B+ + +int main(void) +{ + int bob, jim = 21; + bob = P(jim,) *= 2; + printf("jim: %d, bob: %d\n", jim, bob); + jim = 60 Q(+,)3; + printf("jim: %d\n", jim); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00202.c.expected b/test/regress/c-testsuite/single-exec/00202.c.expected new file mode 100644 index 0000000..8386c2d --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00202.c.expected @@ -0,0 +1,2 @@ +jim: 21, bob: 42 +jim: 63 diff --git a/test/regress/c-testsuite/single-exec/00202.c.otags b/test/regress/c-testsuite/single-exec/00202.c.otags new file mode 100644 index 0000000..7878291 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00202.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/67_macro_concat.c diff --git a/test/regress/c-testsuite/single-exec/00202.c.tags b/test/regress/c-testsuite/single-exec/00202.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00202.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00203.c b/test/regress/c-testsuite/single-exec/00203.c new file mode 100644 index 0000000..6608213 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00203.c @@ -0,0 +1,19 @@ +#include + +int main() +{ + long long int res = 0; + + if (res < -2147483648LL) { + printf("Error: 0 < -2147483648\n"); + return 1; + } + else + if (2147483647LL < res) { + printf("Error: 2147483647 < 0\n"); + return 2; + } + else + printf("long long constant test ok.\n"); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00203.c.expected b/test/regress/c-testsuite/single-exec/00203.c.expected new file mode 100644 index 0000000..dda9e66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00203.c.expected @@ -0,0 +1 @@ +long long constant test ok. diff --git a/test/regress/c-testsuite/single-exec/00203.c.otags b/test/regress/c-testsuite/single-exec/00203.c.otags new file mode 100644 index 0000000..8a66133 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00203.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/72_long_long_constant.c diff --git a/test/regress/c-testsuite/single-exec/00203.c.tags b/test/regress/c-testsuite/single-exec/00203.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00203.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00204.c.disable b/test/regress/c-testsuite/single-exec/00204.c.disable new file mode 100644 index 0000000..8de61b3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00204.c.disable @@ -0,0 +1,527 @@ +// This program is designed to test some arm64-specific things, such as the +// calling convention, but should give the same results on any architecture. + +#include +#include +#include + +struct s1 { char x[1]; } s1 = { "0" }; +struct s2 { char x[2]; } s2 = { "12" }; +struct s3 { char x[3]; } s3 = { "345" }; +struct s4 { char x[4]; } s4 = { "6789" }; +struct s5 { char x[5]; } s5 = { "abcde" }; +struct s6 { char x[6]; } s6 = { "fghijk" }; +struct s7 { char x[7]; } s7 = { "lmnopqr" }; +struct s8 { char x[8]; } s8 = { "stuvwxyz" }; +struct s9 { char x[9]; } s9 = { "ABCDEFGHI" }; +struct s10 { char x[10]; } s10 = { "JKLMNOPQRS" }; +struct s11 { char x[11]; } s11 = { "TUVWXYZ0123" }; +struct s12 { char x[12]; } s12 = { "456789abcdef" }; +struct s13 { char x[13]; } s13 = { "ghijklmnopqrs" }; +struct s14 { char x[14]; } s14 = { "tuvwxyzABCDEFG" }; +struct s15 { char x[15]; } s15 = { "HIJKLMNOPQRSTUV" }; +struct s16 { char x[16]; } s16 = { "WXYZ0123456789ab" }; +struct s17 { char x[17]; } s17 = { "cdefghijklmnopqrs" }; + +struct hfa11 { float a; } hfa11 = { 11.1 }; +struct hfa12 { float a, b; } hfa12 = { 12.1, 12.2 }; +struct hfa13 { float a, b, c; } hfa13 = { 13.1, 13.2, 13.3 }; +struct hfa14 { float a, b, c, d; } hfa14 = { 14.1, 14.2, 14.3, 14.4 }; + +struct hfa21 { double a; } hfa21 = { 21.1 }; +struct hfa22 { double a, b; } hfa22 = { 22.1, 22.2 }; +struct hfa23 { double a, b, c; } hfa23 = { 23.1, 23.2, 23.3 }; +struct hfa24 { double a, b, c, d; } hfa24 = { 24.1, 24.2, 24.3, 24.4 }; + +struct hfa31 { long double a; } hfa31 = { 31.1 }; +struct hfa32 { long double a, b; } hfa32 = { 32.1, 32.2 }; +struct hfa33 { long double a, b, c; } hfa33 = { 33.1, 33.2, 33.3 }; +struct hfa34 { long double a, b, c, d; } hfa34 = { 34.1, 34.2, 34.3, 34.4 }; + +void fa_s1(struct s1 a) { printf("%.1s\n", a.x); } +void fa_s2(struct s2 a) { printf("%.2s\n", a.x); } +void fa_s3(struct s3 a) { printf("%.3s\n", a.x); } +void fa_s4(struct s4 a) { printf("%.4s\n", a.x); } +void fa_s5(struct s5 a) { printf("%.5s\n", a.x); } +void fa_s6(struct s6 a) { printf("%.6s\n", a.x); } +void fa_s7(struct s7 a) { printf("%.7s\n", a.x); } +void fa_s8(struct s8 a) { printf("%.8s\n", a.x); } +void fa_s9(struct s9 a) { printf("%.9s\n", a.x); } +void fa_s10(struct s10 a) { printf("%.10s\n", a.x); } +void fa_s11(struct s11 a) { printf("%.11s\n", a.x); } +void fa_s12(struct s12 a) { printf("%.12s\n", a.x); } +void fa_s13(struct s13 a) { printf("%.13s\n", a.x); } +void fa_s14(struct s14 a) { printf("%.14s\n", a.x); } +void fa_s15(struct s15 a) { printf("%.15s\n", a.x); } +void fa_s16(struct s16 a) { printf("%.16s\n", a.x); } +void fa_s17(struct s17 a) { printf("%.17s\n", a.x); } + +void fa_hfa11(struct hfa11 a) +{ printf("%.1f\n", a.a); } +void fa_hfa12(struct hfa12 a) +{ printf("%.1f %.1f\n", a.a, a.a); } +void fa_hfa13(struct hfa13 a) +{ printf("%.1f %.1f %.1f\n", a.a, a.b, a.c); } +void fa_hfa14(struct hfa14 a) +{ printf("%.1f %.1f %.1f %.1f\n", a.a, a.b, a.c, a.d); } + +void fa_hfa21(struct hfa21 a) +{ printf("%.1f\n", a.a); } +void fa_hfa22(struct hfa22 a) +{ printf("%.1f %.1f\n", a.a, a.a); } +void fa_hfa23(struct hfa23 a) +{ printf("%.1f %.1f %.1f\n", a.a, a.b, a.c); } +void fa_hfa24(struct hfa24 a) +{ printf("%.1f %.1f %.1f %.1f\n", a.a, a.b, a.c, a.d); } + +void fa_hfa31(struct hfa31 a) +{ printf("%.1Lf\n", a.a); } +void fa_hfa32(struct hfa32 a) +{ printf("%.1Lf %.1Lf\n", a.a, a.a); } +void fa_hfa33(struct hfa33 a) +{ printf("%.1Lf %.1Lf %.1Lf\n", a.a, a.b, a.c); } +void fa_hfa34(struct hfa34 a) +{ printf("%.1Lf %.1Lf %.1Lf %.1Lf\n", a.a, a.b, a.c, a.d); } + +void fa1(struct s8 a, struct s9 b, struct s10 c, struct s11 d, + struct s12 e, struct s13 f) +{ + printf("%.3s %.3s %.3s %.3s %.3s %.3s\n", a.x, b.x, c.x, d.x, e.x, f.x); +} + +void fa2(struct s9 a, struct s10 b, struct s11 c, struct s12 d, + struct s13 e, struct s14 f) +{ + printf("%.3s %.3s %.3s %.3s %.3s %.3s\n", a.x, b.x, c.x, d.x, e.x, f.x); +} + +void fa3(struct hfa14 a, struct hfa23 b, struct hfa32 c) +{ + printf("%.1f %.1f %.1f %.1f %.1Lf %.1Lf\n", + a.a, a.d, b.a, b.c, c.a, c.b); +} + +void fa4(struct s1 a, struct hfa14 b, struct s2 c, struct hfa24 d, + struct s3 e, struct hfa34 f) +{ + printf("%.1s %.1f %.1f %.2s %.1f %.1f %.3s %.1Lf %.1Lf\n", + a.x, b.a, b.d, c.x, d.a, d.d, e.x, f.a, f.d); +} + +void arg(void) +{ + printf("Arguments:\n"); + fa_s1(s1); + fa_s2(s2); + fa_s3(s3); + fa_s4(s4); + fa_s5(s5); + fa_s6(s6); + fa_s7(s7); + fa_s8(s8); + fa_s9(s9); + fa_s10(s10); + fa_s11(s11); + fa_s12(s12); + fa_s13(s13); + fa_s14(s14); + fa_s15(s15); + fa_s16(s16); + fa_s17(s17); + fa_hfa11(hfa11); + fa_hfa12(hfa12); + fa_hfa13(hfa13); + fa_hfa14(hfa14); + fa_hfa21(hfa21); + fa_hfa22(hfa22); + fa_hfa23(hfa23); + fa_hfa24(hfa24); + fa_hfa31(hfa31); + fa_hfa32(hfa32); + fa_hfa33(hfa33); + fa_hfa34(hfa34); + fa1(s8, s9, s10, s11, s12, s13); + fa2(s9, s10, s11, s12, s13, s14); + fa3(hfa14, hfa23, hfa32); + fa4(s1, hfa14, s2, hfa24, s3, hfa34); +} + +struct s1 fr_s1(void) { return s1; } +struct s2 fr_s2(void) { return s2; } +struct s3 fr_s3(void) { return s3; } +struct s4 fr_s4(void) { return s4; } +struct s5 fr_s5(void) { return s5; } +struct s6 fr_s6(void) { return s6; } +struct s7 fr_s7(void) { return s7; } +struct s8 fr_s8(void) { return s8; } +struct s9 fr_s9(void) { return s9; } +struct s10 fr_s10(void) { return s10; } +struct s11 fr_s11(void) { return s11; } +struct s12 fr_s12(void) { return s12; } +struct s13 fr_s13(void) { return s13; } +struct s14 fr_s14(void) { return s14; } +struct s15 fr_s15(void) { return s15; } +struct s16 fr_s16(void) { return s16; } +struct s17 fr_s17(void) { return s17; } + +struct hfa11 fr_hfa11(void) { return hfa11; } +struct hfa12 fr_hfa12(void) { return hfa12; } +struct hfa13 fr_hfa13(void) { return hfa13; } +struct hfa14 fr_hfa14(void) { return hfa14; } + +struct hfa21 fr_hfa21(void) { return hfa21; } +struct hfa22 fr_hfa22(void) { return hfa22; } +struct hfa23 fr_hfa23(void) { return hfa23; } +struct hfa24 fr_hfa24(void) { return hfa24; } + +struct hfa31 fr_hfa31(void) { return hfa31; } +struct hfa32 fr_hfa32(void) { return hfa32; } +struct hfa33 fr_hfa33(void) { return hfa33; } +struct hfa34 fr_hfa34(void) { return hfa34; } + +void ret(void) +{ + struct s1 t1 = fr_s1(); + struct s2 t2 = fr_s2(); + struct s3 t3 = fr_s3(); + struct s4 t4 = fr_s4(); + struct s5 t5 = fr_s5(); + struct s6 t6 = fr_s6(); + struct s7 t7 = fr_s7(); + struct s8 t8 = fr_s8(); + struct s9 t9 = fr_s9(); + struct s10 t10 = fr_s10(); + struct s11 t11 = fr_s11(); + struct s12 t12 = fr_s12(); + struct s13 t13 = fr_s13(); + struct s14 t14 = fr_s14(); + struct s15 t15 = fr_s15(); + struct s16 t16 = fr_s16(); + struct s17 t17 = fr_s17(); + printf("Return values:\n"); + printf("%.1s\n", t1.x); + printf("%.2s\n", t2.x); + printf("%.3s\n", t3.x); + printf("%.4s\n", t4.x); + printf("%.5s\n", t5.x); + printf("%.6s\n", t6.x); + printf("%.7s\n", t7.x); + printf("%.8s\n", t8.x); + printf("%.9s\n", t9.x); + printf("%.10s\n", t10.x); + printf("%.11s\n", t11.x); + printf("%.12s\n", t12.x); + printf("%.13s\n", t13.x); + printf("%.14s\n", t14.x); + printf("%.15s\n", t15.x); + printf("%.16s\n", t16.x); + printf("%.17s\n", t17.x); + printf("%.1f\n", fr_hfa11().a); + printf("%.1f %.1f\n", fr_hfa12().a, fr_hfa12().b); + printf("%.1f %.1f\n", fr_hfa13().a, fr_hfa13().c); + printf("%.1f %.1f\n", fr_hfa14().a, fr_hfa14().d); + printf("%.1f\n", fr_hfa21().a); + printf("%.1f %.1f\n", fr_hfa22().a, fr_hfa22().b); + printf("%.1f %.1f\n", fr_hfa23().a, fr_hfa23().c); + printf("%.1f %.1f\n", fr_hfa24().a, fr_hfa24().d); + printf("%.1Lf\n", fr_hfa31().a); + printf("%.1Lf %.1Lf\n", fr_hfa32().a, fr_hfa32().b); + printf("%.1Lf %.1Lf\n", fr_hfa33().a, fr_hfa33().c); + printf("%.1Lf %.1Lf\n", fr_hfa34().a, fr_hfa34().d); +} + +int match(const char **s, const char *f) +{ + const char *p = *s; + for (p = *s; *f && *f == *p; f++, p++) + ; + if (!*f) { + *s = p - 1; + return 1; + } + return 0; +} + +void myprintf(const char *format, ...) +{ + const char *s; + va_list ap; + va_start(ap, format); + for (s = format; *s; s++) { + if (match(&s, "%7s")) { + struct s7 t7 = va_arg(ap, struct s7); + printf("%.7s", t7.x); + } + else if (match(&s, "%9s")) { + struct s9 t9 = va_arg(ap, struct s9); + printf("%.9s", t9.x); + } + else if (match(&s, "%hfa11")) { + struct hfa11 x = va_arg(ap, struct hfa11); + printf("%.1f,%.1f", x.a, x.a); + } + else if (match(&s, "%hfa12")) { + struct hfa12 x = va_arg(ap, struct hfa12); + printf("%.1f,%.1f", x.a, x.b); + } + else if (match(&s, "%hfa13")) { + struct hfa13 x = va_arg(ap, struct hfa13); + printf("%.1f,%.1f", x.a, x.c); + } + else if (match(&s, "%hfa14")) { + struct hfa14 x = va_arg(ap, struct hfa14); + printf("%.1f,%.1f", x.a, x.d); + } + else if (match(&s, "%hfa21")) { + struct hfa21 x = va_arg(ap, struct hfa21); + printf("%.1f,%.1f", x.a, x.a); + } + else if (match(&s, "%hfa22")) { + struct hfa22 x = va_arg(ap, struct hfa22); + printf("%.1f,%.1f", x.a, x.b); + } + else if (match(&s, "%hfa23")) { + struct hfa23 x = va_arg(ap, struct hfa23); + printf("%.1f,%.1f", x.a, x.c); + } + else if (match(&s, "%hfa24")) { + struct hfa24 x = va_arg(ap, struct hfa24); + printf("%.1f,%.1f", x.a, x.d); + } + else if (match(&s, "%hfa31")) { + struct hfa31 x = va_arg(ap, struct hfa31); + printf("%.1Lf,%.1Lf", x.a, x.a); + } + else if (match(&s, "%hfa32")) { + struct hfa32 x = va_arg(ap, struct hfa32); + printf("%.1Lf,%.1Lf", x.a, x.b); + } + else if (match(&s, "%hfa33")) { + struct hfa33 x = va_arg(ap, struct hfa33); + printf("%.1Lf,%.1Lf", x.a, x.c); + } + else if (match(&s, "%hfa34")) { + struct hfa34 x = va_arg(ap, struct hfa34); + printf("%.1Lf,%.1Lf", x.a, x.d); + } + else + putchar(*s); + } + putchar('\n'); +} + +void stdarg(void) +{ + printf("stdarg:\n"); + myprintf("%9s %9s %9s %9s %9s %9s", s9, s9, s9, s9, s9, s9); + myprintf("%7s %9s %9s %9s %9s %9s", s7, s9, s9, s9, s9, s9); + + myprintf("HFA long double:"); + myprintf("%hfa34 %hfa34 %hfa34 %hfa34", hfa34, hfa34, hfa34, hfa34); + myprintf("%hfa33 %hfa34 %hfa34 %hfa34", hfa33, hfa34, hfa34, hfa34); + myprintf("%hfa32 %hfa34 %hfa34 %hfa34", hfa32, hfa34, hfa34, hfa34); + myprintf("%hfa31 %hfa34 %hfa34 %hfa34", hfa31, hfa34, hfa34, hfa34); + + myprintf("%hfa32 %hfa33 %hfa33 %hfa33 %hfa33", + hfa32, hfa33, hfa33, hfa33, hfa33); + myprintf("%hfa31 %hfa33 %hfa33 %hfa33 %hfa33", + hfa31, hfa33, hfa33, hfa33, hfa33); + myprintf("%hfa33 %hfa33 %hfa33 %hfa33", + hfa33, hfa33, hfa33, hfa33); + + myprintf("%hfa34 %hfa32 %hfa32 %hfa32 %hfa32", + hfa34, hfa32, hfa32, hfa32, hfa32); + myprintf("%hfa33 %hfa32 %hfa32 %hfa32 %hfa32", + hfa33, hfa32, hfa32, hfa32, hfa32); + + myprintf("%hfa34 %hfa32 %hfa31 %hfa31 %hfa31 %hfa31", + hfa34, hfa32, hfa31, hfa31, hfa31, hfa31); + + myprintf("HFA double:"); + myprintf("%hfa24 %hfa24 %hfa24 %hfa24", hfa24, hfa24, hfa24, hfa24); + myprintf("%hfa23 %hfa24 %hfa24 %hfa24", hfa23, hfa24, hfa24, hfa24); + myprintf("%hfa22 %hfa24 %hfa24 %hfa24", hfa22, hfa24, hfa24, hfa24); + myprintf("%hfa21 %hfa24 %hfa24 %hfa24", hfa21, hfa24, hfa24, hfa24); + + myprintf("%hfa22 %hfa23 %hfa23 %hfa23 %hfa23", + hfa22, hfa23, hfa23, hfa23, hfa23); + myprintf("%hfa21 %hfa23 %hfa23 %hfa23 %hfa23", + hfa21, hfa23, hfa23, hfa23, hfa23); + myprintf("%hfa23 %hfa23 %hfa23 %hfa23", + hfa23, hfa23, hfa23, hfa23); + + myprintf("%hfa24 %hfa22 %hfa22 %hfa22 %hfa22", + hfa24, hfa22, hfa22, hfa22, hfa22); + myprintf("%hfa23 %hfa22 %hfa22 %hfa22 %hfa22", + hfa23, hfa22, hfa22, hfa22, hfa22); + + myprintf("%hfa24 %hfa22 %hfa21 %hfa21 %hfa21 %hfa21", + hfa24, hfa22, hfa21, hfa21, hfa21, hfa21); + + myprintf("HFA float:"); + myprintf("%hfa14 %hfa14 %hfa14 %hfa14", hfa14, hfa14, hfa14, hfa14); + myprintf("%hfa13 %hfa14 %hfa14 %hfa14", hfa13, hfa14, hfa14, hfa14); + myprintf("%hfa12 %hfa14 %hfa14 %hfa14", hfa12, hfa14, hfa14, hfa14); + myprintf("%hfa11 %hfa14 %hfa14 %hfa14", hfa11, hfa14, hfa14, hfa14); + + myprintf("%hfa12 %hfa13 %hfa13 %hfa13 %hfa13", + hfa12, hfa13, hfa13, hfa13, hfa13); + myprintf("%hfa11 %hfa13 %hfa13 %hfa13 %hfa13", + hfa11, hfa13, hfa13, hfa13, hfa13); + myprintf("%hfa13 %hfa13 %hfa13 %hfa13", + hfa13, hfa13, hfa13, hfa13); + + myprintf("%hfa14 %hfa12 %hfa12 %hfa12 %hfa12", + hfa14, hfa12, hfa12, hfa12, hfa12); + myprintf("%hfa13 %hfa12 %hfa12 %hfa12 %hfa12", + hfa13, hfa12, hfa12, hfa12, hfa12); + + myprintf("%hfa14 %hfa12 %hfa11 %hfa11 %hfa11 %hfa11", + hfa14, hfa12, hfa11, hfa11, hfa11, hfa11); +} + +void pll(unsigned long long x) +{ + printf("%llx\n", x); +} + +void movi(void) +{ + printf("MOVI:\n"); + pll(0); + pll(0xabcd); + pll(0xabcd0000); + pll(0xabcd00000000); + pll(0xabcd000000000000); + pll(0xffffabcd); + pll(0xabcdffff); + pll(0xffffffffffffabcd); + pll(0xffffffffabcdffff); + pll(0xffffabcdffffffff); + pll(0xabcdffffffffffff); + pll(0xaaaaaaaa); + pll(0x5555555555555555); + pll(0x77777777); + pll(0x3333333333333333); + pll(0xf8f8f8f8); + pll(0x1e1e1e1e1e1e1e1e); + pll(0x3f803f80); + pll(0x01ff01ff01ff01ff); + pll(0x007fffc0); + pll(0x03fff80003fff800); + pll(0x0007fffffffffe00); + + pll(0xabcd1234); + pll(0xabcd00001234); + pll(0xabcd000000001234); + pll(0xabcd12340000); + pll(0xabcd000012340000); + pll(0xabcd123400000000); + pll(0xffffffffabcd1234); + pll(0xffffabcdffff1234); + pll(0xabcdffffffff1234); + pll(0xffffabcd1234ffff); + pll(0xabcdffff1234ffff); + pll(0xabcd1234ffffffff); + + pll(0xffffef0123456789); + pll(0xabcdef012345ffff); + + pll(0xabcdef0123456789); +} + +static uint32_t addip0(uint32_t x) { return x + 0; } +static uint64_t sublp0(uint64_t x) { return x - 0; } +static uint32_t addip123(uint32_t x) { return x + 123; } +static uint64_t addlm123(uint64_t x) { return x + -123; } +static uint64_t sublp4095(uint64_t x) { return x - 4095; } +static uint32_t subim503808(uint32_t x) { return x - -503808; } +static uint64_t addp12345(uint64_t x) { return x + 12345; } +static uint32_t subp12345(uint32_t x) { return x - 12345; } + +static uint32_t mvni(uint32_t x) { return 0xffffffff - x; } +static uint64_t negl(uint64_t x) { return 0 - x; } +static uint32_t rsbi123(uint32_t x) { return 123 - x; } +static uint64_t rsbl123(uint64_t x) { return 123 - x; } + +static uint32_t andi0(uint32_t x) { return x & 0; } +static uint64_t andlm1(uint64_t x) { return x & -1; } +static uint64_t orrl0(uint64_t x) { return x | 0; } +static uint32_t orrim1(uint32_t x) { return x | -1; } +static uint32_t eori0(uint32_t x) { return x ^ 0; } +static uint64_t eorlm1(uint64_t x) { return x ^ -1; } +static uint32_t and0xf0(uint32_t x) { return x & 0xf0; } +static uint64_t orr0xf0(uint64_t x) { return x | 0xf0; } +static uint64_t eor0xf0(uint64_t x) { return x ^ 0xf0; } + +static uint32_t lsli0(uint32_t x) { return x << 0; } +static uint32_t lsri0(uint32_t x) { return x >> 0; } +static int64_t asrl0(int64_t x) { return x >> 0; } +static uint32_t lsli1(uint32_t x) { return x << 1; } +static uint32_t lsli31(uint32_t x) { return x << 31; } +static uint64_t lsll1(uint64_t x) { return x << 1; } +static uint64_t lsll63(uint64_t x) { return x << 63; } +static uint32_t lsri1(uint32_t x) { return x >> 1; } +static uint32_t lsri31(uint32_t x) { return x >> 31; } +static uint64_t lsrl1(uint64_t x) { return x >> 1; } +static uint64_t lsrl63(uint64_t x) { return x >> 63; } +static int32_t asri1(int32_t x) { return x >> 1; } +static int32_t asri31(int32_t x) { return x >> 31; } +static int64_t asrl1(int64_t x) { return x >> 1; } +static int64_t asrl63(int64_t x) { return x >> 63; } + +void opi(void) +{ + int x = 1000; + pll(addip0(x)); + pll(sublp0(x)); + pll(addip123(x)); + pll(addlm123(x)); + pll(sublp4095(x)); + pll(subim503808(x)); + pll(addp12345(x)); + pll(subp12345(x)); + pll(mvni(x)); + pll(negl(x)); + pll(rsbi123(x)); + pll(rsbl123(x)); + pll(andi0(x)); + pll(andlm1(x)); + pll(orrl0(x)); + pll(orrim1(x)); + pll(eori0(x)); + pll(eorlm1(x)); + pll(and0xf0(x)); + pll(orr0xf0(x)); + pll(eor0xf0(x)); + pll(lsli0(x)); + pll(lsri0(x)); + pll(asrl0(x)); + pll(lsli1(x)); + pll(lsli31(x)); + pll(lsll1(x)); + pll(lsll63(x)); + pll(lsri1(x)); + pll(lsri31(x)); + pll(lsrl1(x)); + pll(lsrl63(x)); + pll(asri1(x)); + pll(asri31(x)); + pll(asrl1(x)); + pll(asrl63(x)); +} + +void pcs(void) +{ + arg(); + ret(); + stdarg(); + movi(); + opi(); +} + +int main() +{ + pcs(); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00204.c.expected b/test/regress/c-testsuite/single-exec/00204.c.expected new file mode 100644 index 0000000..7bdebd3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00204.c.expected @@ -0,0 +1,174 @@ +Arguments: +0 +12 +345 +6789 +abcde +fghijk +lmnopqr +stuvwxyz +ABCDEFGHI +JKLMNOPQRS +TUVWXYZ0123 +456789abcdef +ghijklmnopqrs +tuvwxyzABCDEFG +HIJKLMNOPQRSTUV +WXYZ0123456789ab +cdefghijklmnopqrs +11.1 +12.1 12.1 +13.1 13.2 13.3 +14.1 14.2 14.3 14.4 +21.1 +22.1 22.1 +23.1 23.2 23.3 +24.1 24.2 24.3 24.4 +31.1 +32.1 32.1 +33.1 33.2 33.3 +34.1 34.2 34.3 34.4 +stu ABC JKL TUV 456 ghi +ABC JKL TUV 456 ghi tuv +14.1 14.4 23.1 23.3 32.1 32.2 +0 14.1 14.4 12 24.1 24.4 345 34.1 34.4 +Return values: +0 +12 +345 +6789 +abcde +fghijk +lmnopqr +stuvwxyz +ABCDEFGHI +JKLMNOPQRS +TUVWXYZ0123 +456789abcdef +ghijklmnopqrs +tuvwxyzABCDEFG +HIJKLMNOPQRSTUV +WXYZ0123456789ab +cdefghijklmnopqrs +11.1 +12.1 12.2 +13.1 13.3 +14.1 14.4 +21.1 +22.1 22.2 +23.1 23.3 +24.1 24.4 +31.1 +32.1 32.2 +33.1 33.3 +34.1 34.4 +stdarg: +ABCDEFGHI ABCDEFGHI ABCDEFGHI ABCDEFGHI ABCDEFGHI ABCDEFGHI +lmnopqr ABCDEFGHI ABCDEFGHI ABCDEFGHI ABCDEFGHI ABCDEFGHI +HFA long double: +34.1,34.4 34.1,34.4 34.1,34.4 34.1,34.4 +33.1,33.3 34.1,34.4 34.1,34.4 34.1,34.4 +32.1,32.2 34.1,34.4 34.1,34.4 34.1,34.4 +31.1,31.1 34.1,34.4 34.1,34.4 34.1,34.4 +32.1,32.2 33.1,33.3 33.1,33.3 33.1,33.3 33.1,33.3 +31.1,31.1 33.1,33.3 33.1,33.3 33.1,33.3 33.1,33.3 +33.1,33.3 33.1,33.3 33.1,33.3 33.1,33.3 +34.1,34.4 32.1,32.2 32.1,32.2 32.1,32.2 32.1,32.2 +33.1,33.3 32.1,32.2 32.1,32.2 32.1,32.2 32.1,32.2 +34.1,34.4 32.1,32.2 31.1,31.1 31.1,31.1 31.1,31.1 31.1,31.1 +HFA double: +24.1,24.4 24.1,24.4 24.1,24.4 24.1,24.4 +23.1,23.3 24.1,24.4 24.1,24.4 24.1,24.4 +22.1,22.2 24.1,24.4 24.1,24.4 24.1,24.4 +21.1,21.1 24.1,24.4 24.1,24.4 24.1,24.4 +22.1,22.2 23.1,23.3 23.1,23.3 23.1,23.3 23.1,23.3 +21.1,21.1 23.1,23.3 23.1,23.3 23.1,23.3 23.1,23.3 +23.1,23.3 23.1,23.3 23.1,23.3 23.1,23.3 +24.1,24.4 22.1,22.2 22.1,22.2 22.1,22.2 22.1,22.2 +23.1,23.3 22.1,22.2 22.1,22.2 22.1,22.2 22.1,22.2 +24.1,24.4 22.1,22.2 21.1,21.1 21.1,21.1 21.1,21.1 21.1,21.1 +HFA float: +14.1,14.4 14.1,14.4 14.1,14.4 14.1,14.4 +13.1,13.3 14.1,14.4 14.1,14.4 14.1,14.4 +12.1,12.2 14.1,14.4 14.1,14.4 14.1,14.4 +11.1,11.1 14.1,14.4 14.1,14.4 14.1,14.4 +12.1,12.2 13.1,13.3 13.1,13.3 13.1,13.3 13.1,13.3 +11.1,11.1 13.1,13.3 13.1,13.3 13.1,13.3 13.1,13.3 +13.1,13.3 13.1,13.3 13.1,13.3 13.1,13.3 +14.1,14.4 12.1,12.2 12.1,12.2 12.1,12.2 12.1,12.2 +13.1,13.3 12.1,12.2 12.1,12.2 12.1,12.2 12.1,12.2 +14.1,14.4 12.1,12.2 11.1,11.1 11.1,11.1 11.1,11.1 11.1,11.1 +MOVI: +0 +abcd +abcd0000 +abcd00000000 +abcd000000000000 +ffffabcd +abcdffff +ffffffffffffabcd +ffffffffabcdffff +ffffabcdffffffff +abcdffffffffffff +aaaaaaaa +5555555555555555 +77777777 +3333333333333333 +f8f8f8f8 +1e1e1e1e1e1e1e1e +3f803f80 +1ff01ff01ff01ff +7fffc0 +3fff80003fff800 +7fffffffffe00 +abcd1234 +abcd00001234 +abcd000000001234 +abcd12340000 +abcd000012340000 +abcd123400000000 +ffffffffabcd1234 +ffffabcdffff1234 +abcdffffffff1234 +ffffabcd1234ffff +abcdffff1234ffff +abcd1234ffffffff +ffffef0123456789 +abcdef012345ffff +abcdef0123456789 +3e8 +3e8 +463 +36d +fffffffffffff3e9 +7b3e8 +3421 +ffffd3af +fffffc17 +fffffffffffffc18 +fffffc93 +fffffffffffffc93 +0 +3e8 +3e8 +ffffffff +3e8 +fffffffffffffc17 +e0 +3f8 +318 +3e8 +3e8 +3e8 +7d0 +0 +7d0 +0 +1f4 +0 +1f4 +0 +1f4 +0 +1f4 +0 diff --git a/test/regress/c-testsuite/single-exec/00204.c.otags b/test/regress/c-testsuite/single-exec/00204.c.otags new file mode 100644 index 0000000..caaf8bc --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00204.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/73_arm64.c diff --git a/test/regress/c-testsuite/single-exec/00204.c.tags b/test/regress/c-testsuite/single-exec/00204.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00204.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00205.c.disable b/test/regress/c-testsuite/single-exec/00205.c.disable new file mode 100644 index 0000000..234e3c4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00205.c.disable @@ -0,0 +1,33 @@ +#include + +/* This test is a snippet from the J interpreter */ + +typedef long I; +typedef struct{I c[4];I b,e,k;} PT; + +PT cases[] = { + ((I)4194304L +(I)2097152L +(I)67108864L), (I)262144L, (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), -1L, 1,2,1, + ((I)+4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L, (I)262144L, (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), 2,3,2, + ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)262144L, (((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), 1,3,2, + ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)524288L, -1L, 1,2,1, + ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)1048576L, (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), 1,3,1, + ((I)4194304L +(I)2097152L +(I)67108864L)+( (I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)262144L, (I)262144L, 1,3,1, + ((I)4194304L +(I)2097152L +(I)67108864L), ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), -1L, 1,2,1, + (I)33554432L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L), (I)2097152L, ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), -1L, 0,2,1, + (I)67108864L, ((I)1048576L +(I)524288L +(I)262144L +(((I)1L +(I)256L +(I)4L +(I)8L +(I)16L +(I)64L +(I)128L +(I)268435456L +(I)536870912L +(I)1024L +(I)4096L +(I)8192L +(I)16384L)+((I)2L +(I)131072L +(I)2048L)+(I)32L +(I)32768L +(I)65536L)), (I)134217728L, -1L, 0,2,0, +}; + +int main() { + int i, j; + + for(j=0; j < sizeof(cases)/sizeof(cases[0]); j++) { + for(i=0; i < sizeof(cases->c)/sizeof(cases->c[0]); i++) + printf("cases[%d].c[%d]=%ld\n", j, i, cases[j].c[i]); + + printf("cases[%d].b=%ld\n", j, cases[j].b); + printf("cases[%d].e=%ld\n", j, cases[j].e); + printf("cases[%d].k=%ld\n", j, cases[j].k); + printf("\n"); + } + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00205.c.expected b/test/regress/c-testsuite/single-exec/00205.c.expected new file mode 100644 index 0000000..2b75aa5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00205.c.expected @@ -0,0 +1,72 @@ +cases[0].c[0]=73400320 +cases[0].c[1]=262144 +cases[0].c[2]=805567999 +cases[0].c[3]=-1 +cases[0].b=1 +cases[0].e=2 +cases[0].k=1 + +cases[1].c[0]=879754751 +cases[1].c[1]=262144 +cases[1].c[2]=262144 +cases[1].c[3]=805567999 +cases[1].b=2 +cases[1].e=3 +cases[1].k=2 + +cases[2].c[0]=879754751 +cases[2].c[1]=805567999 +cases[2].c[2]=262144 +cases[2].c[3]=805567999 +cases[2].b=1 +cases[2].e=3 +cases[2].k=2 + +cases[3].c[0]=879754751 +cases[3].c[1]=805830143 +cases[3].c[2]=524288 +cases[3].c[3]=-1 +cases[3].b=1 +cases[3].e=2 +cases[3].k=1 + +cases[4].c[0]=879754751 +cases[4].c[1]=805830143 +cases[4].c[2]=1048576 +cases[4].c[3]=805830143 +cases[4].b=1 +cases[4].e=3 +cases[4].k=1 + +cases[5].c[0]=879754751 +cases[5].c[1]=805830143 +cases[5].c[2]=262144 +cases[5].c[3]=262144 +cases[5].b=1 +cases[5].e=3 +cases[5].k=1 + +cases[6].c[0]=73400320 +cases[6].c[1]=807403007 +cases[6].c[2]=807403007 +cases[6].c[3]=-1 +cases[6].b=1 +cases[6].e=2 +cases[6].k=1 + +cases[7].c[0]=839122431 +cases[7].c[1]=2097152 +cases[7].c[2]=807403007 +cases[7].c[3]=-1 +cases[7].b=0 +cases[7].e=2 +cases[7].k=1 + +cases[8].c[0]=67108864 +cases[8].c[1]=807403007 +cases[8].c[2]=134217728 +cases[8].c[3]=-1 +cases[8].b=0 +cases[8].e=2 +cases[8].k=0 + diff --git a/test/regress/c-testsuite/single-exec/00205.c.otags b/test/regress/c-testsuite/single-exec/00205.c.otags new file mode 100644 index 0000000..c8e3c2c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00205.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/75_array_in_struct_init.c diff --git a/test/regress/c-testsuite/single-exec/00205.c.tags b/test/regress/c-testsuite/single-exec/00205.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00205.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00206.c b/test/regress/c-testsuite/single-exec/00206.c new file mode 100644 index 0000000..d38e0bf --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00206.c @@ -0,0 +1,30 @@ +#include + +int main() +{ + /* must not affect how #pragma ppop_macro works */ + #define pop_macro foobar1 + + /* must not affect how #pragma push_macro works */ + #define push_macro foobar2 + + #undef abort + #define abort "111" + printf("abort = %s\n", abort); + + #pragma push_macro("abort") + #undef abort + #define abort "222" + printf("abort = %s\n", abort); + + #pragma push_macro("abort") + #undef abort + #define abort "333" + printf("abort = %s\n", abort); + + #pragma pop_macro("abort") + printf("abort = %s\n", abort); + + #pragma pop_macro("abort") + printf("abort = %s\n", abort); +} diff --git a/test/regress/c-testsuite/single-exec/00206.c.expected b/test/regress/c-testsuite/single-exec/00206.c.expected new file mode 100644 index 0000000..d8a5530 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00206.c.expected @@ -0,0 +1,5 @@ +abort = 111 +abort = 222 +abort = 333 +abort = 222 +abort = 111 diff --git a/test/regress/c-testsuite/single-exec/00206.c.otags b/test/regress/c-testsuite/single-exec/00206.c.otags new file mode 100644 index 0000000..d148b99 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00206.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/77_push_pop_macro.c diff --git a/test/regress/c-testsuite/single-exec/00206.c.tags b/test/regress/c-testsuite/single-exec/00206.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00206.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00207.c b/test/regress/c-testsuite/single-exec/00207.c new file mode 100644 index 0000000..4096495 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00207.c @@ -0,0 +1,45 @@ +#include + +/* This test segfaults as of April 27, 2015. */ +void f1(int argc) +{ + char test[argc]; + if(0) + label: + printf("boom!\n"); + if(argc-- == 0) + return; + goto label; +} + +/* This segfaulted on 2015-11-19. */ +void f2(void) +{ + goto start; + { + int a[1 && 1]; /* not a variable-length array */ + int b[1 || 1]; /* not a variable-length array */ + int c[1 ? 1 : 1]; /* not a variable-length array */ + start: + a[0] = 0; + b[0] = 0; + c[0] = 0; + } +} + +void f3(void) +{ + printf("%d\n", 0 ? printf("x1\n") : 11); + printf("%d\n", 1 ? 12 : printf("x2\n")); + printf("%d\n", 0 && printf("x3\n")); + printf("%d\n", 1 || printf("x4\n")); +} + +int main() +{ + f1(2); + f2(); + f3(); + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00207.c.expected b/test/regress/c-testsuite/single-exec/00207.c.expected new file mode 100644 index 0000000..3f4063b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00207.c.expected @@ -0,0 +1,6 @@ +boom! +boom! +11 +12 +0 +1 diff --git a/test/regress/c-testsuite/single-exec/00207.c.otags b/test/regress/c-testsuite/single-exec/00207.c.otags new file mode 100644 index 0000000..cf36897 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00207.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/78_vla_label.c diff --git a/test/regress/c-testsuite/single-exec/00207.c.tags b/test/regress/c-testsuite/single-exec/00207.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00207.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00208.c b/test/regress/c-testsuite/single-exec/00208.c new file mode 100644 index 0000000..b484fd5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00208.c @@ -0,0 +1,25 @@ +#include +struct wchar { + char *data; char mem[1]; +}; +struct wint { + char *data; int mem[1]; +}; +int f1char (void) { + char s[9]="nonono"; + struct wchar q = {"bugs"}; + return !s[0]; +} +int f1int (void) { + char s[9]="nonono"; + struct wint q = {"bugs"}; + return !s[0]; +} +int main (void) { + char s[9]="nonono"; + static struct wchar q = {"bugs", {'c'}}; + //printf ("tcc has %s %s\n", s, q.data); + if (f1char() || f1int()) + printf ("bla\n"); + return !s[0]; +} diff --git a/test/regress/c-testsuite/single-exec/00208.c.expected b/test/regress/c-testsuite/single-exec/00208.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00208.c.otags b/test/regress/c-testsuite/single-exec/00208.c.otags new file mode 100644 index 0000000..652c33c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00208.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/80_flexarray.c diff --git a/test/regress/c-testsuite/single-exec/00208.c.tags b/test/regress/c-testsuite/single-exec/00208.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00208.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00209.c b/test/regress/c-testsuite/single-exec/00209.c new file mode 100644 index 0000000..fd6d71b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00209.c @@ -0,0 +1,43 @@ +/* The following are all valid decls, even though some subtypes + are incomplete. */ +enum E *e; +const enum E *e1; +enum E const *e2; +struct S *s; +const struct S *s1; +struct S const *s2; + +/* Various strangely looking declarators, which are all valid + and have to map to the same numbered typedefs. */ +typedef int (*fptr1)(); +int f1 (int (), int); +typedef int (*fptr2)(int x); +int f2 (int (int x), int); +typedef int (*fptr3)(int); +int f3 (int (int), int); +typedef int (*fptr4[4])(int); +int f4 (int (*[4])(int), int); +typedef int (*fptr5)(fptr1); +int f5 (int (int()), fptr1); +int f1 (fptr1 fp, int i) +{ + return (*fp)(i); +} +int f2 (fptr2 fp, int i) +{ + return (*fp)(i); +} +int f3 (fptr3 fp, int i) +{ + return (*fp)(i); +} +int f4 (fptr4 fp, int i) +{ + return (*fp[i])(i); +} +int f5 (fptr5 fp, fptr1 i) +{ + return fp(i); +} +int f8 (int ([4]), int); +int main () { return 0; } diff --git a/test/regress/c-testsuite/single-exec/00209.c.expected b/test/regress/c-testsuite/single-exec/00209.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00209.c.otags b/test/regress/c-testsuite/single-exec/00209.c.otags new file mode 100644 index 0000000..0c06631 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00209.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/81_types.c diff --git a/test/regress/c-testsuite/single-exec/00209.c.tags b/test/regress/c-testsuite/single-exec/00209.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00209.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00210.c b/test/regress/c-testsuite/single-exec/00210.c new file mode 100644 index 0000000..7faeaf5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00210.c @@ -0,0 +1,40 @@ +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; + +typedef union Unaligned16a { + uint16_t u; + uint8_t b[2]; +} __attribute__((packed)) Unaligned16a; + +typedef union __attribute__((packed)) Unaligned16b { + uint16_t u; + uint8_t b[2]; +} Unaligned16b; + +extern void foo (void) __attribute__((stdcall)); +void __attribute__((stdcall)) foo (void) +{ +} + +/* The actual attribute isn't important, must just be + parsable. */ +#define ATTR __attribute__((__noinline__)) +int ATTR actual_function() { + return 42; +} + +extern int printf (const char *, ...); +int main() +{ + void *function_pointer = &actual_function; + + int a = ((ATTR int(*) (void)) function_pointer)(); + printf("%i\n", a); + + /* In the following we once misparsed 'ATTR *' is a btype + and hence the whole type was garbled. */ + int b = ( (int(ATTR *)(void)) function_pointer)(); + printf("%i\n", b); + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00210.c.expected b/test/regress/c-testsuite/single-exec/00210.c.expected new file mode 100644 index 0000000..daaac9e --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00210.c.expected @@ -0,0 +1,2 @@ +42 +42 diff --git a/test/regress/c-testsuite/single-exec/00210.c.otags b/test/regress/c-testsuite/single-exec/00210.c.otags new file mode 100644 index 0000000..3c6e696 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00210.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/82_attribs_position.c diff --git a/test/regress/c-testsuite/single-exec/00210.c.tags b/test/regress/c-testsuite/single-exec/00210.c.tags new file mode 100644 index 0000000..580e3bb --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00210.c.tags @@ -0,0 +1,3 @@ +portable +c89 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00211.c b/test/regress/c-testsuite/single-exec/00211.c new file mode 100644 index 0000000..0ef09bf --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00211.c @@ -0,0 +1,12 @@ +extern int printf(const char *format, ...); + +#define ACPI_TYPE_INVALID 0x1E +#define NUM_NS_TYPES ACPI_TYPE_INVALID+1 +int array[NUM_NS_TYPES]; + +#define n 0xe +int main() +{ + printf("n+1 = %d\n", n+1); +// printf("n+1 = %d\n", 0xe+1); +} diff --git a/test/regress/c-testsuite/single-exec/00211.c.expected b/test/regress/c-testsuite/single-exec/00211.c.expected new file mode 100644 index 0000000..2175385 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00211.c.expected @@ -0,0 +1 @@ +n+1 = 15 diff --git a/test/regress/c-testsuite/single-exec/00211.c.otags b/test/regress/c-testsuite/single-exec/00211.c.otags new file mode 100644 index 0000000..bbd9bde --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00211.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/84_hex-float.c diff --git a/test/regress/c-testsuite/single-exec/00211.c.tags b/test/regress/c-testsuite/single-exec/00211.c.tags new file mode 100644 index 0000000..f7c08bd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00211.c.tags @@ -0,0 +1,3 @@ +portable +c99 +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00212.c b/test/regress/c-testsuite/single-exec/00212.c new file mode 100644 index 0000000..744c3e2 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00212.c @@ -0,0 +1,38 @@ +#include + +int +main() +{ +#if defined(__LLP64__) + if (sizeof(short) == 2 + && sizeof(int) == 4 + && sizeof(long int) == 4 + && sizeof(long long int) == 8 + && sizeof(void*) == 8) { + (void)printf("Ok\n"); + } else { + (void)printf("KO __LLP64__\n"); + } +#elif defined(__LP64__) + if (sizeof(short) == 2 + && sizeof(int) == 4 + && sizeof(long int) == 8 + && sizeof(long long int) == 8 + && sizeof(void*) == 8) { + (void)printf("Ok\n"); + } else { + (void)printf("KO __LP64__\n"); + } +#elif defined(__ILP32__) + if (sizeof(short) == 2 + && sizeof(int) == 4 + && sizeof(long int) == 4 + && sizeof(void*) == 4) { + (void)printf("Ok\n"); + } else { + (void)printf("KO __ILP32__\n"); + } +#else + (void)printf("KO no __*LP*__ defined.\n"); +#endif +} diff --git a/test/regress/c-testsuite/single-exec/00212.c.expected b/test/regress/c-testsuite/single-exec/00212.c.expected new file mode 100644 index 0000000..7326d96 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00212.c.expected @@ -0,0 +1 @@ +Ok diff --git a/test/regress/c-testsuite/single-exec/00212.c.otags b/test/regress/c-testsuite/single-exec/00212.c.otags new file mode 100644 index 0000000..783e465 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00212.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/86_memory-model.c diff --git a/test/regress/c-testsuite/single-exec/00212.c.tags b/test/regress/c-testsuite/single-exec/00212.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00212.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00213.c b/test/regress/c-testsuite/single-exec/00213.c new file mode 100644 index 0000000..0d5a64c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00213.c @@ -0,0 +1,155 @@ +/* This checks various ways of dead code inside if statements + where there are non-obvious ways of how the code is actually + not dead due to reachable by labels. */ +extern int printf (const char *, ...); +static void kb_wait_1(void) +{ + unsigned long timeout = 2; + do { + /* Here the else arm is a statement expression that's supposed + to be suppressed. The label inside the while would unsuppress + code generation again if not handled correctly. And that + would wreak havoc to the cond-expression because there's no + jump-around emitted, the whole statement expression really + needs to not generate code (perhaps except useless forward jumps). */ + (1 ? + printf("timeout=%ld\n", timeout) : + ({ + int i = 1; + while (1) + while (i--) + some_label: + printf("error\n"); + goto some_label; + }) + ); + timeout--; + } while (timeout); +} + +static int global; + +static void foo(int i) +{ + global+=i; + printf ("g=%d\n", global); +} + +static int check(void) +{ + printf ("check %d\n", global); + return 1; +} + +static void dowhile(void) +{ + do { + foo(1); + if (global == 1) { + continue; + } else if (global == 2) { + continue; + } + /* The following break shouldn't disable the check() call, + as it's reachable by the continues above. */ + break; + } while (check()); +} + +int main (void) +{ + int i = 1; + kb_wait_1(); + + /* Simple test of dead code at first sight which isn't actually dead. */ + if (0) { +yeah: + printf ("yeah\n"); + } else { + printf ("boo\n"); + } + if (i--) + goto yeah; + + /* Some more non-obvious uses where the problems are loops, so that even + the first loop statements aren't actually dead. */ + i = 1; + if (0) { + while (i--) { + printf ("once\n"); +enterloop: + printf ("twice\n"); + } + } + if (i >= 0) + goto enterloop; + + /* The same with statement expressions. One might be tempted to + handle them specially by counting if inside statement exprs and + not unsuppressing code at loops at all then. + See kb_wait_1 for the other side of the medal where that wouldn't work. */ + i = ({ + int j = 1; + if (0) { + while (j--) { + printf ("SEonce\n"); + enterexprloop: + printf ("SEtwice\n"); + } + } + if (j >= 0) + goto enterexprloop; + j; }); + + /* The other two loop forms: */ + i = 1; + if (0) { + for (i = 1; i--;) { + printf ("once2\n"); +enterloop2: + printf ("twice2\n"); + } + } + if (i > 0) + goto enterloop2; + + i = 1; + if (0) { + do { + printf ("once3\n"); +enterloop3: + printf ("twice3\n"); + } while (i--); + } + if (i > 0) + goto enterloop3; + + /* And check that case and default labels have the same effect + of disabling code suppression. */ + i = 41; + switch (i) { + if (0) { + printf ("error\n"); + case 42: + printf ("error2\n"); + case 41: + printf ("caseok\n"); + } + } + + i = 41; + switch (i) { + if (0) { + printf ("error3\n"); + default: + printf ("caseok2\n"); + break; + case 42: + printf ("error4\n"); + } + } + + dowhile(); + + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00213.c.expected b/test/regress/c-testsuite/single-exec/00213.c.expected new file mode 100644 index 0000000..a8c93bd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00213.c.expected @@ -0,0 +1,23 @@ +timeout=2 +timeout=1 +boo +yeah +twice +once +twice +SEtwice +SEonce +SEtwice +twice2 +once2 +twice2 +twice3 +once3 +twice3 +caseok +caseok2 +g=1 +check 1 +g=2 +check 2 +g=3 diff --git a/test/regress/c-testsuite/single-exec/00213.c.otags b/test/regress/c-testsuite/single-exec/00213.c.otags new file mode 100644 index 0000000..9fc68a3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00213.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/87_dead_code.c diff --git a/test/regress/c-testsuite/single-exec/00213.c.tags b/test/regress/c-testsuite/single-exec/00213.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00213.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00214.c b/test/regress/c-testsuite/single-exec/00214.c new file mode 100644 index 0000000..647626f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00214.c @@ -0,0 +1,68 @@ +/* Check some way in where code suppression caused various + miscompilations. */ +extern int printf (const char *, ...); +typedef unsigned long size_t; + +size_t _brk_start, _brk_end; +void * extend_brk(size_t size, size_t align) +{ + size_t mask = align - 1; + void *ret = 0; + + do { + if (__builtin_expect(!!(_brk_start == 0), 0)) + do { + printf("wrong1\n"); + } while (0); + } while (0); + _brk_end = (_brk_end + mask) & ~mask; + ret = (void *)_brk_end; + _brk_end += size; + + return ret; +} + +static void get_args (int a, int b) +{ + if (a != 1) + printf("wrong2\n"); + else + printf("okay\n"); +} + +void bla(void) +{ + int __ret = 42; + ({ + if (__builtin_expect(!!(0), 0)) { + if (__builtin_expect(!!__ret, 0)) + printf("wrong3\n"); + int x = !!(__ret); + } + __ret; + }); + get_args(!!__ret, sizeof(__ret)); +} + +_Bool chk(unsigned long addr, unsigned long limit, unsigned long size) +{ + _Bool ret; + /* This just needs to compile, no runtime test. (And it doesn't compile + only with certain internal checking added that's not committed). */ + if (0) + ret = 0 != (!!(addr > limit - size)); +} + +int main() +{ + void *r; + _brk_start = 1024; + _brk_end = 1024; + r = extend_brk (4096, 16); + if (!r) + printf("wrong4\n"); + else + printf("okay\n"); + bla(); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00214.c.expected b/test/regress/c-testsuite/single-exec/00214.c.expected new file mode 100644 index 0000000..439edfd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00214.c.expected @@ -0,0 +1,2 @@ +okay +okay diff --git a/test/regress/c-testsuite/single-exec/00214.c.otags b/test/regress/c-testsuite/single-exec/00214.c.otags new file mode 100644 index 0000000..036ecfd --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00214.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/88_codeopt.c diff --git a/test/regress/c-testsuite/single-exec/00214.c.tags b/test/regress/c-testsuite/single-exec/00214.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00214.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00215.c b/test/regress/c-testsuite/single-exec/00215.c new file mode 100644 index 0000000..3a5a7e1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00215.c @@ -0,0 +1,106 @@ +extern int printf(const char *format, ...); +static void kb_wait_1(void) +{ + unsigned long timeout = 2; + do { + if (1) printf("timeout=%ld\n", timeout); + else + { + while (1) + printf("error\n"); + } + timeout--; + } while (timeout); +} +static void kb_wait_2(void) +{ + unsigned long timeout = 2; + do { + if (1) printf("timeout=%ld\n", timeout); + else + { + for (;;) + printf("error\n"); + } + timeout--; + } while (timeout); +} +static void kb_wait_2_1(void) +{ + unsigned long timeout = 2; + do { + if (1) printf("timeout=%ld\n", timeout); + else + { + do { + printf("error\n"); + } while (1); + } + timeout--; + } while (timeout); +} +static void kb_wait_2_2(void) +{ + unsigned long timeout = 2; + do { + if (1) printf("timeout=%ld\n", timeout); + else + { + label: + printf("error\n"); + goto label; + } + timeout--; + } while (timeout); +} +static void kb_wait_3(void) +{ + unsigned long timeout = 2; + do { + if (1) printf("timeout=%ld\n", timeout); + else + { + int i = 1; + goto label; + i = i + 2; + label: + i = i + 3; + } + timeout--; + } while (timeout); +} +static void kb_wait_4(void) +{ + unsigned long timeout = 2; + do { + if (1) printf("timeout=%ld\n", timeout); + else + { + switch(timeout) { + case 2: + printf("timeout is 2"); + break; + case 1: + printf("timeout is 1"); + break; + default: + printf("timeout is 0?"); + break; + }; + /* return; */ + } + timeout--; + } while (timeout); +} +int main() +{ + printf("begin\n"); + kb_wait_1(); + kb_wait_2(); + kb_wait_2_1(); + kb_wait_2_2(); + kb_wait_3(); + kb_wait_4(); + printf("end\n"); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00215.c.expected b/test/regress/c-testsuite/single-exec/00215.c.expected new file mode 100644 index 0000000..c44d4ea --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00215.c.expected @@ -0,0 +1,14 @@ +begin +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +timeout=2 +timeout=1 +end diff --git a/test/regress/c-testsuite/single-exec/00215.c.otags b/test/regress/c-testsuite/single-exec/00215.c.otags new file mode 100644 index 0000000..fdaa9b3 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00215.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/89_nocode_wanted.c diff --git a/test/regress/c-testsuite/single-exec/00215.c.tags b/test/regress/c-testsuite/single-exec/00215.c.tags new file mode 100644 index 0000000..d30bf66 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00215.c.tags @@ -0,0 +1,2 @@ +portable +c99 diff --git a/test/regress/c-testsuite/single-exec/00216.c b/test/regress/c-testsuite/single-exec/00216.c new file mode 100644 index 0000000..d931e23 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00216.c @@ -0,0 +1,282 @@ +typedef unsigned char u8; +typedef struct {} empty_s; +struct contains_empty { + u8 a; + empty_s empty; + u8 b; +}; +struct contains_empty ce = { { (1) }, (empty_s){}, 022, }; +/* The following decl of 'q' would demonstrate the TCC bug in init_putv when + handling copying compound literals. (Compound literals + aren't acceptable constant initializers in isoc99, but + we accept them like gcc, except for this case) +//char *q = (char *){ "trara" }; */ +struct SS {u8 a[3], b; }; +struct SS sinit16[] = { { 1 }, 2 }; +struct S +{ + u8 a,b; + u8 c[2]; +}; + +struct T +{ + u8 s[16]; + u8 a; +}; + +struct U +{ + u8 a; + struct S s; + u8 b; + struct T t; +}; + +struct V +{ + struct S s; + struct T t; + u8 a; +}; + +struct W +{ + struct V t; + struct S s[]; +}; + +struct S gs = ((struct S){1, 2, 3, 4}); +struct S gs2 = {1, 2, {3, 4}}; +struct T gt = {"hello", 42}; +struct U gu = {3, 5,6,7,8, 4, "huhu", 43}; +struct U gu2 = {3, {5,6,7,8}, 4, {"huhu", 43}}; +/* Optional braces around scalar initializers. Accepted, but with + a warning. */ +struct U gu3 = { {3}, {5,6,7,8,}, 4, {"huhu", 43}}; +/* Many superfluous braces and leaving out one initializer for U.s.c[1] */ +struct U gu4 = { 3, {5,6,7,}, 5, { "bla", {44}} }; +/* Superfluous braces and useless parens around values */ +struct S gs3 = { (1), {(2)}, {(((3))), {4}}}; +/* Superfluous braces, and leaving out braces for V.t, plus cast */ +struct V gv = {{{3},4,{5,6}}, "haha", (u8)45, 46}; +/* Compound literal */ +struct V gv2 = {(struct S){7,8,{9,10}}, {"hihi", 47}, 48}; +/* Parens around compound literal */ +struct V gv3 = {((struct S){7,8,{9,10}}), {"hoho", 49}, 50}; +/* Initialization of a flex array member (warns in GCC) */ +struct W gw = {{1,2,3,4}, {1,2,3,4,5}}; + +union UU { + u8 a; + u8 b; +}; +struct SU { + union UU u; + u8 c; +}; +struct SU gsu = {5,6}; + +/* Unnamed struct/union members aren't ISO C, but it's a widely accepted + extension. See below for further extensions to that under -fms-extension.*/ +union UV { + struct {u8 a,b;}; + struct S s; +}; +union UV guv = {{6,5}}; +union UV guv2 = {{.b = 7, .a = 8}}; +union UV guv3 = {.b = 8, .a = 7}; + +/* Under -fms-extensions also the following is valid: +union UV2 { + struct Anon {u8 a,b;}; // unnamed member, but tagged struct, ... + struct S s; +}; +struct Anon gan = { 10, 11 }; // ... which makes it available here. +union UV2 guv4 = {{4,3}}; // and the other inits from above as well +*/ + +struct in6_addr { + union { + u8 u6_addr8[16]; + unsigned short u6_addr16[8]; + } u; +}; +struct flowi6 { + struct in6_addr saddr, daddr; +}; +struct pkthdr { + struct in6_addr daddr, saddr; +}; +struct pkthdr phdr = { { { 6,5,4,3 } }, { { 9,8,7,6 } } }; + +struct Wrap { + void *func; +}; +int global; +void inc_global (void) +{ + global++; +} + +struct Wrap global_wrap[] = { + ((struct Wrap) {inc_global}), + inc_global, +}; + +#include +void print_ (const char *name, const u8 *p, long size) +{ + printf ("%s:", name); + while (size--) { + printf (" %x", *p++); + } + printf ("\n"); +} +#define print(x) print_(#x, (u8*)&x, sizeof (x)) +#if 1 +void foo (struct W *w, struct pkthdr *phdr_) +{ + struct S ls = {1, 2, 3, 4}; + struct S ls2 = {1, 2, {3, 4}}; + struct T lt = {"hello", 42}; + struct U lu = {3, 5,6,7,8, 4, "huhu", 43}; + struct U lu1 = {3, ls, 4, {"huhu", 43}}; + struct U lu2 = {3, (ls), 4, {"huhu", 43}}; + const struct S *pls = &ls; + struct S ls21 = *pls; + struct U lu22 = {3, *pls, 4, {"huhu", 43}}; + /* Incomplete bracing. */ + struct U lu21 = {3, ls, 4, "huhu", 43}; + /* Optional braces around scalar initializers. Accepted, but with + a warning. */ + struct U lu3 = { 3, {5,6,7,8,}, 4, {"huhu", 43}}; + /* Many superfluous braces and leaving out one initializer for U.s.c[1] */ + struct U lu4 = { 3, {5,6,7,}, 5, { "bla", 44} }; + /* Superfluous braces and useless parens around values */ + struct S ls3 = { (1), (2), {(((3))), 4}}; + /* Superfluous braces, and leaving out braces for V.t, plus cast */ + struct V lv = {{3,4,{5,6}}, "haha", (u8)45, 46}; + /* Compound literal */ + struct V lv2 = {(struct S)w->t.s, {"hihi", 47}, 48}; + /* Parens around compound literal */ + struct V lv3 = {((struct S){7,8,{9,10}}), ((const struct W *)w)->t.t, 50}; + const struct pkthdr *phdr = phdr_; + struct flowi6 flow = { .daddr = phdr->daddr, .saddr = phdr->saddr }; + int elt = 0x42; + /* Range init, overlapping */ + struct T lt2 = { { [1 ... 5] = 9, [6 ... 10] = elt, [4 ... 7] = elt+1 }, 1 }; + print(ls); + print(ls2); + print(lt); + print(lu); + print(lu1); + print(lu2); + print(ls21); + print(lu21); + print(lu22); + print(lu3); + print(lu4); + print(ls3); + print(lv); + print(lv2); + print(lv3); + print(lt2); + print(flow); +} +#endif + +void test_compound_with_relocs (void) +{ + struct Wrap local_wrap[] = { + ((struct Wrap) {inc_global}), + inc_global, + }; + void (*p)(void); + p = global_wrap[0].func; p(); + p = global_wrap[1].func; p(); + p = local_wrap[0].func; p(); + p = local_wrap[1].func; p(); +} + +void sys_ni(void) { printf("ni\n"); } +void sys_one(void) { printf("one\n"); } +void sys_two(void) { printf("two\n"); } +void sys_three(void) { printf("three\n"); } +typedef void (*fptr)(void); +const fptr table[3] = { + [0 ... 2] = &sys_ni, + [0] = sys_one, + [1] = sys_two, + [2] = sys_three, +}; + +void test_multi_relocs(void) +{ + int i; + for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) + table[i](); +} + +/* Following is from GCC gcc.c-torture/execute/20050613-1.c. */ + +struct SEA { int i; int j; int k; int l; }; +struct SEB { struct SEA a; int r[1]; }; +struct SEC { struct SEA a; int r[0]; }; +struct SED { struct SEA a; int r[]; }; + +static void +test_correct_filling (struct SEA *x) +{ + static int i; + if (x->i != 0 || x->j != 5 || x->k != 0 || x->l != 0) + printf("sea_fill%d: wrong\n", i); + else + printf("sea_fill%d: okay\n", i); + i++; +} + +int +test_zero_init (void) +{ + /* The peculiarity here is that only a.j is initialized. That + means that all other members must be zero initialized. TCC + once didn't do that for sub-level designators. */ + struct SEB b = { .a.j = 5 }; + struct SEC c = { .a.j = 5 }; + struct SED d = { .a.j = 5 }; + test_correct_filling (&b.a); + test_correct_filling (&c.a); + test_correct_filling (&d.a); + return 0; +} + +int main() +{ + print(ce); + print(gs); + print(gs2); + print(gt); + print(gu); + print(gu2); + print(gu3); + print(gu4); + print(gs3); + print(gv); + print(gv2); + print(gv3); + print(sinit16); + print(gw); + print(gsu); + print(guv); + print(guv.b); + print(guv2); + print(guv3); + print(phdr); + foo(&gw, &phdr); + //printf("q: %s\n", q); + test_compound_with_relocs(); + test_multi_relocs(); + test_zero_init(); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00216.c.expected b/test/regress/c-testsuite/single-exec/00216.c.expected new file mode 100644 index 0000000..e366121 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00216.c.expected @@ -0,0 +1,43 @@ +ce: 1 12 +gs: 1 2 3 4 +gs2: 1 2 3 4 +gt: 68 65 6c 6c 6f 0 0 0 0 0 0 0 0 0 0 0 2a +gu: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +gu2: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +gu3: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +gu4: 3 5 6 7 0 5 62 6c 61 0 0 0 0 0 0 0 0 0 0 0 0 0 2c +gs3: 1 2 3 4 +gv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e +gv2: 7 8 9 a 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 +gv3: 7 8 9 a 68 6f 68 6f 0 0 0 0 0 0 0 0 0 0 0 0 31 32 +sinit16: 1 0 0 0 2 0 0 0 +gw: 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +gsu: 5 6 +guv: 6 5 0 0 +guv.b: 5 +guv2: 8 7 0 0 +guv3: 7 8 0 0 +phdr: 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 +ls: 1 2 3 4 +ls2: 1 2 3 4 +lt: 68 65 6c 6c 6f 0 0 0 0 0 0 0 0 0 0 0 2a +lu: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu1: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu2: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +ls21: 1 2 3 4 +lu21: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu22: 3 1 2 3 4 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu3: 3 5 6 7 8 4 68 75 68 75 0 0 0 0 0 0 0 0 0 0 0 0 2b +lu4: 3 5 6 7 0 5 62 6c 61 0 0 0 0 0 0 0 0 0 0 0 0 0 2c +ls3: 1 2 3 4 +lv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e +lv2: 1 2 3 4 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30 +lv3: 7 8 9 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 +lt2: 0 9 9 9 43 43 43 43 42 42 42 0 0 0 0 0 1 +flow: 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0 +one +two +three +sea_fill0: okay +sea_fill1: okay +sea_fill2: okay diff --git a/test/regress/c-testsuite/single-exec/00216.c.otags b/test/regress/c-testsuite/single-exec/00216.c.otags new file mode 100644 index 0000000..8637280 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00216.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/90_struct-init.c diff --git a/test/regress/c-testsuite/single-exec/00216.c.tags b/test/regress/c-testsuite/single-exec/00216.c.tags new file mode 100644 index 0000000..2a62fb7 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00216.c.tags @@ -0,0 +1,3 @@ +portable +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00217.c b/test/regress/c-testsuite/single-exec/00217.c new file mode 100644 index 0000000..bf07915 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00217.c @@ -0,0 +1,15 @@ +int printf(const char *, ...); +char t[] = "012345678"; + +int main(void) +{ + char *data = t; + unsigned long long r = 4; + unsigned a = 5; + unsigned long long b = 12; + + *(unsigned*)(data + r) += a - b; + + printf("data = \"%s\"\n", data); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00217.c.expected b/test/regress/c-testsuite/single-exec/00217.c.expected new file mode 100644 index 0000000..f91e4b4 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00217.c.expected @@ -0,0 +1 @@ +data = "0123-5678" diff --git a/test/regress/c-testsuite/single-exec/00217.c.otags b/test/regress/c-testsuite/single-exec/00217.c.otags new file mode 100644 index 0000000..20444ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00217.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/91_ptr_longlong_arith32.c diff --git a/test/regress/c-testsuite/single-exec/00217.c.tags b/test/regress/c-testsuite/single-exec/00217.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00217.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00218.c b/test/regress/c-testsuite/single-exec/00218.c new file mode 100644 index 0000000..bb6dc35 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00218.c @@ -0,0 +1,57 @@ +/* This checks if enums needing 8 bit but only having positive + values are correctly zero extended (instead of sign extended) + when stored into/loaded from a 8 bit bit-field of enum type (which + itself is implementation defined, so isn't necessarily supported by all + other compilers). */ +enum tree_code { + SOME_CODE = 148, /* has bit 7 set, and hence all further enum values as well */ + LAST_AND_UNUSED_TREE_CODE +}; +typedef union tree_node *tree; +struct tree_common +{ + union tree_node *chain; + union tree_node *type; + enum tree_code code : 8; + unsigned side_effects_flag : 1; +}; +union tree_node +{ + struct tree_common common; + }; +enum c_tree_code { + C_DUMMY_TREE_CODE = LAST_AND_UNUSED_TREE_CODE, + STMT_EXPR, + LAST_C_TREE_CODE +}; +enum cplus_tree_code { + CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE, + AMBIG_CONV, + LAST_CPLUS_TREE_CODE +}; + +extern int printf(const char *, ...); +int blah(){return 0;} + +int convert_like_real (tree convs) +{ + switch (((enum tree_code) (convs)->common.code)) + { + case AMBIG_CONV: /* This has bit 7 set, which must not be the sign + bit in tree_common.code, i.e. the bitfield must + be somehow marked unsigned. */ + return blah(); + default: + break; + }; + printf("unsigned enum bit-fields broken\n"); +} + +int main() +{ + union tree_node convs; + + convs.common.code = AMBIG_CONV; + convert_like_real (&convs); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00218.c.expected b/test/regress/c-testsuite/single-exec/00218.c.expected new file mode 100644 index 0000000..e69de29 diff --git a/test/regress/c-testsuite/single-exec/00218.c.otags b/test/regress/c-testsuite/single-exec/00218.c.otags new file mode 100644 index 0000000..fd7ae0b --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00218.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/92_enum_bitfield.c diff --git a/test/regress/c-testsuite/single-exec/00218.c.tags b/test/regress/c-testsuite/single-exec/00218.c.tags new file mode 100644 index 0000000..2039992 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00218.c.tags @@ -0,0 +1,2 @@ +portable +c89 diff --git a/test/regress/c-testsuite/single-exec/00219.c b/test/regress/c-testsuite/single-exec/00219.c new file mode 100644 index 0000000..4804f65 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00219.c @@ -0,0 +1,72 @@ +#include + +const int a = 0; + +struct a { + int a; +}; + +struct b { + int a; +}; + +int a_f() +{ + return 20; +} + +int b_f() +{ + return 10; +} + +typedef int (*fptr)(int); +int foo(int i) +{ + return i; +} + +typedef int int_type1; + +#define gen_sw(a) _Generic(a, const char *: 1, default: 8, int: 123); + +int main() +{ + int i = 0; + signed long int l = 2; + struct b titi; + const int * const ptr; + const char *ti; + int_type1 i2; + + i = _Generic(a, int: a_f, const int: b_f)(); + printf("%d\n", i); + i = _Generic(a, int: a_f() / 2, const int: b_f() / 2); + printf("%d\n", i); + i = _Generic(ptr, int *:1, int * const:2, default:20); + printf("%d\n", i); + i = gen_sw(a); + printf("%d\n", i); + i = _Generic(titi, struct a:1, struct b:2, default:20); + printf("%d\n", i); + i = _Generic(i2, char: 1, int : 0); + printf("%d\n", i); + i = _Generic(a, char:1, int[4]:2, default:5); + printf("%d\n", i); + i = _Generic(17, int :1, int **:2); + printf("%d\n", i); + i = _Generic(17L, int :1, long :2, long long : 3); + printf("%d\n", i); + i = _Generic("17, io", char *: 3, const char *: 1); + printf("%d\n", i); + i = _Generic(ti, const unsigned char *:1, const char *:4, char *:3, + const signed char *:2); + printf("%d\n", i); + printf("%s\n", _Generic(i + 2L, long: "long", int: "int", + long long: "long long")); + i = _Generic(l, long: 1, int: 2); + printf("%d\n", i); + i = _Generic(foo, fptr: 3, int: 4); + printf("%d\n", i); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00219.c.expected b/test/regress/c-testsuite/single-exec/00219.c.expected new file mode 100644 index 0000000..748d78f --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00219.c.expected @@ -0,0 +1,14 @@ +20 +10 +20 +123 +2 +0 +5 +1 +2 +3 +4 +long +1 +3 diff --git a/test/regress/c-testsuite/single-exec/00219.c.otags b/test/regress/c-testsuite/single-exec/00219.c.otags new file mode 100644 index 0000000..4b42d43 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00219.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/94_generic.c diff --git a/test/regress/c-testsuite/single-exec/00219.c.tags b/test/regress/c-testsuite/single-exec/00219.c.tags new file mode 100644 index 0000000..73a2eb1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00219.c.tags @@ -0,0 +1,4 @@ +portable +c89 +needs-libc +needs-cpp diff --git a/test/regress/c-testsuite/single-exec/00220.c b/test/regress/c-testsuite/single-exec/00220.c new file mode 100644 index 0000000..88029c1 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00220.c @@ -0,0 +1,12 @@ +// this file contains BMP chars encoded in UTF-8 +#include +//#include + +int main() +{ + unsigned int* s = (unsigned int*)L"hello$$你好¢¢世界€€world"; + unsigned int *p; + for (p = s; *p; p++) printf("%04X ", (unsigned) *p); + printf("\n"); + return 0; +} diff --git a/test/regress/c-testsuite/single-exec/00220.c.expected b/test/regress/c-testsuite/single-exec/00220.c.expected new file mode 100644 index 0000000..9a1593c --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00220.c.expected @@ -0,0 +1 @@ +0068 0065 006C 006C 006F 0024 0024 4F60 597D 00A2 00A2 4E16 754C 20AC 20AC 0077 006F 0072 006C 0064 diff --git a/test/regress/c-testsuite/single-exec/00220.c.otags b/test/regress/c-testsuite/single-exec/00220.c.otags new file mode 100644 index 0000000..40283e5 --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00220.c.otags @@ -0,0 +1,4 @@ +org=https://bellard.org/tcc/ +repository=git://repo.or.cz/tinycc.git +version=61ba9f229955f105af9d7dcdbfcc9c9effbe8af3 +path=tests/tests2/97_utf8_string_literal.c diff --git a/test/regress/c-testsuite/single-exec/00220.c.tags b/test/regress/c-testsuite/single-exec/00220.c.tags new file mode 100644 index 0000000..c7544ad --- /dev/null +++ b/test/regress/c-testsuite/single-exec/00220.c.tags @@ -0,0 +1,4 @@ +portable +c99 +needs-libc +needs-cpp diff --git a/test/regress/stackl_test/LICENSE.txt b/test/regress/stackl_test/LICENSE.txt new file mode 100644 index 0000000..7e03a4a --- /dev/null +++ b/test/regress/stackl_test/LICENSE.txt @@ -0,0 +1,23 @@ +https://github.com/philip-w-howard/stackl + +The MIT License (MIT) + +Copyright (c) 2015-2017 Philip W. Howard + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/regress/stackl_test/test1.c b/test/regress/stackl_test/test1.c new file mode 100644 index 0000000..279dae7 --- /dev/null +++ b/test/regress/stackl_test/test1.c @@ -0,0 +1,7 @@ +// Test main and OUTS + +int main() +{ + printf("Hello world\n"); + return 0; +} diff --git a/test/regress/stackl_test/test1.c.expected b/test/regress/stackl_test/test1.c.expected new file mode 100644 index 0000000..802992c --- /dev/null +++ b/test/regress/stackl_test/test1.c.expected @@ -0,0 +1 @@ +Hello world diff --git a/test/regress/stackl_test/test10.c.disable b/test/regress/stackl_test/test10.c.disable new file mode 100644 index 0000000..dd46360 --- /dev/null +++ b/test/regress/stackl_test/test10.c.disable @@ -0,0 +1,6 @@ +int main() +{ + long i = -1; + printf("%d\n", l); + return 0; +} diff --git a/test/regress/stackl_test/test10.c.expected b/test/regress/stackl_test/test10.c.expected new file mode 100644 index 0000000..3a2e3f4 --- /dev/null +++ b/test/regress/stackl_test/test10.c.expected @@ -0,0 +1 @@ +-1 diff --git a/test/regress/stackl_test/test2.c b/test/regress/stackl_test/test2.c new file mode 100644 index 0000000..103a346 --- /dev/null +++ b/test/regress/stackl_test/test2.c @@ -0,0 +1,17 @@ +// test if/else + +int main() +{ + if (1) + printf("if works\n"); + else + printf("if 1 broken\n"); + + if (0) + printf("if 2 broken\n"); + else + printf("if-else works\n"); + + return 0; +} + diff --git a/test/regress/stackl_test/test2.c.expected b/test/regress/stackl_test/test2.c.expected new file mode 100644 index 0000000..3eb4fd5 --- /dev/null +++ b/test/regress/stackl_test/test2.c.expected @@ -0,0 +1,2 @@ +if works +if-else works diff --git a/test/regress/stackl_test/test3.c b/test/regress/stackl_test/test3.c new file mode 100644 index 0000000..2f8336c --- /dev/null +++ b/test/regress/stackl_test/test3.c @@ -0,0 +1,342 @@ +//#include +//#include + +// test expressions and all operators +// +int DoNotPrintMe() +{ + printf("failure\n"); + return 1; +} + +int DoPrintMe(int ret) +{ + printf("success\n"); + return ret; +} + +int main() +{ + int x; + int y; + int z; + + // EQUAL + if (5 == 5) + if (5 == 6) + printf("EQ 1 broken\n"); + else + printf("EQ works\n"); + else + printf("EQ 2 broken\n"); + + // NE + x = 5; + y = 6; + z = 5; + if (x != y) + if (x != z) + printf("NE 1 broken\n"); + else + printf("NE works\n"); + else + printf("NE 2 broken\n"); + + // AND + if (5 && 4) + if (4 && 0) + printf("AND 1 broken\n"); + else + printf("AND works\n"); + else + printf("AND 2 broken\n"); + + // OR + if ( (0 || 1) && (1 || 0) && (1 || 1)) + if (0 || 0) + printf("OR 1 broken\n"); + else + printf("OR works\n"); + else + printf("OR 2 broken\n"); + + // GT + if (5 > 4) + if (4 > 4 || 4 > 5) + printf("GT 1 broken\n"); + else + printf("GT works\n"); + else + printf("GT 2 broken\n"); + + // LT + if (4 < 5) + if (4 < 4 || 5 < 4) + printf("LT 1 broken\n"); + else + printf("LT works\n"); + else + printf("LT 2 broken\n"); + + // GE + if (5 >=4 && 4 >= 4) + if (4 >= 5) + printf("GE 1 broken\n"); + else + printf("GE works\n"); + else + printf("GE 2 broken\n"); + + // LE + if (4 <= 5 && 4 <= 4) + if (5 < 4) + printf("LE 1 broken\n"); + else + printf("LE works\n"); + else + printf("LE 2 broken\n"); + + // PLUS + x = 2; + y = x + 1; + if (y == 3) + printf("PLUS works\n"); + else + printf("PLUS broken\n"); + + // MINUS + z = 11-y; + if (z == 8) + printf("MINUS works\n"); + else + printf("MINUS broken\n"); + + // TIMES + z = x*3; + if (z == 6) + printf("TIMES works\n"); + else + printf("TIMES broken\n"); + + // DIVIDE + x = 2; + y = 11/x; + if (y == 5) + printf("DIVIDE works\n"); + else + printf("DIVIDE broken\n"); + + // MOD + z = 13; + x = z % 5; + if (x == 3) + printf("MOD works\n"); + else + printf("MOD broken\n"); + + // XOR + x = 0x5A5AA5A5; + z = x ^ 0x0F0F; + if (z == 0x5A5AAAAA) + printf("XOR works\n"); + else + printf("XOR broken\n"); + + // Bitwise AND + x = 0x5A5AA5A5; + z = x & 0x0F0F; + if (z == 0x0505) + printf("Bitwise AND works\n"); + else + printf("Bitwise AND broken\n"); + + // Bitwise OR + x = 0x5A5AA5A5; + z = x | 0x0F0F; + if (z == 0x5A5AAFAF) + printf("Bitwise OR works\n"); + else + printf("Bitwise OR broken\n"); + + // shift left + z = 0x0555 << 1; + if (z == 0x0AAA) + printf("shift left works\n"); + else + printf("shift left broken\n"); + + // shift right + x = z >> 1; + if (x == 0x0555) + printf("shift right works\n"); + else + printf("shift right broken\n"); + + // NEG + x = 11; + z = -x + 20; + if (z == 9) + printf("NEG works\n"); + else + printf("NEG broken\n"); + + // NOT + x = 0x5A5AA5A5; + z = !x; + if (z == 0) + printf("NOT 1 works\n"); + else + printf("NOT 1 broken\n"); + + z = 0; + x = !z; + if (x) + printf("NOT 2 works\n"); + else + printf("NOT 2 broken\n"); + + // COMP + x = 0x5A5AA5A5; + z = ~x; + + if (z == 0xA5A55A5A) + printf("COMP works\n"); + else + printf("COMP broken\n"); + + // PLUS_EQ + z = 5; + z += 7; + if (z == 12) + printf("PLUS_EQ works\n"); + else + printf("PLUS_EQ broken\n"); + + // MINUS_EQ + z = 5; + z -= 7; + if (z == -2) + printf("MINUS_EQ works\n"); + else + printf("MINUS_EQ broken\n"); + + // TIMES_EQ + z = 5; + z *= 7; + if (z == 35) + printf("TIMES_EQ works\n"); + else + printf("TIMES_EQ broken\n"); + + // DIVIDE_EQ + z = 35; + z /= 7; + if (z == 5) + printf("DIVIDE_EQ works\n"); + else + printf("DIVIDE_EQ broken\n"); + + // MOD_EQ + z = 37; + z %= 7; + if (z == 2) + printf("MOD_EQ works\n"); + else + printf("MOD_EQ broken\n"); + + // OR_EQ + z = 0x0A5A5; + z |= 0xFF; + if (z == 0x0A5FF) + printf("OR_EQ works\n"); + else + printf("OR_EQ broken\n"); + + // AND_EQ + z = 0x0A5A5; + z &= 0xFF; + if (z == 0xA5) + printf("AND_EQ works\n"); + else + printf("AND_EQ broken\n"); + + // XOR_EQ + z = 0x0A5A5; + z ^= 0xFF; + if (z == 0x0A55A) + printf("XOR_EQ works\n"); + else + printf("XOR_EQ broken\n"); + + // LEFT_EQ + z = 0x0555; + z <<= 2; + if (z == 0x1554) + printf("LEFT_EQ works\n"); + else + printf("LEFT_EQ broken\n"); + + // RIGHT_EQ + z = 0x1554; + z >>= 2; + if (z == 0x0555) + printf("RIGHT_EQ works\n"); + else + printf("RIGHT_EQ broken\n"); + + // post INC + z = 35; + x = z++; + if (x == 35 && z == 36) + printf("post INC works\n"); + else + printf("post INC broken\n"); + + // post DEC + z = 37; + x = z--; + if (x == 37 && z == 36) + printf("post DEC works\n"); + else + printf("post DEC broken\n"); + + // pre INC + z = 36; + x = ++z; + if (x == 37 && z == 37) + printf("pre INC works\n"); + else + printf("pre INC broken\n"); + + // pre DEC + z = 36; + x = --z; + if (x == 35 && z == 35) + printf("pre DEC works\n"); + else + printf("pre DEC broken\n"); + + // equals in expr + z = 36; + z = (x = 5); + if (z==5 && x==5) + printf("equals in expr works\n"); + else + printf("equals in expr broken\n"); + + // Check short circuit nature of || and && + // + if(0 && DoNotPrintMe()) + printf("failure\n"); + if(1 || DoNotPrintMe()) + printf("success\n"); + if(1 && DoPrintMe(0)) + printf("failure\n"); + if(0 || DoPrintMe(0)) + printf("failure\n"); + if(1 && DoPrintMe(1)) + printf("success\n"); + if(0 || DoPrintMe(1)) + printf("success\n"); +} + diff --git a/test/regress/stackl_test/test3.c.expected b/test/regress/stackl_test/test3.c.expected new file mode 100644 index 0000000..0722719 --- /dev/null +++ b/test/regress/stackl_test/test3.c.expected @@ -0,0 +1,44 @@ +EQ works +NE works +AND works +OR works +GT works +LT works +GE works +LE works +PLUS works +MINUS works +TIMES works +DIVIDE works +MOD works +XOR works +Bitwise AND works +Bitwise OR works +shift left works +shift right works +NEG works +NOT 1 works +NOT 2 works +COMP works +PLUS_EQ works +MINUS_EQ works +TIMES_EQ works +DIVIDE_EQ works +MOD_EQ works +OR_EQ works +AND_EQ works +XOR_EQ works +LEFT_EQ works +RIGHT_EQ works +post INC works +post DEC works +pre INC works +pre DEC works +equals in expr works +success +success +success +success +success +success +success diff --git a/test/regress/stackl_test/test4.c b/test/regress/stackl_test/test4.c new file mode 100644 index 0000000..9787fa8 --- /dev/null +++ b/test/regress/stackl_test/test4.c @@ -0,0 +1,10 @@ + +int main() +{ + int ii; + for (ii = 0 ; ii<5 ; ii = ii+1) + { + printf("for loop\n"); + } + return 0; +} diff --git a/test/regress/stackl_test/test4.c.expected b/test/regress/stackl_test/test4.c.expected new file mode 100644 index 0000000..3dd0f32 --- /dev/null +++ b/test/regress/stackl_test/test4.c.expected @@ -0,0 +1,5 @@ +for loop +for loop +for loop +for loop +for loop diff --git a/test/regress/stackl_test/test5.c b/test/regress/stackl_test/test5.c new file mode 100644 index 0000000..9b67eb4 --- /dev/null +++ b/test/regress/stackl_test/test5.c @@ -0,0 +1,11 @@ + +int main() +{ + int ii; + ii = 0; + while (ii < 3) + { + puts("while loop\n"); + ii = ii + 1; + } +} diff --git a/test/regress/stackl_test/test5.c.expected b/test/regress/stackl_test/test5.c.expected new file mode 100644 index 0000000..6be65b3 --- /dev/null +++ b/test/regress/stackl_test/test5.c.expected @@ -0,0 +1,3 @@ +while loop +while loop +while loop diff --git a/test/regress/stackl_test/test6.c b/test/regress/stackl_test/test6.c new file mode 100644 index 0000000..5040fb2 --- /dev/null +++ b/test/regress/stackl_test/test6.c @@ -0,0 +1,39 @@ +// Test character arrays and pointers +int main() +{ + char *cptr; + char carr[20]; + char carr1[51]; + + cptr = carr; + cptr[0] = 'x'; + carr[1] = 'x'; + cptr[2] = '\n'; + carr[3] = 0; + puts(carr); + puts(cptr); + puts("The end\n"); + //prints(carr); + //prints(cptr); + //prints("The end\n"); + + cptr = "this is a cptr\n"; + puts(cptr); + //prints(cptr); + + cptr += 5; + puts(cptr); + //prints(cptr); + + cptr = carr1; + carr1[0] = 'h'; + carr1[1] = 'e'; + carr1[2] = 'l'; + carr1[3] = 'l'; + carr1[4] = 'o'; + carr1[5] = '\n'; + carr1[6] = 0; + + puts(cptr); + //prints(cptr); +} diff --git a/test/regress/stackl_test/test6.c.expected b/test/regress/stackl_test/test6.c.expected new file mode 100644 index 0000000..4b03171 --- /dev/null +++ b/test/regress/stackl_test/test6.c.expected @@ -0,0 +1,7 @@ +xx +xx +The end +this is a cptr +is a cptr +hello + diff --git a/test/regress/stackl_test/test7.c.disable b/test/regress/stackl_test/test7.c.disable new file mode 100644 index 0000000..b7f4d38 --- /dev/null +++ b/test/regress/stackl_test/test7.c.disable @@ -0,0 +1,180 @@ +//#include + +int main() +{ + int x; + + x = 1234; + printi(x); + prints("\n"); + + x = 0x1234; + printx(x); + prints("\n"); + + x = 0xFEDC; + printx(x); + prints("\n"); + + x = 0xA5; + printxn(x,4); + prints("\n"); + + x = 0; + printi(x); + prints("\n"); + + x = -789; + printi(x); + prints("\n"); + + { + char *ptr; + char array[20]; + ptr = "1234\n"; + + printi( strlen(ptr) ); + prints("\n"); + strcpy(array, ptr); + prints( array ); + + array[6] = '\n'; + array[7] = 0; + ptr = "this is a test"; + strncpy(array, ptr, 6); + prints(array); + + ptr = "abcdefghij\n"; + ptr = strchr(ptr, 'f'); + prints(ptr); + + strcpy(array, "this is"); + strcat(array, "a test"); + strcat(array, "\n"); + prints(array); + } + { + char *ptr; + char array[10]; + int result; + ptr = "1234\n"; + + printi( strlen(ptr) ); + prints("\n"); + strcpy(array, ptr); + prints( array ); + + array[6] = '\n'; + array[7] = 0; + ptr = "this is a test"; + strncpy(array, ptr, 6); + prints(array); + + ptr = "abcdefghij\n"; + ptr = strchr(ptr, 'f'); + prints(ptr); + + prints("Checking strcmp\n"); + ptr = "12345"; + strcpy(array, ptr); + if (strcmp(array, ptr) != 0) prints("strcmp is broken\n"); + + ptr = "12346"; + if ( strcmp(ptr, array) <= 0) prints("strcmp is broken\n"); + if ( strcmp(array, ptr) >= 0) prints("strcmp is broken\n"); + + ptr = "1234"; + if ( strcmp(ptr, array) >= 0) prints("strcmp is broken\n"); + if ( strcmp(array, ptr) <= 0) prints("strcmp is broken\n"); + } + + { + char str1[10]; + char str2[10]; + char buff[20]; + + strcpy(str1, "1234"); + strcpy(str2, "789"); + + strrev(str1); + strrev(str2); + if (strcmp(str1, "4321") == 0) + prints("strrev worked\n"); + else + prints("strrev broken\n"); + + if (strcmp(str2, "987") == 0) + prints("strrev worked\n"); + else + prints("strrev broken\n"); + + itostr(123, buff); + if (strcmp("123", buff) == 0) + prints("itostr worked\n"); + else + prints("itostr broken\n"); + + if (strcmp("1234", itostr(1234, buff)) == 0) + prints("itostr worked\n"); + else + prints("itostr broken\n"); + + itostr(-7890, buff); + if (strcmp("-7890", buff) == 0) + prints("itostr worked\n"); + else + prints("itostr broken\n"); + + itostr(-456, buff); + if (strcmp("-456", buff) == 0) + prints("itostr worked\n"); + else + prints("itostr broken\n"); + + itostr(0, buff); + if (strcmp("0", buff) == 0) + prints("itostr worked\n"); + else + prints("itostr broken\n"); + + xtostr(0x123, buff); + if (strcmp("123", buff) == 0) + prints("xtostr worked\n"); + else + prints("xtostr broken\n"); + + char buff2[20]; + int ii; + for (ii=0; ii 0) + prints("memcmp worked\n"); + else + prints("memcmp broken\n"); + + return 0; + } + + if (1) ; // make sure we allow if with null statements + + return 0; +} diff --git a/test/regress/stackl_test/test7.c.expected b/test/regress/stackl_test/test7.c.expected new file mode 100644 index 0000000..ff30a77 --- /dev/null +++ b/test/regress/stackl_test/test7.c.expected @@ -0,0 +1,27 @@ +1234 +1234 +FEDC +00A5 +0 +-789 +5 +1234 +this i +fghij +this isa test +5 +1234 +this i +fghij +Checking strcmp +strrev worked +strrev worked +itostr worked +itostr worked +itostr worked +itostr worked +itostr worked +xtostr worked +memcpy worked +memcmp worked +memcmp worked diff --git a/test/regress/stackl_test/test8.c b/test/regress/stackl_test/test8.c new file mode 100644 index 0000000..10122ea --- /dev/null +++ b/test/regress/stackl_test/test8.c @@ -0,0 +1,32 @@ +//#include + +int f2(); +int f1(int a, int b); + +int f1(int a, int b) +{ + printf("%d", a + b); + puts("\n"); + return a + b; +} +int main() +{ + int ret; + printf("%d", 0); + puts("\n"); + f1(5, 8); + ret = f2(); + printf("%d", 3); + puts("\n"); + printf("%d", ret); + puts("\n"); + ret = 2*f2() - 3; + printf("%d", ret); + puts("\n"); +} +int f2() +{ + printf("%d", 2); + puts("\n"); + return 4; +} diff --git a/test/regress/stackl_test/test8.c.expected b/test/regress/stackl_test/test8.c.expected new file mode 100644 index 0000000..9cc5660 --- /dev/null +++ b/test/regress/stackl_test/test8.c.expected @@ -0,0 +1,8 @@ +0 +13 +2 +3 +4 +2 +5 + diff --git a/test/regress/stackl_test/test9.c.disable b/test/regress/stackl_test/test9.c.disable new file mode 100644 index 0000000..d455f16 --- /dev/null +++ b/test/regress/stackl_test/test9.c.disable @@ -0,0 +1,81 @@ +//#include + +typedef struct +{ + int aa; + int bb; + char cc; +} struct_t; + +int main() +{ + prints("Testing pointer arithmetic\n"); + + { + char data[10]; + int ii; + + for (ii=0; ii<10; ii++) + { + data[ii] = (char)ii; + } + + char *ptr; + ptr = data; + for (ii=0; ii<10; ii++) + { + if (*ptr++ != data[ii]) + { + prints("pointer error "); + printi((int)ptr); + prints(" "); + printi((int)&data[ii]); + prints("\n"); + } + else + { + prints("Index "); + printi(ii); + prints(" OK\n"); + } + } + } + + { + char *cptr; + int *iptr; + struct_t *sptr; + void *vptr; + int ii; + + cptr = 0; + iptr = 0; + sptr = 0; + vptr = 0; + for (ii=0; ii<10; ii++) + { + if (cptr++ != (char*)ii) + prints("char pointer arithmetic error\n"); + else + prints("char pointer arithmetic OK\n"); + + if (iptr++ != (int *)(ii*4)) + prints("int pointer arithmetic error\n"); + else + prints("int pointer arithmetic OK\n"); + + if (sptr++ != (struct_t*)(ii*sizeof(struct_t)) ) + prints("struct pointer arithmetic error\n"); + else + prints("struct pointer arithmetic OK\n"); + + if (vptr++ != (void*)ii) + prints("void pointer arithmetic error\n"); + else + prints("void pointer arithmetic OK\n"); + } + } + + prints("Test complete\n"); + return 0; +} diff --git a/test/regress/stackl_test/test9.c.expected b/test/regress/stackl_test/test9.c.expected new file mode 100644 index 0000000..0fb9e29 --- /dev/null +++ b/test/regress/stackl_test/test9.c.expected @@ -0,0 +1,52 @@ +Testing pointer arithmetic +Index 0 OK +Index 1 OK +Index 2 OK +Index 3 OK +Index 4 OK +Index 5 OK +Index 6 OK +Index 7 OK +Index 8 OK +Index 9 OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +char pointer arithmetic OK +int pointer arithmetic OK +struct pointer arithmetic OK +void pointer arithmetic OK +Test complete diff --git a/test/run_regress_test b/test/run_regress_test new file mode 100755 index 0000000..ee968a9 --- /dev/null +++ b/test/run_regress_test @@ -0,0 +1,18 @@ +#!/bin/bash +exe_file=$1 +byte_code_file=$2 +correct_file=$3 +out_file=$byte_code_file.out + +#$exe_file.dbg $byte_code_file > $out_file +#$exe_file.trace -v $byte_code_file > $out_file +$exe_file $byte_code_file > $out_file +RETVAL=$? +[ $RETVAL -ne 0 ] && rm $out_file && echo $byte_code_file FAILED && exit $RETVAL + +diff -qbwB $out_file $correct_file +RETVAL=$? +rm $out_file +[ $RETVAL -eq 0 ] && echo $byte_code_file PASSED +[ $RETVAL -ne 0 ] && echo $byte_code_file FAILED +exit $RETVAL