brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 13d00a8 Raw
72 lines · plain
1// RUN: %check_clang_tidy %s google-objc-function-naming %t -- -- -isystem %clang_tidy_headers2 3#include <stdio.h>4 5static void TestImplicitFunctionDeclaration(int a) {6  // Call a builtin function so that the compiler generates an implicit7  // function declaration.8  printf("%d", a);9}10 11#define bool _Bool12 13static bool ispositive(int a) { return a > 0; }14// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'ispositive'15// must be in Pascal case as required by Google Objective-C style guide16// CHECK-FIXES: static bool Ispositive(int a) { return a > 0; }17 18static bool is_positive(int a) { return a > 0; }19// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'is_positive'20// must be in Pascal case as required by Google Objective-C style guide21// CHECK-FIXES: static bool IsPositive(int a) { return a > 0; }22 23static bool isPositive(int a) { return a > 0; }24// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'isPositive'25// must be in Pascal case as required by Google Objective-C style guide26// CHECK-FIXES: static bool IsPositive(int a) { return a > 0; }27 28static bool Is_Positive(int a) { return a > 0; }29// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'Is_Positive'30// must be in Pascal case as required by Google Objective-C style guide31// CHECK-FIXES: static bool IsPositive(int a) { return a > 0; }32 33static bool IsPositive(int a) { return a > 0; }34 35bool ispalindrome(const char *str);36// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function in global namespace named37// 'ispalindrome' must have an appropriate prefix followed by Pascal case as38// required by Google Objective-C style guide39 40static const char *md5(const char *str) { return 0; }41// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: static function named 'md5' must be42// in Pascal case as required by Google Objective-C style guide43// CHECK-FIXES: static const char *Md5(const char *str) { return 0; }44 45static const char *MD5(const char *str) { return 0; }46 47static const char *URL(void) { return "https://clang.llvm.org/"; }48 49static const char *DEFURL(void) { return "https://clang.llvm.org/"; }50 51static const char *DEFFooURL(void) { return "https://clang.llvm.org/"; }52 53static const char *StringFromNSString(id str) { return ""; }54 55void ABLog_String(const char *str);56// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function in global namespace named57// 'ABLog_String' must have an appropriate prefix followed by Pascal case as58// required by Google Objective-C style guide59 60void ABLogString(const char *str);61 62bool IsPrime(int a);63// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function in global namespace named64// 'IsPrime' must have an appropriate prefix followed by Pascal case as required65// by Google Objective-C style guide66 67const char *ABURL(void) { return "https://clang.llvm.org/"; }68 69const char *ABFooURL(void) { return "https://clang.llvm.org/"; }70 71int main(int argc, const char **argv) { return 0; }72