llvm-project/compiler-rt/test/profile
Rainer Orth 76e85ae268 [clang][Sparc] Default to -mcpu=v9 for Sparc V8 on Solaris
As reported in Bug 42535, `clang` doesn't inline atomic ops on 32-bit
Sparc, unlike `gcc` on Solaris.  In a 1-stage build with `gcc`, only two
testcases are affected (currently `XFAIL`ed), while in a 2-stage build more
than 100 tests `FAIL` due to this issue.

The reason for this `gcc`/`clang` difference is that `gcc` on 32-bit
Solaris/SPARC defaults to `-mpcu=v9` where atomic ops are supported, unlike
with `clang`'s default of `-mcpu=v8`.  This patch changes `clang` to use
`-mcpu=v9` on 32-bit Solaris/SPARC, too.

Doing so uncovered two bugs:

`clang -m32 -mcpu=v9` chokes with any Solaris system headers included:

  /usr/include/sys/isa_defs.h:461:2: error: "Both _ILP32 and _LP64 are defined"
  #error "Both _ILP32 and _LP64 are defined"

While `clang` currently defines `__sparcv9` in a 32-bit `-mcpu=v9`
compilation, neither `gcc` nor Studio `cc` do.  In fact, the Studio 12.6
`cc(1)` man page clearly states:

            These predefinitions are valid in all modes:
  [...]
               __sparcv8 (SPARC)
               __sparcv9 (SPARC -m64)

At the same time, the patch defines `__GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248]`
for a 32-bit Sparc compilation with any V9 cpu.  I've also changed
`MaxAtomicInlineWidth` for V9, matching what `gcc` does and the Oracle
Developer Studio 12.6: C User's Guide documents (Ch. 3, Support for Atomic
Types, 3.1 Size and Alignment of Atomic C Types).

The two testcases that had been `XFAIL`ed for Bug 42535 are un-`XFAIL`ed
again.

Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D86621
2020-09-11 09:53:19 +02:00
..
ContinuousSyncMode [test] Deflake test/profile/ContinuousSyncMode/online-merging.c 2020-07-02 13:31:56 -07:00
Inputs [llvm-cov gcov] Compute unmeasured arc counts by Kirchhoff's circuit law 2020-09-08 18:45:11 -07:00
Linux Revert "[BPI] Improve static heuristics for integer comparisons" 2020-08-17 20:44:33 +02:00
Posix [clang][Sparc] Default to -mcpu=v9 for Sparc V8 on Solaris 2020-09-11 09:53:19 +02:00
Windows [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate 2019-11-27 15:55:13 +01:00
CMakeLists.txt Revert "[profile] Add a test dependency on cxx-headers" 2019-09-27 20:24:48 +00:00
coverage-inline.cpp [InstrProf] Use separate comdat group for data and counters 2019-02-27 23:38:44 +00:00
coverage_comments.cpp Reland [Coverage] Add comment to skipped regions 2020-07-28 13:20:57 -07: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 [gcov] Support .gcno/.gcda in gcov 8, 9 or 10 compatible formats 2020-06-07 11:27:49 -07:00
gcov-dump-and-remove.c [gcov] Add __gcov_dump/__gcov_reset and delete __gcov_flush 2020-07-18 15:07:46 -07:00
infinite_loop.c
instrprof-basic.c [profile] Support merge pool size >= 10 2020-01-12 00:27:18 -08:00
instrprof-bufferio.c
instrprof-darwin-dead-strip.c [profile] Test the exported symbol set for empty programs 2018-02-28 19:00:16 +00:00
instrprof-darwin-exports.c [profile] Add explanatory comments to instrprof-darwin-exports.c, NFC 2019-12-10 09:45:04 -08:00
instrprof-dump.c
instrprof-error.c
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 [profile] Don't crash when forking in several threads 2020-05-07 14:13:11 +02:00
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 [profile] Add interface to get profile filename 2018-07-19 19:03:50 +00:00
instrprof-hostname.c
instrprof-icall-promo.test compiler-rt: Rename remaining cc files in test/profile to cpp 2019-08-05 13:42:31 +00:00
instrprof-lto-pgogen.c [profile][test] Add -fuse-ld=bfd to make instrprof-lto-pgogen.c robust 2020-07-22 10:16:08 -07:00
instrprof-merge-match.test [InstrProf] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-merge.c NFC: Unforget a colon in a few CHECK: directives. 2019-07-12 02:16:56 +00:00
instrprof-merging.cpp [Coverage] Collect all function records in an object (D69471 followup) 2020-03-02 12:01:09 -08:00
instrprof-order-file.test Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
instrprof-override-filename-then-reset-default.c
instrprof-override-filename-with-env.c
instrprof-override-filename.c
instrprof-path.c [InstrProf] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-reset-counters.c Add space inside the regular expression. 2018-02-08 02:29:56 +00:00
instrprof-set-dir-mode.c [compiler-rt][test] Make instrprof-set-dir-mode test tolerant of group ID 2019-04-02 03:24:12 +00:00
instrprof-set-file-object-merging.c Reland [Coverage] Add comment to skipped regions 2020-07-28 13:20:57 -07:00
instrprof-set-file-object.c (Reland with changes) Adding a function for setting coverage output file. 2019-06-24 21:32:50 +00:00
instrprof-set-filename-then-reset-default.c
instrprof-set-filename.c [compiler-rt][profile] fix test/instrprof-set-filename.c on windows 2020-01-29 15:00:56 -08:00
instrprof-value-prof-2.c
instrprof-value-prof-evict.test
instrprof-value-prof-reset.c
instrprof-value-prof.c [test] NFC, add missing declarations and include to test files to avoid 'implicit-function-declaration' diagnostics in the tests 2020-05-14 10:01:50 -07:00
instrprof-value-prof.test [profile] Delete stale profiles in test/profile/instrprof-value-prof.test, NFC 2019-12-11 10:03:59 -08:00
instrprof-version-mismatch.c [profile] Enabled test on windows 2020-07-17 00:05:46 -07:00
instrprof-without-libc.c [profile] Remove dependence on getpagesize from InstrProfilingBuffer.c.o 2020-07-30 16:22:40 -07:00
instrprof-write-file-atexit-explicitly.c
instrprof-write-file-only.c
instrprof-write-file.c [profile] Clean up stale raw profiles in instrprof-write-file.c 2019-10-31 16:04:08 -07:00
lit.cfg.py compiler-rt: Rename remaining cc files in test/profile to cpp 2019-08-05 13:42:31 +00:00
lit.site.cfg.py.in [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
profile_test.h [builtins][test] Delete unneeded file headers 2020-06-16 17:46:22 -07:00
runtime_infinite.c