code style for test programs: CamelCase?

Hi everyone, I have a code style question: should full test programs (.c,.cpp files) use the documented CamelCase from http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly or instead use lower_with_underscores as I’ve been told the .ll lit test files should use? I see both in existing files, and in particular for projects/compiler-rt I cannot blindly follow the existing code as the existing sanitizers were added with a separate style, with the consensus being that new sanitizer files should switch to the LLVM style.

Derek Bruening via llvm-dev <llvm-dev@lists.llvm.org> writes:

Hi everyone, I have a code style question: should full test programs
(.c,.cpp files) use the documented CamelCase from
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
or
instead use lower_with_underscores as I've been told the .ll lit test files
should use? I see both in existing files, and in particular for
projects/compiler-rt I cannot blindly follow the existing code as the
existing sanitizers were added with a separate style, with the consensus
being that new sanitizer files should switch to the LLVM style.

When in doubt follow the LLVM style. Most cases where you see C++ code
that doesn't follow it are from before we codified the style in the
docs.

For C++ code it’s easiest to use clang-format which by default implements the LLVM style.

2016-04-28 20:32 GMT+03:00 Justin Bogner via llvm-dev <llvm-dev@lists.llvm.org>: