Skip to content

Uncommented c_interop test #2864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ RUN(NAME test_builtin_round LABELS cpython llvm llvm_jit c)
# RUN(NAME test_math_03 LABELS llvm llvm_jit) #1595: TODO: Test using CPython (3.11 recommended)
# RUN(NAME test_pass_compare LABELS cpython llvm llvm_jit) # renable c # post sync
RUN(NAME test_c_interop_01 LABELS cpython llvm llvm_jit c)
# RUN(NAME test_c_interop_02 LABELS cpython llvm c
# EXTRAFILES test_c_interop_02b.c)
RUN(NAME test_c_interop_02 LABELS llvm
EXTRAFILES test_c_interop_02b.c) # renable c (needs physical cast), cpython (lenght assert error)
RUN(NAME test_c_interop_03 LABELS cpython llvm c
EXTRAFILES test_c_interop_03b.c)
# RUN(NAME test_c_interop_04 LABELS cpython llvm llvm_jit c
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/test_c_interop_02b.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ int8_t f_i8_i8(int8_t x) {
return x+1;
}

int32_t f_str_i32(char *x) {
return strlen(x);
int32_t f_str_i32(string_descriptor x) {
return x.size;
}
7 changes: 6 additions & 1 deletion integration_tests/test_c_interop_02b.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@

#include <stdint.h>

typedef struct {
char* x;
int64_t size;
int64_t capacity;
} string_descriptor;

double f_f64_f64(double x);
float f_f32_f32(float x);
int64_t f_i64_i64(int64_t x);
int32_t f_i32_i32(int32_t x);
int16_t f_i16_i16(int16_t x);
int8_t f_i8_i8 (int8_t x);
int32_t f_str_i32(char *x);
int32_t f_str_i32(string_descriptor x);


#endif // TEST_C_INTEROP_02B
2 changes: 1 addition & 1 deletion libasr
Submodule libasr updated 43 files
+12 −0 integration_tests/CMakeLists.txt
+21 −0 integration_tests/arrays_95.f90
+5 −2 integration_tests/boz_01.f90
+21 −0 integration_tests/class_58.f90
+35 −0 integration_tests/intrinsics_391.f90
+70 −0 integration_tests/openmp_63.f90
+79 −0 integration_tests/openmp_64.f90
+116 −0 integration_tests/openmp_65.f90
+24 −0 integration_tests/openmp_66.f90
+121 −0 integration_tests/openmp_67.f90
+86 −0 integration_tests/openmp_68.f90
+24 −0 integration_tests/openmp_69.f90
+4 −0 integration_tests/operator_overloading_17.f90
+64 −0 integration_tests/operator_overloading_19.f90
+28 −0 integration_tests/submodule_07.f90
+64 −11 src/lfortran/semantics/ast_body_visitor.cpp
+30 −16 src/lfortran/semantics/ast_common_visitor.h
+1 −2 src/lfortran/semantics/ast_symboltable_visitor.cpp
+1 −1 src/libasr/ASR.asdl
+7 −2 src/libasr/asr_utils.cpp
+17 −4 src/libasr/codegen/asr_to_llvm.cpp
+5 −2 src/libasr/codegen/llvm_utils.cpp
+269 −12 src/libasr/pass/openmp.cpp
+5 −1 src/libasr/pass/pass_array_by_data.cpp
+13 −4 src/libasr/pass/pass_utils.h
+40 −1 src/libasr/runtime/lfortran_intrinsics.c
+73 −0 src/runtime/openmp/omp_lib.f90
+2 −2 tests/reference/asr-boz_01-dedad59.json
+85 −1 tests/reference/asr-boz_01-dedad59.stdout
+1 −1 tests/reference/asr_openmp-openmp_37-2c7ae83.json
+1,630 −84 tests/reference/asr_openmp-openmp_37-2c7ae83.stdout
+1 −1 tests/reference/asr_openmp-openmp_38-2731560.json
+1,630 −84 tests/reference/asr_openmp-openmp_38-2731560.stdout
+1 −1 tests/reference/asr_openmp-openmp_39-aaf2ba8.json
+1,630 −84 tests/reference/asr_openmp-openmp_39-aaf2ba8.stdout
+1 −1 tests/reference/asr_openmp-openmp_44-1c0f6fe.json
+1,630 −84 tests/reference/asr_openmp-openmp_44-1c0f6fe.stdout
+1 −1 tests/reference/asr_openmp-openmp_45-1c0e790.json
+1,630 −84 tests/reference/asr_openmp-openmp_45-1c0e790.stdout
+1 −1 tests/reference/asr_openmp-openmp_46-1b93fa8.json
+1,630 −84 tests/reference/asr_openmp-openmp_46-1b93fa8.stdout
+2 −2 tests/reference/llvm-boz_01-def9db5.json
+14 −2 tests/reference/llvm-boz_01-def9db5.stdout
Loading