Skip to content

Commit 60870cb

Browse files
committed
TEST: Uncommented c_interop test
1 parent c02cabc commit 60870cb

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ RUN(NAME test_builtin_round LABELS cpython llvm llvm_jit c)
649649
# RUN(NAME test_math_03 LABELS llvm llvm_jit) #1595: TODO: Test using CPython (3.11 recommended)
650650
# RUN(NAME test_pass_compare LABELS cpython llvm llvm_jit) # renable c # post sync
651651
RUN(NAME test_c_interop_01 LABELS cpython llvm llvm_jit c)
652-
# RUN(NAME test_c_interop_02 LABELS cpython llvm c
653-
# EXTRAFILES test_c_interop_02b.c)
652+
RUN(NAME test_c_interop_02 LABELS llvm
653+
EXTRAFILES test_c_interop_02b.c) # renable c (needs physical cast), cpython (lenght assert error)
654654
RUN(NAME test_c_interop_03 LABELS cpython llvm c
655655
EXTRAFILES test_c_interop_03b.c)
656656
# RUN(NAME test_c_interop_04 LABELS cpython llvm llvm_jit c

integration_tests/test_c_interop_02b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ int8_t f_i8_i8(int8_t x) {
2626
return x+1;
2727
}
2828

29-
int32_t f_str_i32(char *x) {
30-
return strlen(x);
29+
int32_t f_str_i32(string_descriptor x) {
30+
return x.size;
3131
}

integration_tests/test_c_interop_02b.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33

44
#include <stdint.h>
55

6+
typedef struct {
7+
char* x;
8+
int64_t size;
9+
int64_t capacity;
10+
} string_descriptor;
611

712
double f_f64_f64(double x);
813
float f_f32_f32(float x);
914
int64_t f_i64_i64(int64_t x);
1015
int32_t f_i32_i32(int32_t x);
1116
int16_t f_i16_i16(int16_t x);
1217
int8_t f_i8_i8 (int8_t x);
13-
int32_t f_str_i32(char *x);
18+
int32_t f_str_i32(string_descriptor x);
1419

1520

1621
#endif // TEST_C_INTEROP_02B

libasr

Submodule libasr updated 43 files

0 commit comments

Comments
 (0)