[compiler-rt] 10b4931 - [test] NFC, add missing declarations and include to test files to avoid 'implicit-function-declaration' diagnostics in the tests
Alex Lorenz via llvm-commits
llvm-commits at lists.llvm.org
Thu May 14 10:02:04 PDT 2020
Author: Alex Lorenz
Date: 2020-05-14T10:01:50-07:00
New Revision: 10b49315faa6338eaf52bb782e7c53644ad17dab
URL: https://github.com/llvm/llvm-project/commit/10b49315faa6338eaf52bb782e7c53644ad17dab
DIFF: https://github.com/llvm/llvm-project/commit/10b49315faa6338eaf52bb782e7c53644ad17dab.diff
LOG: [test] NFC, add missing declarations and include to test files to avoid 'implicit-function-declaration' diagnostics in the tests
Added:
Modified:
clang-tools-extra/test/clang-tidy/checkers/darwin-avoid-spinlock.m
compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
compiler-rt/test/profile/instrprof-value-prof.c
Removed:
################################################################################
diff --git a/clang-tools-extra/test/clang-tidy/checkers/darwin-avoid-spinlock.m b/clang-tools-extra/test/clang-tidy/checkers/darwin-avoid-spinlock.m
index c870e0a0fed0..f395386a02f4 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/darwin-avoid-spinlock.m
+++ b/clang-tools-extra/test/clang-tidy/checkers/darwin-avoid-spinlock.m
@@ -2,6 +2,10 @@
typedef int OSSpinLock;
+void OSSpinlockLock(OSSpinLock *l);
+void OSSpinlockTry(OSSpinLock *l);
+void OSSpinlockUnlock(OSSpinLock *l);
+
@implementation Foo
- (void)f {
int i = 1;
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
index dadd8959991a..56e0538b1e83 100644
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
+++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
@@ -1,3 +1,5 @@
+extern void __gcov_flush();
+extern int remove(const char *);
int main(void) {
__gcov_flush();
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
index 83755451631d..b0921d22461e 100644
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
+++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
@@ -3,19 +3,21 @@
// CHECK-NEXT: -: 0:Data:instrprof-gcov-__gcov_flush-multiple.gcda
// CHECK-NEXT: -: 0:Runs:1
// CHECK-NEXT: -: 0:Programs:1
-// CHECK-NEXT: #####: 1:int main(void) {
-// CHECK-NEXT: #####: 2: __gcov_flush();
-// CHECK-NEXT: -: 3:
-// CHECK-NEXT: #####: 4: if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
-// CHECK-NEXT: #####: 5: return 1;
-// CHECK-NEXT: -: 6: }
-// CHECK-NEXT: -: 7:
-// CHECK-NEXT: #####: 8: __gcov_flush();
-// CHECK-NEXT: #####: 9: __gcov_flush();
-// CHECK-NEXT: -: 10:
-// CHECK-NEXT: #####: 11: if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
-// CHECK-NEXT: #####: 12: return 1;
-// CHECK-NEXT: -: 13: }
-// CHECK-NEXT: -: 14:
-// CHECK-NEXT: 1: 15: return 0;
-// CHECK-NEXT: 1: 16:}
+// CHECK-NEXT: -: 1:extern void __gcov_flush();
+// CHECK-NEXT: -: 2:extern int remove(const char *);
+// CHECK-NEXT: #####: 3:int main(void) {
+// CHECK-NEXT: #####: 4: __gcov_flush();
+// CHECK-NEXT: -: 5:
+// CHECK-NEXT: #####: 6: if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
+// CHECK-NEXT: #####: 7: return 1;
+// CHECK-NEXT: -: 8: }
+// CHECK-NEXT: -: 9:
+// CHECK-NEXT: #####: 10: __gcov_flush();
+// CHECK-NEXT: #####: 11: __gcov_flush();
+// CHECK-NEXT: -: 12:
+// CHECK-NEXT: #####: 13: if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
+// CHECK-NEXT: #####: 14: return 1;
+// CHECK-NEXT: -: 15: }
+// CHECK-NEXT: -: 16:
+// CHECK-NEXT: 1: 17: return 0;
+// CHECK-NEXT: 1: 18:}
diff --git a/compiler-rt/test/profile/instrprof-value-prof.c b/compiler-rt/test/profile/instrprof-value-prof.c
index 3a5bdbdd552e..53e5fdafc520 100644
--- a/compiler-rt/test/profile/instrprof-value-prof.c
+++ b/compiler-rt/test/profile/instrprof-value-prof.c
@@ -27,6 +27,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
typedef struct __llvm_profile_data __llvm_profile_data;
const __llvm_profile_data *__llvm_profile_begin_data(void);
const __llvm_profile_data *__llvm_profile_end_data(void);
More information about the llvm-commits
mailing list