-
Notifications
You must be signed in to change notification settings - Fork 171
Implement string comparison #744
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
Implement string comparison #744
Conversation
You are using |
i made code generation error: asr_to_llvm: module failed verification. Error:
Stored value type does not match pointer operand type!
store i8 %3, i1* %s, align 1
i1 is |
|
433f8ee
to
e0a92c3
Compare
This looks better now. Please add the tests covering all corner cases and test them with |
You also need to add this file in https://github.com/lcompilers/lpython/blob/main/integration_tests/CMakeLists.txt with labels, |
Please do a $ git checkout main
$ git pull upstream main
$ git checkout stringsCompare
$ git rebase main # if ever this leads to conflicts - resolve manually |
c9f1bce
to
980ed9e
Compare
i rebased the branch as you said but, it didn't squash the branch into one commit. |
You don't have to squash all the commits into one. Do |
You also need to delete those 6 generated files. |
assert s1 <= s2 | ||
assert s1 >= s2 | ||
s1 = "abcde" | ||
assert s1 >= s2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test for the !=
operator would be nice too!
@@ -614,6 +614,53 @@ LFORTRAN_API void _lfortran_strcat(char** s1, char** s2, char** dest) | |||
*dest = &(dest_char[0]); | |||
} | |||
|
|||
#define MIN(x, y) (((x) < (y)) ? (x) : (y)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define MIN(x, y) (((x) < (y)) ? (x) : (y)) | |
#define MIN(x, y) ((x < y) ? x : y) |
Please make these changes and it should be ready afterward. |
integration_tests/out
Outdated
@@ -0,0 +1,696 @@ | |||
-- The C compiler identification is GNU 11.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file should not be committed.
After everything is ready, let's create a simple commit or commits and rebased on top of the latest master. |
it's ready now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good to me, I think we can merge it.
Would you mind creating a nice set of patches for this? Or do you want me to just squash it using github?
e01c47a
to
42d6939
Compare
I squashed all the commits into one for now. @Abdelrahman-Kh-Fouad -- thanks a lot for working on this! If you still want to know how to squash commits, we can show you in our upcoming meeting. |
Fixes #197
with basic testing
a == "sd"
it give meStored value type does not match pointer operand type!
, how to fix return type to be bool? or Is the problem something else?@namannimmo10