[libc-commits] [PATCH] D84575: [libc] Add scaffolding for ctype and implementation of isalpha

Chris Gyurgyik via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat Jul 25 03:55:00 PDT 2020


cgyurgyik added inline comments.


================
Comment at: libc/test/src/ctype/isalpha_test.cpp:26-34
+TEST(IsAlpha, PostFixOperatorOnBoundaryCharacterShouldStillWork) {
+  int character = 'Z';
+  // This should return true, even though it has side effects.
+  // This may fail in the case of conditional logical operators
+  // being used in the 'isalpha' implementation.
+  EXPECT_TRUE(call_isalpha(character++));
+  // Verify the next character is indeed not true.
----------------
abrachet wrote:
> I don't understand the comment, there is no implementation where `character` would pass but not `character++`. You're testing the compiler here, not `isalpha`
This was written after reading the wikipedia page: https://en.wikipedia.org/wiki/C_character_classification#Implementation

I am happy to remove it if you think this is a compiler test instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84575/new/

https://reviews.llvm.org/D84575





More information about the libc-commits mailing list