llvm-project/compiler-rt/test/profile
Aaron Ballman 7d644e1215 [C11/C2x] Change the behavior of the implicit function declaration warning
C89 had a questionable feature where the compiler would implicitly
declare a function that the user called but was never previously
declared. The resulting function would be globally declared as
extern int func(); -- a function without a prototype which accepts zero
or more arguments.

C99 removed support for this questionable feature due to severe
security concerns. However, there was no deprecation period; C89 had
the feature, C99 didn't. So Clang (and GCC) both supported the
functionality as an extension in C99 and later modes.

C2x no longer supports that function signature as it now requires all
functions to have a prototype, and given the known security issues with
the feature, continuing to support it as an extension is not tenable.

This patch changes the diagnostic behavior for the
-Wimplicit-function-declaration warning group depending on the language
mode in effect. We continue to warn by default in C89 mode (due to the
feature being dangerous to use). However, because this feature will not
be supported in C2x mode, we've diagnosed it as being invalid for so
long, the security concerns with the feature, and the trivial
workaround for users (declare the function), we now default the
extension warning to an error in C99-C17 mode. This still gives users
an easy workaround if they are extensively using the extension in those
modes (they can disable the warning or use -Wno-error to downgrade the
error), but the new diagnostic makes it more clear that this feature is
not supported and should be avoided. In C2x mode, we no longer allow an
implicit function to be defined and treat the situation the same as any
other lookup failure.

Differential Revision: https://reviews.llvm.org/D122983
2022-04-20 11:30:12 -04:00
..
ContinuousSyncMode Revert "[compiler-rt][Profile] Disable test on Arm/AArch64 Linux" 2021-09-06 08:45:06 +00:00
Darwin [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
Inputs [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
Linux [Profile] Add -no-opaque-pointers to IR tests (NFC) 2022-04-08 15:42:05 +02:00
Posix [C11/C2x] Change the behavior of the implicit function declaration warning 2022-04-20 11:30:12 -04:00
Windows [InstrProfiling] Delete linkage/visibility toggling for Windows 2021-06-02 16:49:54 -07:00
CMakeLists.txt [CMake][profile] Don't use `TARGET lld` to avoid ordering issues 2021-02-22 23:33:21 -08:00
coverage-inline.cpp
coverage_comments.cpp [test] Fix compiler-rt/test/profile/coverage_emptylines.cpp if the build directory is under /tmp 2020-12-10 16:57:10 -08:00
coverage_emptylines.cpp [test] Fix compiler-rt/test/profile/coverage_emptylines.cpp if the build directory is under /tmp 2020-12-10 16:57:10 -08:00
gcc-flag-compatibility.test
gcov-__gcov_flush-terminate.c [gcov] Add __gcov_dump/__gcov_reset and delete __gcov_flush 2020-07-18 15:07:46 -07:00
gcov-basic.c [llvm-cov gcov] Improve accuracy when some edges are not measured 2020-09-12 22:33:41 -07:00
gcov-complex-line.c [llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count cycles 2020-12-10 15:22:29 -08:00
gcov-dump-and-remove.c [gcov] Add spanning tree optimization 2020-09-13 00:07:31 -07:00
infinite_loop.c
instrprof-basic.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-bufferio.c
instrprof-coverage.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
instrprof-darwin-dead-strip.c [profile] Specify "-V" to otool to get expected test output 2021-08-31 10:49:51 -07:00
instrprof-darwin-exports.c
instrprof-dump.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-error.c
instrprof-gc-sections.c [profile][test] Delete profraw directory so that tests are immune to format version upgrade 2021-06-18 16:44:03 -07:00
instrprof-gcov-exceptions.test [gcov][test] Delete UNSUPPORTED: host-byteorder-big-endian from test/profile tests 2020-06-07 08:42:57 -07:00
instrprof-gcov-multiple-bbs-single-line.test [gcov][test] Delete UNSUPPORTED: host-byteorder-big-endian from test/profile tests 2020-06-07 08:42:57 -07:00
instrprof-gcov-multithread_fork.test
instrprof-gcov-one-line-function.test [gcov][test] Delete UNSUPPORTED: host-byteorder-big-endian from test/profile tests 2020-06-07 08:42:57 -07:00
instrprof-gcov-switch.test [gcov][test] Delete UNSUPPORTED: host-byteorder-big-endian from test/profile tests 2020-06-07 08:42:57 -07:00
instrprof-gcov-two-objects.test [gcov][test] Delete UNSUPPORTED: host-byteorder-big-endian from test/profile tests 2020-06-07 08:42:57 -07:00
instrprof-get-filename.c
instrprof-hostname.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-icall-promo.test
instrprof-lto-pgogen.c [profile][test] Delete profraw directory so that tests are immune to format version upgrade 2021-06-18 16:44:03 -07:00
instrprof-merge-entry-cover.c [InstrProf] Add single byte coverage mode 2022-01-27 17:38:55 -08:00
instrprof-merge-match.test
instrprof-merge.c [Profile] Handle invalid profile data 2021-06-10 16:10:13 -07:00
instrprof-merging.cpp
instrprof-order-file.test
instrprof-override-filename-then-reset-default.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-override-filename-with-env.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-override-filename.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-path.c
instrprof-reset-counters.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-set-dir-mode.c [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
instrprof-set-file-object-merging.c [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
instrprof-set-file-object.c [compiler-rt][profile] Enable profile tests for AIX 2021-10-13 03:00:32 +00:00
instrprof-set-filename-then-reset-default.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-set-filename.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-tmpdir.c [profile] Add %t LLVM_PROFILE_FILE option to substitute $TMPDIR 2020-09-25 09:39:40 -07:00
instrprof-value-prof-2.c [PGO] Don't reference functions unless value profiling is enabled 2021-05-20 11:09:24 -07:00
instrprof-value-prof-evict.test
instrprof-value-prof-reset.c
instrprof-value-prof.c [PGO] Don't reference functions unless value profiling is enabled 2021-05-20 11:09:24 -07:00
instrprof-value-prof.test
instrprof-version-mismatch.c [profile] Enabled test on windows 2020-07-17 00:05:46 -07:00
instrprof-without-libc.c [Profile] Handle invalid profile data 2021-06-10 16:10:13 -07:00
instrprof-write-buffer-internal.c [InstrProf][NFC] Do not assume size of counter type 2022-01-14 11:29:11 -08:00
instrprof-write-file-atexit-explicitly.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-write-file-only.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
instrprof-write-file.c Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
lit.cfg.py [compiler-rt] Use ld64 flag -lto_library instead of DYLD_LIBRARY_PATH 2022-04-19 13:54:57 -04:00
lit.site.cfg.py.in
profile_test.h [builtins][test] Delete unneeded file headers 2020-06-16 17:46:22 -07:00
runtime_infinite.c