diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 6ef74d6882..90dd6d0c25 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -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 diff --git a/integration_tests/test_c_interop_02b.c b/integration_tests/test_c_interop_02b.c index 2dfde29304..8961f45666 100644 --- a/integration_tests/test_c_interop_02b.c +++ b/integration_tests/test_c_interop_02b.c @@ -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; } diff --git a/integration_tests/test_c_interop_02b.h b/integration_tests/test_c_interop_02b.h index 331f8a9103..772f929da5 100644 --- a/integration_tests/test_c_interop_02b.h +++ b/integration_tests/test_c_interop_02b.h @@ -3,6 +3,11 @@ #include +typedef struct { + char* x; + int64_t size; + int64_t capacity; +} string_descriptor; double f_f64_f64(double x); float f_f32_f32(float x); @@ -10,7 +15,7 @@ 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 diff --git a/libasr b/libasr index 423e6afdd1..2e421b2537 160000 --- a/libasr +++ b/libasr @@ -1 +1 @@ -Subproject commit 423e6afdd1c95100e381c1842695af62c27c7537 +Subproject commit 2e421b253765877fab5e8cfc82df4a778aaf8284