-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09e4934
commit b46fe23
Showing
6 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2024 LLVM-MOS | ||
// | ||
// Licensed under the Apache License, Version 2.0 with LLVM Exceptions, | ||
// See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license | ||
// information. | ||
|
||
#undef NDEBUG | ||
#include <assert.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
// Originally from the Public Domain C Library (PDCLib) | ||
|
||
static const char abcde[] = "abcde"; | ||
static const char abcdx[] = "abcdx"; | ||
|
||
int main(void) { | ||
assert(strcspn(abcde, "x") == 5); | ||
assert(strcspn(abcde, "xyz") == 5); | ||
assert(strcspn(abcde, "zyx") == 5); | ||
assert(strcspn(abcdx, "x") == 4); | ||
assert(strcspn(abcdx, "xyz") == 4); | ||
assert(strcspn(abcdx, "zyx") == 4); | ||
assert(strcspn(abcde, "a") == 0); | ||
assert(strcspn(abcde, "abc") == 0); | ||
assert(strcspn(abcde, "cba") == 0); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2024 LLVM-MOS | ||
// | ||
// Licensed under the Apache License, Version 2.0 with LLVM Exceptions, | ||
// See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license | ||
// information. | ||
|
||
#undef NDEBUG | ||
#include <assert.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
// Originally from the Public Domain C Library (PDCLib) | ||
|
||
static const char abcde[] = "abcde"; | ||
|
||
int main(void) { | ||
assert(strspn(abcde, "abc") == 3); | ||
assert(strspn(abcde, "b") == 0); | ||
assert(strspn(abcde, abcde) == 5); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 LLVM-MOS | ||
// | ||
// Licensed under the Apache License, Version 2.0 with LLVM Exceptions, | ||
// See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license | ||
// information. | ||
|
||
#undef NDEBUG | ||
#include <assert.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
// Originally from the Public Domain C Library (PDCLib) | ||
|
||
int main(void) { | ||
char s[] = "abcabcabcdabcde"; | ||
assert(strstr(s, "x") == NULL); | ||
assert(strstr(s, "xyz") == NULL); | ||
assert(strstr(s, "a") == &s[0]); | ||
assert(strstr(s, "abc") == &s[0]); | ||
assert(strstr(s, "abcd") == &s[6]); | ||
assert(strstr(s, "abcde") == &s[10]); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit 0 |