Import llvm-toolchain-7_7.0.1-8+deb10u2.debian.tar.xz
authorEmilio Pozuelo Monfort <pochu@debian.org>
Fri, 18 Sep 2020 09:47:25 +0000 (10:47 +0100)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Fri, 18 Sep 2020 09:47:25 +0000 (10:47 +0100)
[dgit import tarball llvm-toolchain-7 1:7.0.1-8+deb10u2 llvm-toolchain-7_7.0.1-8+deb10u2.debian.tar.xz]

225 files changed:
NEWS [new file with mode: 0644]
README [new file with mode: 0644]
README.source [new file with mode: 0644]
TODO [new file with mode: 0644]
changelog [new file with mode: 0644]
clang-X.Y-doc.docs.in [new file with mode: 0644]
clang-X.Y-examples.examples.in [new file with mode: 0644]
clang-X.Y.install.in [new file with mode: 0644]
clang-X.Y.links.in [new file with mode: 0644]
clang-X.Y.lintian-overrides.in [new file with mode: 0644]
clang-X.Y.manpages.in [new file with mode: 0644]
clang-format-X.Y.install.in [new file with mode: 0644]
clang-format-X.Y.lintian-overrides.in [new file with mode: 0644]
clang-format-X.Y.manpages.in [new file with mode: 0644]
clang-tidy-X.Y.install.in [new file with mode: 0644]
clang-tidy-X.Y.links.in [new file with mode: 0644]
clang-tidy-X.Y.lintian-overrides.in [new file with mode: 0644]
clang-tidy-X.Y.manpages.in [new file with mode: 0644]
clang-tools-X.Y.install.in [new file with mode: 0644]
clang-tools-X.Y.links.in [new file with mode: 0644]
clang-tools-X.Y.lintian-overrides.in [new file with mode: 0644]
clang-tools-X.Y.manpages.in [new file with mode: 0644]
compat [new file with mode: 0644]
control [new file with mode: 0644]
copyright [new file with mode: 0644]
debian_path.h [new file with mode: 0644]
libc++-X.Y-dev.install.in [new file with mode: 0644]
libc++-X.Y-dev.links.in [new file with mode: 0644]
libc++-X.Y-dev.lintian-overrides.in [new file with mode: 0644]
libc++1-X.Y.install.in [new file with mode: 0644]
libc++1-X.Y.links.in [new file with mode: 0644]
libc++1-X.Y.lintian-overrides.in [new file with mode: 0644]
libc++abi-X.Y-dev.install.in [new file with mode: 0644]
libc++abi-X.Y-dev.links.in [new file with mode: 0644]
libc++abi-X.Y-dev.lintian-overrides.in [new file with mode: 0644]
libc++abi1-X.Y.install.in [new file with mode: 0644]
libc++abi1-X.Y.links.in [new file with mode: 0644]
libc++abi1-X.Y.lintian-overrides.in [new file with mode: 0644]
libclang-X.Y-dev.install.in [new file with mode: 0644]
libclang-X.Y-dev.links.in [new file with mode: 0644]
libclang-common-X.Y-dev.install.in [new file with mode: 0644]
libclang-common-X.Y-dev.links.in [new file with mode: 0644]
libclang1-X.Y.install.in [new file with mode: 0644]
libclang1-X.Y.links.in [new file with mode: 0644]
libclang1-X.Y.lintian-overrides.in [new file with mode: 0644]
libclang1-X.Y.symbols.in [new file with mode: 0644]
liblld-X.Y-dev.install.in [new file with mode: 0644]
liblld-X.Y.install.in [new file with mode: 0644]
liblld-X.Y.links.in [new file with mode: 0644]
liblldb-7.install.kfreebsd [new file with mode: 0644]
liblldb-X.Y-dev.install.in [new file with mode: 0644]
liblldb-X.Y-dev.links.in [new file with mode: 0644]
liblldb-X.Y.install.in [new file with mode: 0644]
liblldb-X.Y.links.in [new file with mode: 0644]
liblldb-X.Y.lintian-overrides.in [new file with mode: 0644]
libllvm-X.Y-ocaml-dev.META.in [new file with mode: 0644]
libllvm-X.Y-ocaml-dev.dirs.in [new file with mode: 0644]
libllvm-X.Y-ocaml-dev.install.in [new file with mode: 0644]
libllvm-X.Y-ocaml-dev.lintian-overrides.in [new file with mode: 0644]
libllvmX.Y.install.in [new file with mode: 0644]
libllvmX.Y.links.in [new file with mode: 0644]
libllvmX.Y.lintian-overrides.in [new file with mode: 0644]
libomp-X.Y-dev.install.in [new file with mode: 0644]
libomp-X.Y-dev.links.in [new file with mode: 0644]
libomp-X.Y-doc.docs.in [new file with mode: 0644]
libomp-X.Y.links.in [new file with mode: 0644]
libomp5-X.Y.install.in [new file with mode: 0644]
libomp5-X.Y.links.in [new file with mode: 0644]
libomp5-X.Y.lintian-overrides.in [new file with mode: 0644]
libomp5-X.Y.symbols.in [new file with mode: 0644]
lld-X.Y.install.in [new file with mode: 0644]
lld-X.Y.manpages.in [new file with mode: 0644]
lldb-X.Y.install.in [new file with mode: 0644]
lldb-X.Y.links.in [new file with mode: 0644]
lldb-X.Y.lintian-overrides.in [new file with mode: 0644]
lldb-X.Y.manpages.in [new file with mode: 0644]
lldb-X.Y.postinst.in [new file with mode: 0644]
llvm-X.Y-dev.dirs.in [new file with mode: 0644]
llvm-X.Y-dev.install.in [new file with mode: 0644]
llvm-X.Y-dev.links.in [new file with mode: 0644]
llvm-X.Y-doc.dirs.in [new file with mode: 0644]
llvm-X.Y-doc.install.in [new file with mode: 0644]
llvm-X.Y-examples.dirs.in [new file with mode: 0644]
llvm-X.Y-examples.examples.in [new file with mode: 0644]
llvm-X.Y-examples.links.in [new file with mode: 0644]
llvm-X.Y-runtime.binfmt.in [new file with mode: 0644]
llvm-X.Y-runtime.install.in [new file with mode: 0644]
llvm-X.Y-runtime.lintian-overrides.in [new file with mode: 0644]
llvm-X.Y-runtime.manpages.in [new file with mode: 0644]
llvm-X.Y-runtime.postinst.in [new file with mode: 0644]
llvm-X.Y-runtime.prerm.in [new file with mode: 0644]
llvm-X.Y-tools.dirs.in [new file with mode: 0644]
llvm-X.Y-tools.install.in [new file with mode: 0644]
llvm-X.Y.dirs.in [new file with mode: 0644]
llvm-X.Y.install.in [new file with mode: 0644]
llvm-X.Y.lintian-overrides.in [new file with mode: 0644]
llvm-X.Y.manpages.in [new file with mode: 0644]
llvm-priv-dev.dirs [new file with mode: 0644]
orig-tar.sh [new file with mode: 0755]
patches/0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch [new file with mode: 0644]
patches/0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch [new file with mode: 0644]
patches/0003-Debian-version-info-and-bugreport.patch [new file with mode: 0644]
patches/0044-soname.diff [new file with mode: 0644]
patches/0048-Set-html_static_path-_static-everywhere.patch [new file with mode: 0644]
patches/0049-Use-Debian-provided-MathJax-everywhere.patch [new file with mode: 0644]
patches/19-clang_debian_version.patch [new file with mode: 0644]
patches/23-strlcpy_strlcat_warning_removed.diff [new file with mode: 0644]
patches/26-set-correct-float-abi.diff [new file with mode: 0644]
patches/27-fix_clang_stdint.diff [new file with mode: 0644]
patches/7.1.0/revert-change-soname-2.diff [new file with mode: 0644]
patches/7.1.0/revert-change-soname.diff [new file with mode: 0644]
patches/AtomicExpand-Fix-a-crash-bug-when-lowering-unordered-loads.patch [new file with mode: 0644]
patches/D51108-rust-powerpc.diff [new file with mode: 0644]
patches/D52340-rustc-debuginfo.diff [new file with mode: 0644]
patches/D71028-mips-atomics-rust-test.diff [new file with mode: 0644]
patches/atomic_library_1.diff [new file with mode: 0644]
patches/bootstrap-fix-include-next.diff [new file with mode: 0644]
patches/clang-analyzer-force-version.diff [new file with mode: 0644]
patches/clang-arm-default-vfp3-on-armv7a.patch [new file with mode: 0644]
patches/clang-baseline-fix-i386.patch [new file with mode: 0644]
patches/clang-format-version.diff [new file with mode: 0644]
patches/clang-tidy-run-bin.diff [new file with mode: 0644]
patches/clangd-atomic-cmake.patch [new file with mode: 0644]
patches/debug-jit-path.diff [new file with mode: 0644]
patches/declare_clear_cache.diff [new file with mode: 0644]
patches/disable-display-PASS-UNSUPPORTED-XFAIL.diff [new file with mode: 0644]
patches/disable-error-xray.diff [new file with mode: 0644]
patches/disable-llvm-symbolizer-test.diff [new file with mode: 0644]
patches/disable-path-test-failing.diff [new file with mode: 0644]
patches/disable-source-interleave.diff [new file with mode: 0644]
patches/disable-sse2-old-x86.diff [new file with mode: 0644]
patches/do-not-fail-on-unexpected-pass.diff [new file with mode: 0644]
patches/fix-clang-path-and-build.diff [new file with mode: 0644]
patches/fix-llvm-config-obj-src-root.patch [new file with mode: 0644]
patches/fix-llvm-config.diff [new file with mode: 0644]
patches/fix-scan-view-path.diff [new file with mode: 0644]
patches/force-gcc-header-obj.diff [new file with mode: 0644]
patches/hurd/D53557-hurd-self-exe-realpath.diff [new file with mode: 0644]
patches/hurd/D54079-hurd-openmp.diff [new file with mode: 0644]
patches/hurd/D54338-hurd-libcxx-threads-build.diff [new file with mode: 0644]
patches/hurd/D54339-hurd-libcxx-threads-detection.diff [new file with mode: 0644]
patches/hurd/D54378-hurd-triple.diff [new file with mode: 0644]
patches/hurd/D54379-hurd-triple-clang.diff [new file with mode: 0644]
patches/hurd/D54677-hurd-path_max.diff [new file with mode: 0644]
patches/hurd/hurd-EIEIO-undef.diff [new file with mode: 0644]
patches/hurd/hurd-cxx-paths.diff [new file with mode: 0644]
patches/hurd/hurd-lib_Support_Unix_Path.inc.diff [new file with mode: 0644]
patches/hurd/hurd-pathmax.diff [new file with mode: 0644]
patches/hurd/hurd-tools_llvm-shlib_CMakeLists.txt.diff [new file with mode: 0644]
patches/hurd/impl-path-hurd.diff [new file with mode: 0644]
patches/install-scan-build-py.diff [new file with mode: 0644]
patches/kfreebsd/CMakeLists.txt.diff [new file with mode: 0644]
patches/kfreebsd/clang_lib_Basic_Targets.diff [new file with mode: 0644]
patches/kfreebsd/compiler-rt_lib.diff [new file with mode: 0644]
patches/kfreebsd/include_llvm_ADT_Triple.h.diff [new file with mode: 0644]
patches/kfreebsd/include_llvm_MC_MCELFObjectWriter.h.diff [new file with mode: 0644]
patches/kfreebsd/kfreebsd-libcxx-threads-detection.diff [new file with mode: 0644]
patches/kfreebsd/kfreebsd-openmp.diff [new file with mode: 0644]
patches/kfreebsd/kfreebsd-threads-build.diff [new file with mode: 0644]
patches/kfreebsd/kfreebsd-triple-clang.diff [new file with mode: 0644]
patches/kfreebsd/kfreebsd-triple.diff [new file with mode: 0644]
patches/kfreebsd/lib_Support.diff [new file with mode: 0644]
patches/kfreebsd/lib_Target_X86.diff [new file with mode: 0644]
patches/kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff [new file with mode: 0644]
patches/kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff [new file with mode: 0644]
patches/kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff [new file with mode: 0644]
patches/libcxx/libcxx-silent-failure-arm64.diff [new file with mode: 0644]
patches/libcxx/libcxx-silent-failure-ppc64el.diff [new file with mode: 0644]
patches/libcxx/libcxx-silent-test-libcxx.diff [new file with mode: 0644]
patches/libcxx/libcxx-test-atomics-set-compare-exchange-to-be-expected-fails-on-arm.patch [new file with mode: 0644]
patches/libcxx/libcxx-test-fix-lockfree-test-for-i386.patch [new file with mode: 0644]
patches/libcxx/libcxxabi-arm-ehabi-fix.patch [new file with mode: 0644]
patches/libcxx/libcxxabi-test-don-t-fail-extended-long-double.patch [new file with mode: 0644]
patches/lldb-libname.diff [new file with mode: 0644]
patches/lldb-soname.diff [new file with mode: 0644]
patches/lldb/lldb-addversion-suffix-to-llvm-server-exec.patch [new file with mode: 0644]
patches/lldb/lldb-disable-swig-error.diff [new file with mode: 0644]
patches/lldb/lldb-link-atomic-cmake.patch [new file with mode: 0644]
patches/lldb/lldb-missing-install.diff [new file with mode: 0644]
patches/mips-force-nomadd4.diff [new file with mode: 0644]
patches/mips-fpxx-enable.diff [new file with mode: 0644]
patches/openmp-soname.diff [new file with mode: 0644]
patches/openmp/bootstrap-with-openmp-version-export-missing.diff [new file with mode: 0644]
patches/openmp/openmp-check-execstack.diff [new file with mode: 0644]
patches/openmp/openmp-mips-affinity.patch [new file with mode: 0644]
patches/powerpcspe/D49754-powerpcspe-clang.diff [new file with mode: 0644]
patches/powerpcspe/D54409-powerpcspe-register-spilling.diff [new file with mode: 0644]
patches/powerpcspe/D54584-powerpcspe-double-parameter.diff [new file with mode: 0644]
patches/powerpcspe/powerpcspe-add-missing-include-path.diff [new file with mode: 0644]
patches/pr39427-misscompile.diff [new file with mode: 0644]
patches/python-clangpath.diff [new file with mode: 0644]
patches/remove-apple-clang-manpage.diff [new file with mode: 0644]
patches/remove-test-freezing.diff [new file with mode: 0644]
patches/reproducible-pch.diff [new file with mode: 0644]
patches/revert-change-soname.diff [new file with mode: 0644]
patches/rustc-aarch64-test-failure.diff [new file with mode: 0644]
patches/scan-build-clang-X.diff [new file with mode: 0644]
patches/scan-build-clang-path.diff [new file with mode: 0644]
patches/scan-view-fix-path.diff [new file with mode: 0644]
patches/series [new file with mode: 0644]
patches/silent-MCJIIT-tests.diff [new file with mode: 0644]
patches/silent-amd-tet.diff [new file with mode: 0644]
patches/silent-gold-test.diff [new file with mode: 0644]
patches/silent-gold-utils.diff [new file with mode: 0644]
patches/silent-llvm-isel-fuzzer.diff [new file with mode: 0644]
patches/silent-more-tests.diff [new file with mode: 0644]
patches/silent-test-failing-codeverage.diff [new file with mode: 0644]
patches/silent-test-macho.diff [new file with mode: 0644]
patches/strip-ignore-deterministic-archives.diff [new file with mode: 0644]
patches/symbolizer-path.diff [new file with mode: 0644]
patches/test-keep-alive.diff [new file with mode: 0644]
patches/unwind-chain-inclusion.diff [new file with mode: 0644]
patches/x32-fix-driver-search-paths.diff [new file with mode: 0644]
pollycc.in [new file with mode: 0755]
prepare-new-release.sh [new file with mode: 0644]
python-clang-X.Y.install.in [new file with mode: 0644]
python-lldb-X.Y.install.in [new file with mode: 0644]
python-lldb-X.Y.links.in [new file with mode: 0644]
qualify-clang.sh [new file with mode: 0755]
rules [new file with mode: 0755]
source.lintian-overrides [new file with mode: 0644]
source/format [new file with mode: 0644]
tests/control [new file with mode: 0644]
unpack.sh [new file with mode: 0644]
watch [new file with mode: 0644]

diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..edd628b
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,25 @@
+llvm-toolchain-7 (1:7.0.1-1) unstable; urgency=medium
+
+  * llvm-toolchain packages are built using clang itself (stage2)
+    - stage1 = build clang with gcc
+    - stage2 = clang building itself
+    This could lead to some unexpected (but rare) ABI issues.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 16 Nov 2018 13:00:39 +0100
+
+llvm-toolchain-7 (1:7-1) unstable; urgency=medium
+
+  * From version 7, llvm-toolchain also provides libc++, libc++abi
+    and OpenMP packages. Non-coinstallable on purpose.
+  * Packages, binaries and libraries have been renamed.
+    Instead of the X.Y naming, we moved to X to match the
+    naming from upstream.
+    As example, clang version 7 is named clang-7 (unlike clang-6.0)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 17 Jan 2018 10:50:39 +0100
+
+llvm-toolchain-snapshot (1:3.6~svn214630-1~exp1) experimental; urgency=medium
+
+  * clang is now co-instalable. Available on version 3.4, 3.5 and 3.6
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 02 Aug 2014 12:57:41 +0200
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..19bd20b
--- /dev/null
+++ b/README
@@ -0,0 +1,100 @@
+Organization of the repository
+==============================
+
+The debian package for each LLVM point release is maintained as a git branch.
+For example, the 7 release lives at in the "7" branch.
+
+The current snapshot release is maintained in the "snapshot" branch.
+
+The easiest way to get all branches is probably to have one
+clone per version:
+
+for f in 4.0 5.0 6.0 7 snapshot; do
+    git clone git@salsa.debian.org:pkg-llvm-team/llvm-toolchain.git -b $f $f
+done
+
+Steps for manually building a snapshot release
+==============================================
+
+1) Retrieve the latest snapshot and create original tarballs.
+
+   Run the orig-tar.sh script,
+
+     $ sh snapshot/debian/orig-tar.sh
+
+   which will retrieve the latest version for each LLVM subproject (llvm,
+   clang, lldb, etc.) from the main development (upstream SVN). and repack it
+   as a set of tarballs.
+
+2) Unpack the original tarballs and apply quilt debian patches.
+
+   From the branches/ directory run the unpack.sh script,
+
+     $ sh unpack.sh
+
+   which will unpack the source tree inside a new directory such as
+   branches/llvm-toolchain-snapshot_3.9~svn268942. Depending on the current
+   snapshot version number and svn release, the directory name will be
+   different.
+
+   Quilt patches will then be applied.
+
+3) Build the binary packages using,
+
+     $ fakeroot debian/rules binary
+
+When debugging, successive builds can be recompiled faster by using tools such
+as ccache (PATH=/usr/lib/ccache:$PATH fakeroot debian/rules binary).
+
+Retrieving a specific branch or release candidate with orig-tar.sh
+==================================================================
+
+When using orig-tar.sh, if you need to retrieve a specific branch, you can pass
+the branch name as the first argument. For example, to get the 7 release
+branch at
+  http://llvm.org/svn/llvm-project/{llvm,...}/branches/release_70
+you should use,
+
+  $ sh 7/debian/orig-tar.sh release_70
+
+To retrieve a specific release candidate, you can pass the branch name as the
+first argument, and the tag rc number as the second argument. For example, to
+get the 7.0.1 release candidate rc3 at
+  http://llvm.org/svn/llvm-project/{llvm,...}/tags/RELEASE_701/rc3
+you should use,
+
+  $ sh 7/debian/orig-tar.sh RELEASE_701 rc3 7.0.1
+
+For a stable release, the syntax is:
+
+ $ sh 7/debian/orig-tar.sh RELEASE_700 final 7.0
+
+
+Additional maintainer scripts
+=============================
+
+The script qualify-clang.sh that is found at the git debian/ directory
+should be used to quickly test a newly built package. It runs a short
+set of sanity-check tests and regression tests.
+
+The script releases/snapshot/debian/prepare-new-release.sh is used when
+preparing a new point release. It automatically replaces version numbers
+in various files of the package.
+
+
+Change in major upstream version
+================================
+TODO update with the git commands
+
+$ svn copy snapshot VERSION
+$ svn commit -m "VERSION branched" VERSION
+$ cd VERSION
+$ sed -i -e '0,/llvm-toolchain-snapshot/s/llvm-toolchain-snapshot/llvm-toolchain-VERSION/' debian/changelog debian/control
+$ svn commit -m "snapshot => VERSION"
+$ cd ../snapshot
+$ emacs debian/prepare-new-release.sh
+# Change the version
+$ bash debian/prepare-new-release.sh
+$ svn commit -m "new snapshot release"
+
+Now, try build build it.
diff --git a/README.source b/README.source
new file mode 100644 (file)
index 0000000..7447aba
--- /dev/null
@@ -0,0 +1,34 @@
+All programs and libraries shipped in this package are trying to stay as close
+as possible from upstream.
+
+However, because of the objectives of Debian, besides paths, some changes are
+made.
+
+= File names =
+
+* To make sure that most of the llvm-toolchain packages are co-installable,
+files are installed in /usr/lib/llvm-X/
+and symlinks are managed by the other package llvm-defaults
+
+
+= CPU extensions =
+
+* For x86, SSE2 extensions are disabled (and the target CPU is i686 instead of
+  pentium4.
+
+* For armel, uses float ABI instead of hard.
+
+* For armv7-a, NEON extensions are disabled.
+
+* For mips, FPXX is enabled.
+
+
+= Libraries =
+
+* sonames are created
+
+* Build-ID are enabled
+
+
+ -- Sylvestre Ledru <sylvestre@debian.org>, Wed, 26 Dec 2018 22:56:30 +0100
+
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..bd5d247
--- /dev/null
+++ b/TODO
@@ -0,0 +1,12 @@
+* add the support of libclang in llvm default (for now, it is
+called libclang1-3.3.so)
+
+* move the header at the right place in libclang-dev
+
+* In 1:7.0.1~+rc2-5, we did:
+  * Fix a baseline violation on armhf (Closes: #914268)
+    clang-arm-default-vfp3-on-armv7a.patch has been updated to disable
+    neon in another place
+It caused 200+ tests to fail on arm:
+https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-7&arch=amd64&ver=1%3A7.0.1%7E%2Brc2-4&stamp=1542503855&raw=0
+https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-7&arch=amd64&ver=1%3A7.0.1%7E%2Brc2-5&stamp=1542863723&raw=0
diff --git a/changelog b/changelog
new file mode 100644 (file)
index 0000000..0f5f61a
--- /dev/null
+++ b/changelog
@@ -0,0 +1,2484 @@
+llvm-toolchain-7 (1:7.0.1-8+deb10u2) buster; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ Aurelien Jarno ]
+  * Include upstream patch D71028 to add support for min/max/umin/umax
+    atomics, fixing rust mips tests (Closes: #946874).
+
+ -- Emilio Pozuelo Monfort <pochu@debian.org>  Fri, 18 Sep 2020 11:47:25 +0200
+
+llvm-toolchain-7 (1:7.0.1-8+deb10u1) buster; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix for unordered cmpxchg instructions when building rustc.
+  * Disable nomadd4 instructions on mips*.
+
+ -- Emilio Pozuelo Monfort <pochu@debian.org>  Tue, 15 Sep 2020 13:36:29 +0200
+
+llvm-toolchain-7 (1:7.0.1-8) unstable; urgency=medium
+
+  * Fix a segfault in autopkgtest by brining
+    pr39427-misscompile.diff back
+    (Closes: #923456)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 28 Feb 2019 13:50:21 +0100
+
+llvm-toolchain-7 (1:7.0.1-7) unstable; urgency=medium
+
+  * Fix an ABI issue introduced with the kfreebsd support
+    (Closes: #922731)
+  * kfreebsd/kfreebsd-triple-clang.diff: update of the patch to fix
+    the kfreebsd FTBFS  (Closes: #921246)
+  * Enable ld gold for kfreebsd-amd64 and kfreebsd-i386
+    Many thanks to Svante Signell for the three updates
+
+  [ Matthias Klose ]
+  * Remove the autopkg test for a genuine LLVM bug.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 27 Feb 2019 10:07:00 +0100
+
+llvm-toolchain-7 (1:7.0.1-6) unstable; urgency=medium
+
+  * Add support for kfreebsd (Closes: #921246)
+    Many thanks to Svante Signell for all patches
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 03 Feb 2019 17:27:51 +0100
+
+llvm-toolchain-7 (1:7.0.1-5) unstable; urgency=medium
+
+  * Add 'Rules-Requires-Root: no' in debian/control
+  * llvm-7-examples: Force the same version of llvm-7-dev to mitigate
+    a debci issue
+    https://ci.debian.net/data/autopkgtest/unstable/amd64/l/llvm-toolchain-7/1635547/log.gz
+  * Add 'Rules-Requires-Root: no' in debian/control
+  * Because more and more tools in clang-tools are in python, add
+    the dependency
+  * Remove 'Multi-Arch: same' in libclang
+    (Closes: #874248)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 04 Jan 2019 16:00:41 +0100
+
+llvm-toolchain-7 (1:7.0.1-4) unstable; urgency=medium
+
+  * Remove dbgsym packages from debci because of bug #917528
+
+  [ Gianfranco Costamagna ]
+  * Ignore a test result on i386, due to upstream bug 26580#c18
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 02 Jan 2019 12:37:45 +0100
+
+llvm-toolchain-7 (1:7.0.1-3) unstable; urgency=medium
+
+  * Also install clang-7-dbgsym libclang1-7-dbgsym in autopkgtest
+    to verify that debug symbols are present
+  * Cherry-pick upstream fix D52340 to address a rustc debuginfo
+    (Closes: #917209)
+  * Change the jit debug path from $HOME/.debug/jit/ to
+    $TMPDIR/.debug/jit/ (Closes: #916393)
+  * Document in README.source some Debian/Ubuntu specific changes
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 26 Dec 2018 22:57:45 +0100
+
+llvm-toolchain-7 (1:7.0.1-2) unstable; urgency=medium
+
+  * Enable -DENABLE_LINKER_BUILD_ID:BOOL=ON as, unlike gcc, isn't enabled
+    by default in clang. Thanks to Adrian Bunk for the patch.
+    Once more, thanks to Rebecca Palmer (Closes: #916975)
+  * Build with -g1 also on 64bit architectures (thanks to Adrian too)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 21 Dec 2018 17:07:44 +0100
+
+llvm-toolchain-7 (1:7.0.1-1) unstable; urgency=medium
+
+  * New release
+  * Remove the dbg workaround. Hopefully, the new version of
+    binutils will fix it (Closes: #913946)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 16 Dec 2018 13:07:54 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc3-2) unstable; urgency=medium
+
+  * Fix llvm-config by stripping unnecessary flags
+    See also https://bugs.llvm.org/show_bug.cgi?id=8220
+    (Closes: #697755, #914838)
+  * Try to workaround the debug issues by adding -fno-addrsig to the *FLAGS
+    One more time, thanks to Rebecca Palmer (Closes: #913946)
+    The goal is to provide correct debug packages.
+    Workaround https://sourceware.org/bugzilla/show_bug.cgi?id=23788
+  * Force the chmod +x on llvm-X/bin/* because it was sometimes removed
+    by the strip process
+  * Force the link to atomic also for i386 as it fails on Debian jessie too
+  * Improved the debian/patches/series presentation by creating categories
+  * Improve the separation between *FLAGS for gcc and clang.
+    This is done for -fno-addrsig as it doesn't exit for gcc
+    This can be done with the BOOTSTRAP_CMAKE_CXX_FLAGS option
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 10 Dec 2018 03:49:59 -0500
+
+llvm-toolchain-7 (1:7.0.1~+rc3-1) unstable; urgency=medium
+
+  * New testing release
+  * disable the llvm-strip as it created too big llvm lib
+
+  [ John Paul Adrian Glaubitz ]
+  * Add patch to add powerpcspe support to clang
+  * Add patch to fix register spilling on powerpcspe
+  * Add patch to optimize double parameter calling setup on powerpcspe
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 08 Dec 2018 07:29:59 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-8) unstable; urgency=medium
+
+  * Use llvm-strip instead of binutils strip.
+    Two reasons:
+      - with clang stage2, the dbg packages were not generated
+      - strip fails on stretch and other ubuntu on some archives
+    For this, I had to silent the --enable-deterministic-archives
+    option (https://bugs.llvm.org/show_bug.cgi?id=39789).
+    Thanks to Rebecca Palmer for the idea
+    (Closes: #913946)
+  * Change the i386 base line to avoid using sse2 extension
+    This is more important now that llvm is built with clang
+    instead of gcc.
+    Thanks to Fanael Linithien for the patch
+    (Closes: #914770, #894840)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 01 Dec 2018 11:18:39 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-7) unstable; urgency=medium
+
+  * Bring back mips-rdhwr.diff as it isn't in rc2
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 25 Nov 2018 17:00:31 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-6) unstable; urgency=medium
+
+  [ Samuel Thibault ]
+  * D53557-hurd-self-exe-realpath.diff: Fix paths returned by
+    llvm-config (See Bug#911817).
+
+  [ Sylvestre Ledru ]
+  * Fix the FTBFS on armhf for real! Thanks to Adrian Bunk
+    Force the activation of FeatureVFP3 & FeatureD16
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 24 Nov 2018 09:12:26 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-5) unstable; urgency=medium
+
+  [ Samuel Thibault ]
+  * D54079-hurd-openmp.diff, D54338-hurd-libcxx-threads-build.diff,
+    D54339-hurd-libcxx-threads-detection.diff, D54378-hurd-triple.diff,
+    D54379-hurd-triple-clang.diff, D54677-hurd-path_max.diff,
+    hurd-cxx-paths.diff: New patches to fix hurd build.
+
+  [ Sylvestre Ledru ]
+  * Remove mips-rdhwr.diff as it has been applied upstream
+  * Fix a baseline violation on armhf (Closes: #914268)
+    clang-arm-default-vfp3-on-armv7a.patch has been updated to disable
+    neon in another place
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 21 Nov 2018 09:45:00 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-4) unstable; urgency=medium
+
+  * Workaround the build issues on armhf
+    Thanks to Adrian Bunk for the idea
+  * Remove useless symlink /usr/include/c++ -> ../lib/llvm-7/include/c++
+    (Closes: #913400)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 16 Nov 2018 22:46:29 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-3) unstable; urgency=medium
+
+  * Disable gold for sparc* (Closes: #913260)
+  * Hide a symbol in openmp for mips64el
+  * Try to integrate a patch to make pch reproducible
+    Thanks to Rebecca Palmer for the patch
+    (Closes: #877359)
+  * Fix the misscompilation issue causing rustc to crash (Closes: #913271)
+    Might cause some ABI issues but no real good solution.
+    See https://bugs.llvm.org/show_bug.cgi?id=39427
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 08 Nov 2018 20:50:39 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-2) unstable; urgency=medium
+
+  * Fix a non-break space in a patch (Closes: #913213)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 08 Nov 2018 09:28:36 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-1) unstable; urgency=medium
+
+  * Upload of 7.0.1 rc2 into unstable
+  * New testing release
+  * Enable the stage2 bootstrap:
+    - stage1 = build clang with gcc
+    - stage2 = clang building itself
+    (Closes: #909234)
+  * Bring back the Disable NEON generation on armhf patch which was gone
+    Should fix the FTBFS on armhf
+    (Closes: #842142)
+  * Update the clang manpage to remove osx specific options
+    and to add -arch (Closes: #743133)
+  * Bring back usr/lib/@DEB_HOST_MULTIARCH@/{libiomp5.so, libomp5.so}
+    symlink for gcc (Closes: #912641)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 07 Nov 2018 15:17:41 +0100
+
+llvm-toolchain-7 (1:7.0.1~+rc2-1~exp1) experimental; urgency=medium
+
+  * New testing release
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 05 Nov 2018 23:38:34 +0100
+
+llvm-toolchain-7 (1:7-9) unstable; urgency=medium
+
+  * Remove the dump of cmake error file (too confusing)
+  * Try to fix the bootstrap FTBFS :
+    - on armel by forcing the link to -latomic
+    - mips-rdhwr.diff: backport D51773 to fix an
+      assembly issue on mips.
+      Thanks to jrtc27 for finding the issue.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 04 Nov 2018 18:07:23 +0100
+
+llvm-toolchain-7 (1:7-8) unstable; urgency=medium
+
+  * Update the watch file to display the right version
+    (even if the download will fail)
+  * clang-7 suggests libomp-7-dev instead of libomp-dev
+  * Make sure that we don't conflict openmp & libc++ with llvm-defaults's
+    (Closes: #912544)
+  * Handle better the non coinstability of openmp & libc++ (like we are doing
+    with python-clang-*)
+  * Backport upstream fix D51749 to address a rust aarch64 issues
+    (Closes: #909705)
+  * Add tests from old bugs to make sure they don't come back
+    (Closes: #889832, #827866)
+  * The sanitizers use the versioned llvm-symbolizer provided by the
+    llvm-X package (Closes: #753572)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 20 Oct 2018 16:00:58 +0200
+
+llvm-toolchain-7 (1:7-7~exp2) experimental; urgency=medium
+
+  * clangd-atomic-cmake.patch: Link against atomic for clangd in i386
+  * When the cmake configure of the stage2 is failing, dump the cmake error log
+  * Declare some variables (-Wno-*) for all platforms (was failing on mips)
+  * Update the watch file to display the right version
+    (even if the download will fail)
+  * clang-7 suggests libomp-7-dev instead of libomp-dev
+  * Make sure that we don't conflict openmp & libc++ with llvm-defaults's
+    (Closes: #912544)
+  * Handle better the non coinstability of openmp & libc++ (like we are doing
+    with python-clang-*)
+  * Backport upstream fix D51749 to address a rust aarch64 issues
+    (Closes: #909705)
+  * Add tests from old bugs to make sure they don't come back
+    (Closes: #889832, #827866)
+  * The sanitizers use the versioned llvm-symbolizer provided by the
+    llvm-X package (Closes: #753572)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 21 Oct 2018 18:34:20 +0200
+
+llvm-toolchain-7 (1:7-7~exp1) experimental; urgency=medium
+
+  * Experiment the clang bootstrap
+  * Try to bootstrap clang using clang
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 17 Oct 2018 20:15:57 +0200
+
+llvm-toolchain-7 (1:7-7) unstable; urgency=medium
+
+  [ Samuel Thibault ]
+  * Apply hurd fixes (Closes: #908847).
+   - hurd-lib_Support_Unix_Path.inc.diff
+   - hurd-pathmax.diff
+   - hurd-tools_llvm-shlib_CMakeLists.txt.diff
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 18 Oct 2018 16:50:58 +0200
+
+llvm-toolchain-7 (1:7-6) unstable; urgency=medium
+
+  * Team upload
+  * Upload to unstable
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Wed, 17 Oct 2018 11:00:09 +0200
+
+llvm-toolchain-7 (1:7-6~exp2) experimental; urgency=medium
+
+  * Disable for now the bootstrapping clang patches
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Tue, 16 Oct 2018 15:00:46 +0200
+
+llvm-toolchain-7 (1:7-6~exp1) experimental; urgency=medium
+
+  * Try to bootstrap (currently in a different branch)
+  * Split the builds in different make target
+  * Add python-pygments as dep of llvm-7-tools because
+    opt-viewer.py needs it
+  * Add back libomp5-X.Y.symbols.in (untested)
+  * Fix the install of clang bash completion
+  * Start the work on bootstraping clang
+    - bootstrap-with-openmp-version-export-missing.diff: fix a link issue
+      https://bugs.llvm.org/show_bug.cgi?id=39200
+    - bootstrap-fix-include-next.diff: Fix an include issue at bootstrap phase
+      https://bugs.llvm.org/show_bug.cgi?id=39162
+
+  [ Gianfranco Costamagna ]
+  * Take option two in bug #877567 to fix FTBFS on mips and mipsel
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 06 Oct 2018 23:04:24 +0200
+
+llvm-toolchain-7 (1:7-5) unstable; urgency=medium
+
+  * In debci, run qualify-clang.sh in verbose mode
+  * Only run the g++ test if g++ exist
+
+  [ Reshabh Sharma ]
+  * Run check-openmp to test OpenMP
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 06 Oct 2018 08:25:48 +0200
+
+llvm-toolchain-7 (1:7-4) unstable; urgency=medium
+
+  * Backport a fix to improve scan-build code error.
+    Thanks to Roman Lebedev for the fix(Closes: #909662)
+  * Remove bat files https://bugs.llvm.org/show_bug.cgi?id=30755
+  * Install bash-completion for clang
+  * Disable ocaml on armel
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 26 Sep 2018 14:32:41 +0100
+
+llvm-toolchain-7 (1:7-3) unstable; urgency=medium
+
+  * Fix a syntax issue in a scan-build patch
+  * Fix the autopkgtest script (no gcc in the test)
+  * remove dep from lld to llvm-7-dev because lld
+    doesn't use LLVM LTO
+  * remove old Replaces/Breaks
+  * Standards-Version: 4.2.1
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 21 Sep 2018 22:48:47 +0200
+
+llvm-toolchain-7 (1:7-2) unstable; urgency=medium
+
+  * Fix the ftbfs under armel on libc++ and enable openmp on armel.
+    Thanks to Adrian Bunk for the patch
+  * Make libc++, libc++abi & openmp NOT co-installable
+    Rational: the benefits are limited compared to the drawback.
+    We should have issues like:
+       - built with libc++-8-dev
+       - run with libc++1-7
+    (Closes: #903802)
+  * Remove circular dependency by removing python-lldb-7: Depends: liblldb-7-dev
+    (Closes: #888889)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 19 Sep 2018 14:12:34 +0200
+
+llvm-toolchain-7 (1:7-1) unstable; urgency=medium
+
+  * Stable release
+  * Also manages clang-X as tool for scan-build
+    see https://reviews.llvm.org/D52151
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 17 Sep 2018 13:51:03 +0200
+
+llvm-toolchain-7 (1:7~+rc3-5) unstable; urgency=medium
+
+  [ John Paul Adrian Glaubitz ]
+  * Add patch to fix missing include and library paths on x32
+
+  [ Sylvestre Ledru ]
+  * Only rename libomp when openmp is built
+
+ -- John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>  Fri, 14 Sep 2018 19:54:38 +0200
+
+llvm-toolchain-7 (1:7~+rc3-4) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * libc++-7-dev doesn't provide libstdc++-dev anymore (Closes: #908738)
+
+  [ Gianfranco Costamagna ]
+  * Force polly cmake removal on arch:all because of --fail-missing
+
+  [ Reshabh Sharma ]
+  * Make OpenMP packages coinstallable from version 7
+  * Make libc++ packages coinstallable from version 7
+
+  [ John Paul Adrian Glaubitz ]
+  * Add patch to fix missing MultiArch include dir
+    on powerpcspe (Closes: #908791)
+  * Disable LLDB on riscv64
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 14 Sep 2018 11:27:28 +0200
+
+llvm-toolchain-7 (1:7~+rc3-3) unstable; urgency=medium
+
+  [ John Paul Adrian Glaubitz ]
+  * Disable OpenMP on unsupported architecture x32
+
+  [ Sylvestre Ledru ]
+  * Build llvm using -DLLVM_USE_PERF=yes (Closes: #908707)
+
+  [ Gianfranco Costamagna ]
+  * Install polly only on arch:all packages
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Thu, 13 Sep 2018 09:31:29 +0200
+
+llvm-toolchain-7 (1:7~+rc3-2) unstable; urgency=medium
+
+  [ John Paul Adrian Glaubitz ]
+  * Fix inverted logic in ifeq statement for POLLY_ENABLE
+    and OPENMP_ENABLE (Closes: #908646)
+
+  [ Gianfranco Costamagna ]
+  * Drop gnustep and gnustep-devel suggestions (Closes: #902847)
+  * Enable polly on s390x
+  * Disable omp on armel mips and mipsel for now
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Wed, 12 Sep 2018 10:58:12 +0200
+
+llvm-toolchain-7 (1:7~+rc3-1) unstable; urgency=medium
+
+  [ John Paul Adrian Glaubitz ]
+  * Disable OpenMP on unsupported architectures powerpc,
+    powerpcspe, riscv64 and sparc64 (Closes: #907912)
+
+  [ Sylvestre Ledru ]
+  * New snapshot release
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 10 Sep 2018 17:01:25 +0200
+
+llvm-toolchain-7 (1:7~+rc2-1~exp3) experimental; urgency=medium
+
+  * Remove libtool flex, bison, dejagnu, tcl, expect,
+    and perl from the build deps (testing)
+  * Disable force-gcc-header-obj.diff as it is introducing
+    some regressions in the search headers
+    (Closes: #903709)
+
+  [ Gianfranco Costamagna ]
+  * Fix build on armhf, by removing some installed package
+  * Fix build on s390x, by disabling OpenMP
+  * Add liblldb-7-dev to python-lldb runtime dependencies, needed to import it
+  * Enable lld on arm64, mips64el
+  * Enable lldb on mips64el
+
+  [ Reshabh Sharma ]
+  * Add version for libc++ and OpenMP packages breaks/replaces
+  * Remove libc++-helpers package
+    - No real value
+    - Just two scripts
+    - Command line arguments aren't that complex
+  * Fix autopkgtest support
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 03 Sep 2018 09:16:22 +0200
+
+llvm-toolchain-7 (1:7~+rc2-1~exp2) experimental; urgency=medium
+
+  * Force sphinx to be >> 1.2.3
+  * Also ignore libc++experimental.a on dh_strip (fails on stretch)
+  * Make libc++-7-dev & libc++abi-7-dev coinstallable
+
+  [ John Paul Adrian Glaubitz ]
+  * Don't build with ld.gold on powerpcspe
+  * Disable polly on powerpcspe
+  * Add upstream patch to make rustc build on powerpc
+
+  [ Gianfranco Costamagna ]
+  * Enable lld on ppc64el
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 27 Aug 2018 10:57:41 +0200
+
+llvm-toolchain-7 (1:7~+rc2-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * dh_strip should be verbose
+  * On Stretch (binutils 2.28), do not run strip on libFuzzer.a, libc++.a
+    & libc++abi.a because it segfaults
+  * Fixed "weak-library-dev-dependency libc++-7-dev on libc++-7-helpers"
+  * Fixed "libomp5-7: shlibs-declares-dependency-on-other-package
+           libomp5-7) (>= 1:7~svn298832-1~)"
+  * Also use the local cmake binary if available (for trusty)
+    and take in account the PRE_PROCESS_CONF option
+
+  [ Reshabh Sharma ]
+  * Fixed "Lintian warnings for libc++abi-7-dev package"
+    - Warning: libc++abi-7-dev: breaks-without-version libc++-dev
+    - Warning: libc++abi-7-dev: breaks-without-version libc++abi-dev
+    - Warning: llvm-toolchain-7 source: binaries-have-file-conflict
+      libc++abi-7-dev libc++abi1-7 usr/lib/llvm-7/lib/libc++abi.so
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 16 Aug 2018 17:49:31 +0200
+
+llvm-toolchain-7 (1:7~+rc1-1~exp2) experimental; urgency=medium
+
+  * Disable force-gcc-header-obj.diff as it is introducing
+    some regressions in the search headers
+    (Closes: #903709)
+  * libc++-7-dev should depend on libc++-7-helpers (and not
+    libc++-helpers)
+  * Fix the links in the helper package
+
+  [ Reshabh Sharma ]
+  * Fix the path to libc++ header
+  * libc++.so was in two packages
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 15 Aug 2018 15:27:57 +0200
+
+llvm-toolchain-7 (1:7~+rc1-1~exp1) experimental; urgency=medium
+
+  * First testing release of 7
+    - Rename packages
+    - Update the VCS-* URL
+  * Standards-Version to 4.2.0
+
+  [ Dimitri John Ledkov ]
+  * Enable lldb on ppc64el LP: #1777136
+
+  [ Reshabh Sharma ]
+  * Integrate libcxx and libcxxabi as part of the llvm-toolchain packages
+    Very similar to the previous packages
+    except that libc++abi-7-test & libc++-7-test are no longer shipped
+    Outcome of the LLVM GSoC 2018
+    (Closes: #813673)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 07 Aug 2018 19:25:09 +0200
+
+llvm-toolchain-snapshot (1:7~svn336894-1~exp1) experimental; urgency=medium
+
+  [ Reshabh Sharma ]
+  * Integrate opemp as part of the llvm-toolchain packages (Closes: #813672)
+    As part of this work, the transition libiomp packages have been removed.
+
+  [ Sylvestre Ledru ]
+  Bravo to Reshabh Sharma for his work
+  * Also ship diagtool in clang-tools-X
+  * Also ship hmaptool in clang-tools-X
+  * Enable WebAssembly & AVR as experimental archs (Closes: #899202)
+  * d/p/force-gcc-header-obj.diff Fix the detection of the objc path
+  * clang_getCompletionFixIt, clang_getCompletionNumFixIts & getTokenclang
+    added as new symbols of libclang1
+  * Fix the version with snapshot packages
+    Fixes upstream issue https://bugs.llvm.org/show_bug.cgi?id=37729
+
+  [ Gianfranco Costamagna ]
+  * Bump std-version to 4.1.5, no changes required
+
+  [ Reshabh Sharma ]
+  * Updated debian/control with breaks, provides and conflicts for OpenMP
+    packages (Closes: #903802)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 09 May 2018 14:23:49 +0200
+
+llvm-toolchain-snapshot (1:7~svn330801-1~exp2) experimental; urgency=medium
+
+  * d/p/force-gcc-header-obj.diff Fix the detection of the objc path
+  * Add python-yaml as dep for clang-tidy (Closes: #890514)
+  * d/p/impl-path-hurd.diff: Try to fix an issue with hurd
+
+  [ Peter Wu ]
+  * Make CMake find_package(Clang) work. Fixes upstream bug
+    https://bugs.llvm.org/show_bug.cgi?id=37128
+    - Move Clang*.cmake back to /usr/lib/llvm-X.Y/lib/cmake/clang and install a
+      symlink in /usr/lib/cmake/clang-X.Y.
+    - Ensure that the LLVM installation prefix is correctly discovered despire
+      symlinks (replaces fix-cmake-config-prefix.diff).
+    - Create /usr/lib/llvm-X.Y/bin/clang-X.Y symlink as required by
+      ClangTargets-relwithdebinfo.cmake.
+    - Remove useless LLVM_CMAKE_DIR sed command that did not match anything.
+    - Ignore missing binaries in ClangTargets-relwithdebinfo.cmake.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 07 May 2018 23:27:26 +0200
+
+llvm-toolchain-6.0 (1:6.0.1~+rc1-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Fix a typo in the debci
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 26 Apr 2018 08:02:09 +0200
+
+llvm-toolchain-6.0 (1:6.0-3) unstable; urgency=medium
+
+  * Remove sysconf_interceptor_bypass_test.cc because it makes
+    Debian unstable and Ubuntu bionic freeze
+  * Remove the info text from the manpages (Closes: #894734)
+  * Remove a bunch of old unused patches
+  * Fix debian-watch-uses-insecure-uri as upstream has now https
+  * Standards-Version updated to 4.1.3
+  * llvm-dsymutil has been renamed to dsymutil
+  * Remove sysconf_interceptor_bypass_test.cc because it makes
+    Debian unstable and Ubuntu bionic freeze
+  * library-binary-filename.diff removed (applied upstream)
+  * Add clang_File_tryGetRealPathName as new symbol in libclang
+
+  [ Reshabh Sharma ]
+  * Enable autopkgtest for amd64 & i386 on the llvm test suite
+    (Closes: #774294)
+
+  [ Nicholas D Steeves ]
+  * Fix the lintian error 'privacy-breach-uses-embedded-file'
+    (Closes: #829361)
+
+  [ Athos Ribeiro ]
+  * Create symlink to run-clang-tidy-X.Y.py to remove its .py extension
+    (Closes: #892089)
+
+  [ David Tenty ]
+  * Migrate to automatic debug packages (Closes: #893267)
+
+  [ Sylvestre Ledru ]
+  * New snapshot release
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 25 Apr 2018 10:59:20 +0200
+
+llvm-toolchain-snapshot (1:7~svn327768-1) unstable; urgency=medium
+
+  * New snapshot release
+  * create the directory for the mips stuff
+  * Fail the build when new symbols are added
+  * 5 new symbols:
+    - clang_PrintingPolicy_dispose
+    - clang_PrintingPolicy_getProperty
+    - clang_PrintingPolicy_setProperty
+    - clang_getCursorPrettyPrinted
+    - clang_getCursorPrintingPolicy
+  * Use upstream ld.lld manpage instead of help2man
+  * Move the VCS to git.
+    Many thanks to James Clarke for doing the conversion
+  * Create the directory before having the manpages generated
+  * clang-tidy-7 also depends on clang-tools-7 for, at least
+    clang-apply-replacements
+  * Automatically update the debian/README
+  * clang-tidy-7: depends on libclang-common-7-dev
+    (Closes: #891999)
+
+  [ James Clarke ]
+  * Disable LLDB on powerpcspe
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 17 Mar 2018 14:56:19 +0100
+
+llvm-toolchain-snapshot (1:7~svn323616-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Fix llvm-config with the change of versioning (Closes: #888592)
+  * Update the creation of the README to unbreak the mips* FTBFS
+  * Update of the clang-tools-X.Y description
+  * ignore source: source-is-missing lldb/unittests/
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 28 Jan 2018 13:43:37 +0100
+
+llvm-toolchain-snapshot (1:7~svn322880-1) unstable; urgency=medium
+
+  * Change the versioning from X.Y to X as upstream is using
+    X.Y.Z and X
+    I am keeping the epoch because it would be too complex to manage
+    with the various updates scenario
+  * Two new symbols in libclang
+    - clang_getFileContents
+    - clang_isInvalidDeclaration
+  * Fix the VCS-* tags
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 18 Jan 2018 20:50:03 +0100
+
+llvm-toolchain-6.0 (1:6.0.1-11) unstable; urgency=medium
+
+  * Remove 'Multi-Arch: same' in libclang
+    (Closes: #874248)
+  * Cherry-pick various llvm fixes for Julia
+    (Closes: #919628)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 09 Feb 2019 17:22:59 +0100
+
+llvm-toolchain-6.0 (1:6.0.1-10) unstable; urgency=medium
+
+  * Fix a baseline violation on armhf (Closes: #914268)
+    Thanks to Adrian Bunk
+    doing that for the Julia package.
+
+  [ John Paul Adrian Glaubitz ]
+  * Add patch to fix missing include and library paths on x32
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 23 Jan 2019 23:25:50 +0100
+
+llvm-toolchain-6.0 (1:6.0.1-9.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/patches/D53557-hurd-self-exe-realpath.diff: Fix paths returned by
+    llvm-config (Closes: Bug#911817).
+
+ -- Samuel Thibault <sthibault@debian.org>  Wed, 24 Oct 2018 22:44:54 +0000
+
+llvm-toolchain-6.0 (1:6.0.1-9.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Apply hurd fixes (Closes: #908847).
+    - hurd-lib_Support_Unix_Path.inc.diff
+    - hurd-pathmax.diff
+    - hurd-tools_llvm-shlib_CMakeLists.txt.diff
+
+ -- Samuel Thibault <sthibault@debian.org>  Tue, 16 Oct 2018 20:18:39 +0000
+
+llvm-toolchain-6.0 (1:6.0.1-8) unstable; urgency=medium
+
+  [ John Paul Adrian Glaubitz ]
+  * Fix inverted logic in ifeq statement for POLLY_ENABLE (Closes: #908646)
+
+  [ Gianfranco Costamagna ]
+  * Fixup the polly installation failure where polly is not built
+  * Add s390x to polly architectures
+  * Fix typo in rules file
+
+  [ Sylvestre Ledru ]
+  * Disable sse2 on pentium4 arch (Closes: #632472)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 13 Sep 2018 10:04:42 +0200
+
+llvm-toolchain-snapshot (1:6.0~svn321385-1) unstable; urgency=medium
+
+  * Snapshot upload before rc1 (January)
+  * Create clang-tools-6.0 and move the various clang tools into it
+    clang-tools-6.0 depends on clang-6.0. This might affect some packages.
+    (Closes: #836397)
+  * Bring back the libedit support in lldb
+    Fix upstream bug https://bugs.llvm.org/show_bug.cgi?id=35291
+  * Also ship ld64.lld and wasm-ld in the lld-X.Y package
+  * Update d/rules to reflect the move of libfuzzer into compiler-rt
+  * Update of the copyright file (Closes: #878502)
+    Thanks to Nicholas D Steeves for the work
+  * Try to fix the mipsel FTBFS (Closes: #877567)
+    I am trying the first option from the bug:
+    - gsplit-dward on 32 bits archs
+    - -g everywhere
+    Many thanks to Adrian Bunk for that
+  * Use ?= for some variables declarations
+  * Remove the hardcoded declarations of llvm version in debian/rules
+  * add /usr/lib/cuda to the CUDA toolkit search paths
+    Thanks to Andreas Beckmann for the patch (Closes: #882505) (LP: #1706326)
+  * Fix the fix-scan-view-path.diff path
+  * Move libomp-dev from Suggests to Recommends (Closes: #882781)
+  * Add a symlink to fix lldb-X.Y (Closes: #881993)
+  * Remove update-cuda-search-path.patch (applied upstream)
+  * Also install usr/bin/lldb-test-6.0
+  * liblld-6.0-dev depends on liblld-6.0 (Closes: #856545)
+  * Add new symbols for libclang1:
+    - clang_CXIndex_setInvocationEmissionPathOption
+    - clang_CXXRecord_isAbstract
+    - clang_Cursor_getObjCManglings
+    - clang_getCursorTLSKind
+  * add test-keep-alive.diff to improve the keep alive for some
+    archs like mips*
+  * Standards-Version: 4.1.1
+  * remove liblld-6.0-dbg for now
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 22 Dec 2017 21:41:17 +0100
+
+llvm-toolchain-snapshot (1:6.0~svn315736-1) unstable; urgency=medium
+
+  * New snapshot
+  * Ship liblldMinGW lld lib
+  * Ship clang-refactor & clang-func-mapping in clang-X.Y
+  * Remove the -Wl option to call gold instead of the normal linker
+    (Closes: #876787)
+  * Force the deactivation of ocaml until the transition is done
+  * Standards Version 4.1.0
+
+  [ Gianfranco Costamagna ]
+  * Enable ocaml on release architectures.
+  * Add NDEBUG flag, lost in the -g -> -g1 switch
+
+  [ Matthias Klose ]
+  * Link with --no-keep-files-mapped --no-map-whole-files when using gold.
+  * build using gold on arm64 and s390x. For backports, arm64 might still
+    need the BFD linker, and building with only one or two processes in
+    parallel.
+  * On amd64, s390x, arm64 and ppc64el, build with -g1 instead of -g.
+  * Set CMAKE_CXX_FLAGS_RELWITHDEBINFO and pass opt_flags.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 11 Sep 2017 22:27:20 +0200
+
+llvm-toolchain-snapshot (1:6.0~svn311834-2) unstable; urgency=medium
+
+  * Fix the FTBFS because of -gsplit-dwarf:
+    - Only enable it on archs which needs it
+    - Only enable it when gcc supports it correctly
+  * Fail the build if the arch + gcc has a broken gsplit-dwarf support
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 31 Aug 2017 19:14:53 +0200
+
+llvm-toolchain-snapshot (1:6.0~svn311834-1) unstable; urgency=medium
+
+  * Link LLDB with -latomic on powerpcspe (Closes: #872267)
+  * Fix the C++ include path order (Closes: #859083)
+  * Disable -gsplit-dwarf when using gcc 7 for causing a linking issue
+    See https://bugs.llvm.org/show_bug.cgi?id=34140
+    (Closes: #853525)
+  * clang was producing unusable binaries on armv5tel (Closes: #873307)
+    Thanks to Adrian Bunk for the patch
+  * With Ubuntu Trusty (for apt.llvm.org), the build fails
+    on internal compiler error: in output_index_string, at dwarf2out.c:218
+    force the usage of gcc 4.9
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 26 Aug 2017 22:35:00 +0200
+
+llvm-toolchain-snapshot (1:6.0~svn310776-1) unstable; urgency=medium
+
+  * We moved from 5.0 to 6.0
+  * Ship the opt-viewer new program as part of llvm-6.0 tools
+  * ld.lld manpage wasn't installed
+  * Disable the clang-fix-cmpxchg8-detection-on-i386.patch patch
+    because breaks the build with
+    'error: 'isCmpXChg8Supported' was not declared in this scope'
+  * Remove usr/bin/liblldb-intel-mpxtable.so-6.0 as it seems to be removed
+    from usptream
+  * Force the usage of gcc 6 until the link issues with gcc 7 are fixed
+    https://bugs.llvm.org/show_bug.cgi?id=34140
+
+  [ Katsuhiko Nishimra ]
+  * Ensure /usr/bin/g++-$(GCC_VERSION) exists (Closes: #871591)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 27 Jul 2017 23:16:06 +0200
+
+llvm-toolchain-snapshot (1:5.0~svn305653-1) unstable; urgency=medium
+
+  [ Gianfranco Costamagna ]
+  * Re-add clang-doc documentation
+
+  [ Sylvestre Ledru ]
+  * New snapshot release
+  * Fix a hurd PATH_MAX issue
+  * Transform the lldb swig check from a error to a warning
+  * Add libomp-dev to the suggests of clang
+  * Add Provides on python-lldb-x.y & python-clang-x.y & libllvm-x.y-ocaml-dev
+    to avoid the recurring problem about conflicts
+    (Closes: #835546, #863739, #863742)
+  * Standards-Version => 4.0.0
+  * Generate the llvm-tblgen, clang-change-namespace, clang-offload-bundler
+    lld, clang++, clang-check, clang-cpp & clang-import-test manpages
+  * Remove the --no-discard-stderr option from help2man calls
+  * use -DPOLLY_BUNDLED_JSONCPP=OFF & add pkg-config as a dep (to help find
+    the files)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 09 Jun 2017 12:04:56 +0200
+
+llvm-toolchain-snapshot (1:5.0~svn302368-1~exp1) experimental; urgency=medium
+
+  * Only enable libfuzzer for Linux kernel.
+    Thanks to Pino Toscano for the patch
+  * Add option -DPOLLY_BUNDLED_JSONCPP=ON
+    to use the system lib instead of the patch d/p/use-deb-json.diff
+  * New symbols added in libclang
+     - clang_EvalResult_getAsLongLong
+     - clang_EvalResult_getAsUnsigned
+     - clang_EvalResult_isUnsignedInt
+     - clang_TargetInfo_dispose
+     - clang_TargetInfo_getPointerWidth
+     - clang_TargetInfo_getTriple
+     - clang_Type_isTransparentTagTypedef
+     - clang_getAllSkippedRanges
+     - clang_getTranslationUnitTargetInfo
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 07 May 2017 12:13:43 +0200
+
+llvm-toolchain-snapshot (1:5.0~svn298899-1) unstable; urgency=medium
+
+  * Limit the archs where the ocaml binding is built
+    Should fix the FTBFS
+    Currently amd64 arm64 armel armhf i386
+  * d/p/add_symbols_versioning.patch removed (applied upstream)
+  * Really fix "use versioned symbols" for llvm
+    Thanks to Julien Cristau for the patch (Closes: #849098)
+  * Explicit the dep of clang-tidy on same version of llvm to avoid
+    undefined symbols
+  * Add override_dh_makeshlibs for the libllvm or liblldb versions
+    Thanks to Julien Cristau for the patch
+  * change the min version of the libclang1 symbols to 1:4.0-3~
+  * Fix the symlink on scan-build-py
+  * add libncurses in the list of build deps (Closes: #861170)
+
+  [ Rebecca N. Palmer ]
+  * Use versioned symbols (Closes: #848368)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 09 Apr 2017 10:11:56 +0200
+
+llvm-toolchain-snapshot (1:5.0~svn294583-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * New library liblldb-intel-mpxtable.so
+  * Fix the incorrect symlink to scan-build-py (Closes: #856869)
+  * Explicit the dep of clang-format on same version of llvm to avoid
+    undefined symbols
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 16 Jan 2017 09:03:48 +0100
+
+llvm-toolchain-snapshot (1:5.0~svn292017-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+    snapshot is now 5.0
+  * d/p/silent-amdgpu-test-failing.diff silent amdgpu tests failing
+    (see upstream bug 31610)
+  * d/p/lldb-server-link-issue.patch removed, merged upstream
+  * Also install python-lldb-5.0 when installing lldb-5.0 (Closes: #851171)
+  * Bring back the content of llvm-5.0-doc (Closes: #844616)
+  * Bring back the content of llvm-4.0-doc (Closes: #844616)
+  * d/p/pthread-link.diff Hardcode like to pthread which was missing for
+    libclang
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 14 Jan 2017 16:36:51 +0100
+
+llvm-toolchain-snapshot (1:4.0~svn291344-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Disable libedit usage in lldb because of garbage (Closes: #846616, #850111)
+  * Build lld
+    - d/p/lld-arg-cmake-issue.diff fixes upstream bug #27685
+  * ship clang-tblgen
+  * Run clang extra test suite
+  * Fix the detection of lldb-server
+  * Fix the run of the check-lldb target
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 07 Jan 2017 12:24:32 +0100
+
+llvm-toolchain-snapshot (1:4.0~svn290810-1) unstable; urgency=medium
+
+  * New snapshot release
+  * d/p/kfreebsd-support.diff removed (applied upstream)
+  * debian/orig-tar.sh: less verbose
+  * d/p/lldb-missing-install.diff: For the install
+    of lldb-server and lldb-argdumper as they are not always installed
+  * Ship new binary in clang-X.Y: clang-import-test
+  * New symbols in libclang1:
+    - clang_EvalResult_getAsLongLong
+    - clang_EvalResult_getAsLongLong
+    - clang_EvalResult_isUnsignedInt
+  * Fix a regression in the test run for the code coverage
+  * Silent ThinLTO/X86/autoupgrade.ll, fails with code coverage (and maybe others)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 02 Jan 2017 13:51:06 +0100
+
+llvm-toolchain-snapshot (1:4.0~svn286225-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Remove the info section from the generated manpages (Closes: #846269)
+
+  [ Kai Wasserbäch ]
+  * debian/patches/{0003-Debian-version-info-and-bugreport.patch,
+    0044-soname.diff,23-strlcpy_strlcat_warning_removed.diff,
+    26-set-correct-float-abi.diff,atomic_library_[12].diff,
+    fix-clang-path-and-build.diff,fix-lldb-server-build,lldb-libname.diff,
+    lldb-soname.diff,mips-fpxx-enable.diff,removeduplicatedeclaration.diff}:
+    Refreshed.
+  * debian/patches/{silent-gold-utils,kfreebsd-support}.diff: Updated.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 08 Nov 2016 12:19:55 +0100
+
+llvm-toolchain-snapshot (1:4.0~svn282142-1~exp1) experimental; urgency=medium
+
+  * The libstdc++-6-dev & libobjc-6-dev are only install with clang-X.Y
+    and libclang-X.Y-dev and no longer with libclang1-X.Y
+    (Closes: #841309)
+  * Fix the VCS-* fields
+
+  [ Kai Wasserbäch ]
+  * debian/patches/{23-strlcpy_strlcat_warning_removed.diff,
+    0003-Debian-version-info-and-bugreport.patch, atomic_library_[12].diff,
+    python-clangpath.diff,removeduplicatedeclaration.diff,
+    fix-clang-path-and-build.diff,mips-fpxx-enable.diff}: Refreshed.
+  * debian/patches/{silent-more-tests.diff,silent-MCJIIT-tests.diff}: Updated.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 24 Oct 2016 10:45:07 +0200
+
+llvm-toolchain-3.9 (1:3.9-6) unstable; urgency=medium
+
+  * Fix segfaults in the memory sanitizers (Closes: #842642)
+    Caused by the newer glibc. Many thanks for Nobert Lange for everything
+  * Enable the sanitizers testsuite
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 11 Nov 2016 17:01:38 +0100
+
+llvm-toolchain-3.9 (1:3.9-5) unstable; urgency=medium
+
+  * d/p/0011-SimplifyCFG-Hoisting-invalidates-metadata.patch: Also apply bug 29163
+    to fix some issues in rust (Closes: #842956)
+    Many thanks to Ximin Luo for the investigation
+
+  * libclang-common-4.0-dev: missing multilib binaries for the sanitizer
+    libraries (Closes: #841923)
+    Many thanks to Norbert Lange for the changes
+
+  [ Pauli ]
+  * d/p/clang-fix-cmpxchg8-detection-on-i386.patch:
+    libcxx atomic tests for old i386 fail with wrong Atomic inline width.
+    Needed for libc++
+    (See https://llvm.org/bugs/show_bug.cgi?id=19355)
+  * d/p lldb-addversion-suffix-to-llvm-server-exec.patch:
+    Fix the lldb-server call in some cases
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 04 Nov 2016 17:18:07 +0100
+
+llvm-toolchain-3.9 (1:3.9-4) unstable; urgency=medium
+
+  * LLVMConfig.cmake was installed into wrong location
+    Install a symlink from lib/cmake/llvm to share/llvm/cmake
+    (Closes: #839234)
+  * Fix a path issue in scan-view. Thanks Riccardo Magliocchetti
+    (Closes: #838572)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 31 Oct 2016 10:47:52 +0100
+
+llvm-toolchain-3.9 (1:3.9-3) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * The libstdc++-6-dev & libobjc-6-dev are only install with clang-X.Y
+    and libclang-X.Y-dev and no longer with libclang1-X.Y
+    (Closes: #841309)
+
+  [ Gianfranco Costamagna ]
+  * Team upload
+  * d/p/drop-wrong-hack-arm64.patch:
+    - drop hack that was preventing the package from building on
+      non-amd64 64bit architectures:
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Thu, 27 Oct 2016 11:45:28 +0200
+
+llvm-toolchain-snapshot (1:4.0~svn280796-1~exp1) experimental; urgency=medium
+
+  * Merge clang-include-fixer-4.0 into clang-4.0. Don't think
+    it deserves it own package
+  * python-lldb-4.0 archs "any" to a list like others pkg
+  * Fix a version issue with run-clang-tidy-4.0.py
+  * Also install clang-change-namespace-4.0
+
+  [ Kai Wasserbäch ]
+  * debian/clang-X.Y.install.in: Added clang-cpp.
+  * debian/patches: Refreshed.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 02 Sep 2016 13:11:56 +0200
+
+llvm-toolchain-3.9 (1:3.9-1) unstable; urgency=medium
+
+  * New stable release
+  * Port to kfreebsd. Many thanks to Pino Toscano
+    (Closes: #835665)
+  * clang_getAllSkippedRanges in the list of libclang1 symbols
+  * Try to disable the execution of the testsuite for scan-build & coverity
+    for real
+  * Also ship clang-reorder-fields as part of the clang-4.0 package
+  * Build lldb on arm64. Hopefully, works.
+  * New snapshot release
+  * Tentative fix for lldb-server build
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 07 Sep 2016 12:02:12 +0200
+
+llvm-toolchain-snapshot (1:4.0~svn279916-1) unstable; urgency=medium
+
+  * Snapshot is now 4.0
+  * Introduce clang-include-fixer-4.0
+  * Fix the usage of jsoncpp in polly. Thanks to James Clarke for the patch
+    (Closes: #835607)
+  * Fix the renaming of the manpages (Closes: #834077)
+  * Use the manpage from clang.rst instead of help2man
+  * Disable the build of lldb on mips64el, ppc64 and s390x for real
+  * Add symlink from ./build to ../share and ../lib etc
+    Thanks to Ximin Luo for the patch (Closes: #834144)
+  * Sync the 3.9 changes into 4.0
+  * Fix the cmake paths in llvm-4.0-dev deb package. Thanks to Brad King
+    for the patch (Closes: #819072)
+  * Bring back the lto (gone with the cmake migration)
+    (Closes: #819333) (upstream: #27223)
+  * LLVMConfig.cmake is now installed to <prefix>/lib/cmake/llvm instead of
+    <prefix>/share/llvm/cmake
+    Thanks to Brad King of the fix
+  * Disable lldb on sparc64 (Closes: #832371)
+  * Also install clang-rename.el & clang-rename.py in clang-4.0
+  * scan-build llvm results are built using --show-description
+  * Generate manpages for lli, lldb-mi & git-clang-format
+  * Fix some lintian overrides
+  * Generate more manpages
+  * Remove some garbage from the manpages (Closes: #815991, #804347)
+  * Disable -gsplit-dwarf on Ubuntu precise
+  * Update the coverity configuration (Debian has moved to gcc 6)
+  * remove compiler-rt-path.diff (file removed upstream, probably because
+    we moved to cmake)
+  * Ship clang-offload-bundler in clang 4.0
+  * Set the correct Conflicts for python-clang-4.0, python-lldb-4.0
+    (Closes: #832410)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 27 Aug 2016 14:19:41 +0200
+
+llvm-toolchain-snapshot (1:4.0~svn275970-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Bring back llvm-4.0-tools to life
+  * ship clang-tblgen & yaml-bench as part of the libclang-common-X.Y-dev
+    package
+
+  * amd64 llvm testsuite is green, bring back the failure in case of error
+  * Fix the cmake paths in llvm-3.9-dev deb package. Thanks to Brad King
+    for the patch (Closes: #819072)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 25 Jul 2016 12:18:52 +0200
+
+llvm-toolchain-3.9 (1:3.9~svn275918-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Silent test CodeGen/SPARC/LeonInsertNOPsDoublePrecision.ll
+  * ship lli-child-target as part of the llvm-X.Y-runtime package
+  * Bring back llvm-3.9-tools to life
+  * ship clang-tblgen & yaml-bench as part of the libclang-common-X.Y-dev
+    package
+  * ship lli-child-target as part of the llvm-X.Y-runtime package
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 19 Jul 2016 15:34:08 +0200
+
+llvm-toolchain-snapshot (1:3.9~svn274438-1) unstable; urgency=medium
+
+  * Remove the autoconf section
+  * Bring back the removal of the build dir
+  * Fix the coverage builds (didn't allow several cflags)
+  * Set the correct conflicts on python-lldb-3.8 (Closes: #817873)
+  * Set the correct conflicts on python-clang-3.8 (Closes: #817872)
+  * remove llvm26003-sanitizer-check-env.diff (merged upstream)
+  * Do not fail the build if the manpages cannot be built (failing on
+    Ubuntu precise)
+  * Install libfindAllSymbols.a as part of libclang-X.Y-dev
+  * Ship scan-build-py
+  * Use the libjsoncpp library embedded (fails to link otherwise)
+  * Standards-Version 3.9.8
+  * cmake files moved from usr/lib/llvm-3.9/share/llvm/cmake/
+    to usr/lib/llvm-3.9/lib/cmake/llvm/
+    (upstream change)
+  * Add a symlink from usr/lib/llvm-3.9/share/llvm/cmake
+    pointing to usr/share/llvm-3.9/cmake
+  * Disable the run of lldb testsuite because of LLVM_LINK_LLVM_DYLIB=ON:
+    https://llvm.org/bugs/show_bug.cgi?id=28127
+  * Add -gsplit-dwarf to CXXFLAGS to workaround the memory allocation
+    issue on i386
+  * Ignore the lintian override about embedded-library for json.
+    Doesn't link otherwise
+  * Fix the soname of libclang and libLLVM. Might cause some breakage with
+    existing app but no choice...
+
+  [ Pablo Oliveira ]
+  * Add python-six as a dependency of python-lldb (Closes: #825371)
+    (thanks to Askar Safin)
+  * Fix lldb symlinks
+  * Fix missing _lldb.so import during lldb testsuite
+
+  [ Ed Schouten ]
+  * Preparation of the support of lld (not ready yet)
+
+  [ Kai Wasserbäch ]
+    * debian/rules:
+      - Ensure ld-gold is used. CMake invokes the linker through g++ most of the
+        time, therefore we need to set -Wl,-fuse-ld=gold.
+      - Remove unused variable "confargs".
+
+  [ Brad King ]
+  * Install cmake files in usr/share/llvm-@LLVM_VERSION@/cmake/ instead of
+    usr/share/llvm-@LLVM_VERSION@/cmake/
+  * Also install libLLVM-3.8.so.1 as a symlink
+  * debian/patches/fix-cmake-config-prefix.diff:
+    cover the CMake build system too
+  (Closes: #819072)
+
+  [ Alexis La Goutte ]
+  * Fix an issue with scan-view (Closes: #825101)
+
+  [ YunQiang Su ]
+  * Enable FPXX by default on mips/mipsel (Closes: #826749)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 02 Jul 2016 20:46:05 +0200
+
+llvm-toolchain-snapshot (1:3.9~svn260851-1) unstable; urgency=medium
+
+  * New snapshot
+  * Switch to 3.9 (remove lldb-3.9-dev as it was a transitionnal pkg)
+  * Update the clang description for something more accurate (C++-11, 14, etc)
+  * Cmake migration. Done by Andrew Wilkins. Many thanks to him
+    - Update patches to set SONAME in CMake build
+    - Create symlinks with ".links", don't install from build tree
+    - Remove LLVM-internal tools (lit, FileCheck, not, tblgen, etc.)
+    - Remove llvm-X.Y-tools package, because it contained only
+      internal tools that are not intended for distribution.
+    - Remove autotools-specific artifacts from packages.
+    - Remove "dummy" documentation artifacts from llvm-X.Y-docs
+      package. Not built/installed by CMake, not useful.
+    - Update control/rules to support CMake
+    - Patch LLDB SWIG interfaces to workaround a bug in SWIG
+      See https://llvm.org/bugs/show_bug.cgi?id=25468
+    - add missing files to clang-format
+    - Add patch to fix sanitizer lit invocation
+    - removed LLVM-internal tools (lit, FileCheck, not, *-tblgen, etc.);
+      not installed by CMake, not intended for distribution
+    - removed llvm-X.Y-tools (contained only internal tools)
+    - removed autotools-specific artifacts (configure, Makefile, etc.)
+    - removed dummy documentation files
+  * Sync against 3.8
+  * Disable "Sphinx warnings treated as errors"
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 08 Mar 2016 09:50:29 +0100
+
+llvm-toolchain-3.8 (1:3.8-1) unstable; urgency=medium
+
+  * New upstream release
+  * Install a missing library to unbreak lldb (Closes: #815809)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 03 Mar 2016 21:16:21 +0100
+
+llvm-toolchain-3.8 (1:3.8~+rc3-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Update the clang description for something more accurate (C++-11, 14, etc)
+  * Update debian/orig-tar.sh to remove autoconf/config.sub autoconf/config.guess
+    in polly
+
+  [ Matthias Klose ]
+  * clang-tidy-3.8: Remove Breaks/Replaces on clang-modernize-3.8.
+  * Disable lldb on s390x.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 25 Feb 2016 14:26:14 +0100
+
+llvm-toolchain-3.8 (1:3.8~+rc2-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Remove build-llvm/ after the install step to save space.
+    Most of the rc1 builds failed because of hd space.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 03 Feb 2016 08:59:32 +0100
+
+llvm-toolchain-3.8 (1:3.8~+rc1-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Cmake migration. Done by Andrew Wilkins. Many thanks to him
+    - Update patches to set SONAME in CMake build
+    - Create symlinks with ".links", don't install from build tree
+    - Remove LLVM-internal tools (lit, FileCheck, not, tblgen, etc.)
+    - Remove llvm-X.Y-tools package, because it contained only
+      internal tools that are not intended for distribution.
+    - Remove autotools-specific artifacts from packages.
+    - Remove "dummy" documentation artifacts from llvm-X.Y-docs
+      package. Not built/installed by CMake, not useful.
+    - Update control/rules to support CMake
+    - Patch LLDB SWIG interfaces to workaround a bug in SWIG
+      See https://llvm.org/bugs/show_bug.cgi?id=25468
+    - add missing files to clang-format
+    - Add patch to fix sanitizer lit invocation
+    - removed LLVM-internal tools (lit, FileCheck, not, *-tblgen, etc.);
+      not installed by CMake, not intended for distribution
+    - removed llvm-X.Y-tools (contained only internal tools)
+    - removed autotools-specific artifacts (configure, Makefile, etc.)
+    - removed dummy documentation files
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 20 Jan 2016 16:09:01 +0100
+
+llvm-toolchain-3.8 (1:3.8.1-8) unstable; urgency=medium
+
+  * Disable the usage of ld gold on powerpc (Closes: #833583)
+  * Revert drop-avx512-from-skylake.diff, it is causing some regressions in the
+    testsuite
+  * Disable lldb on ppc64
+  * libfuzzer depends on the same version of clang (Closes: #833564)
+  * Use filter into of findstring in the gold usage. Thanks Doko for the
+    suggestion
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 07 Aug 2016 14:10:09 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-7) unstable; urgency=medium
+
+  * Fix the detection of gcc. This broke the build on the latest unstable
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 05 Aug 2016 09:55:15 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-6) unstable; urgency=medium
+
+  * Ship libFuzzer in its own package (libfuzzer-X.Y-dev) (Closes: #820159)
+  * Sync from Ubuntu. Many thanks to Matthias Klose
+    - drop-avx512-from-skylake.diff: Don't enable AVX512 on Skylake, as it's
+      a server cpu feature and breaks llvmpipe on workstations.
+    - Remove the build tree before calling dh_strip; at least the amd64 buildd
+      runs out of diskspace at this step.
+    - Add support for gcc's attribute abi_tag (needed for compatibility with
+      GCC 5's libstdc++); taken from the trunk (Closes: #797038)
+      (LP: #1510042, #1488254)
+      D17567-PR23529-Sema-part-of-attrbute-abi_tag-support.diff
+      D18035-PR23529-Mangler-part-of-attrbute-abi_tag-support.diff
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 28 Jul 2016 11:15:04 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-5) unstable; urgency=medium
+
+  [ Gianfranco Costamagna ]
+  * Try to fix mips64el build, by enabling the same
+    packages as the mips and mipsel versions
+  * Link mips* with latomic.
+
+  [ Sylvestre Ledru ]
+  * Disable lldb on sparc64 (Closes: #832371)
+  * Hopefully fix the FTBFS on armel
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 27 Jul 2016 22:49:09 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-4) unstable; urgency=medium
+
+  * Fix the FTBFS under mips/mipsel? (enable the link against atomic)
+    (Closes: #820537)
+  * Bring back llvm-3.8-tools to life
+  * ship clang-tblgen & yaml-bench as part of the libclang-common-X.Y-dev
+    package
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 20 Jul 2016 10:20:46 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-3) unstable; urgency=medium
+
+  * Add -gsplit-dwarf to CXXFLAGS to workaround the memory allocation
+    issue on i386 (hopefully)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 02 Jul 2016 20:59:08 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-2) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * Add a symlink from usr/lib/llvm-3.8/share/llvm/cmake
+    pointing to usr/share/llvm-3.8/cmake
+
+  [ Gianfranco Costamagna ]
+  * Remove python-lldb-3.8 where liblldb-3.8-dev is not built
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 28 Jun 2016 14:44:48 +0200
+
+llvm-toolchain-3.8 (1:3.8.1-1) unstable; urgency=medium
+
+  * New maintenance release
+
+  [ Kai Wasserbäch ]
+  * debian/rules: Ensure ld-gold is used. CMake invokes the linker through
+    g++ most of the time, therefore we need to set -Wl,-fuse-ld=gold.
+
+  [ Brad King ]
+  * Followup to fix the cmake install (Closes: #819072)
+
+  [ YunQiang Su ]
+  * Enable FPXX by default on mips/mipsel (Closes: #826749)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 23 Jun 2016 08:49:29 +0200
+
+llvm-toolchain-3.8 (1:3.8.1~+rc1-1~exp1) experimental; urgency=medium
+
+  * New RC release
+  * Improve the cmake detection (used for llvm.org/apt)
+  * Standards-Version updated to 3.9.8
+  * Ignore outdated-autotools-helper-file
+
+  [ Brad King ]
+  * Install cmake files in usr/share/llvm-@LLVM_VERSION@/cmake/ instead of
+    usr/share/llvm-@LLVM_VERSION@/cmake/
+  * Also install libLLVM-3.8.so.1 as a symlink
+  * debian/patches/fix-cmake-config-prefix.diff:
+    cover the CMake build system too
+  (Closes: #819072)
+
+  [ Pablo Oliveira ]
+  * Fix python-lldb dependencies and make proper symlinks to libLLVM
+    and liblldb as suggested by Graham Inggs (Closes: #821022)
+  * Fix liblldb suffix in lldb/scripts/Python/finishSwigPythonLLDB.py
+    (Closes: #813798)
+  * Fix LLVM bug 26158 - clang packages don't provide man pages
+  * Add python-six as a dependency of python-lldb (thanks to Askar Safin).
+
+  [ Gianfranco Costamagna ]
+  * Make python-lldb-3.8 depend on lldb-3.8-dev, to pick all
+    the required dependencies
+  * Unbreak circular dependency by Suggesting the python binding from
+    liblldb-3.8-dev
+
+  [ Alexis La Goutte ]
+  * Fix an issue with scan-view (Closes: #825101)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 26 May 2016 17:30:00 +0200
+
+llvm-toolchain-3.8 (1:3.8-2) unstable; urgency=medium
+
+  * Team upload.
+  * Disable polly on s390x and fix polly check.
+  * Fix VCS fields.
+
+  [ Sylvestre Ledru ]
+  * Fix txt file installation issue, by putting a README.txt file
+    with some explanation.
+
+  [ Graham Inggs ]
+  * Tighten llvm dev dependency (Closes: #814142).
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Mon, 07 Mar 2016 10:56:05 +0100
+
+llvm-toolchain-3.8 (1:3.8-1) unstable; urgency=medium
+
+  * New upstream release
+  * Install a missing library to unbreak lldb (Closes: #815809)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 03 Mar 2016 21:16:21 +0100
+
+llvm-toolchain-3.8 (1:3.8~+rc3-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Update the clang description for something more accurate (C++-11, 14, etc)
+  * Update debian/orig-tar.sh to remove autoconf/config.sub autoconf/config.guess
+    in polly
+
+  [ Matthias Klose ]
+  * clang-tidy-3.8: Remove Breaks/Replaces on clang-modernize-3.8.
+  * Disable lldb on s390x.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 25 Feb 2016 14:26:14 +0100
+
+llvm-toolchain-3.8 (1:3.8~+rc2-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Remove build-llvm/ after the install step to save space.
+    Most of the rc1 builds failed because of hd space.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 03 Feb 2016 08:59:32 +0100
+
+llvm-toolchain-3.8 (1:3.8~+rc1-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Cmake migration. Done by Andrew Wilkins. Many thanks to him
+    - Update patches to set SONAME in CMake build
+    - Create symlinks with ".links", don't install from build tree
+    - Remove LLVM-internal tools (lit, FileCheck, not, tblgen, etc.)
+    - Remove llvm-X.Y-tools package, because it contained only
+      internal tools that are not intended for distribution.
+    - Remove autotools-specific artifacts from packages.
+    - Remove "dummy" documentation artifacts from llvm-X.Y-docs
+      package. Not built/installed by CMake, not useful.
+    - Update control/rules to support CMake
+    - Patch LLDB SWIG interfaces to workaround a bug in SWIG
+      See https://llvm.org/bugs/show_bug.cgi?id=25468
+    - add missing files to clang-format
+    - Add patch to fix sanitizer lit invocation
+    - removed LLVM-internal tools (lit, FileCheck, not, *-tblgen, etc.);
+      not installed by CMake, not intended for distribution
+    - removed llvm-X.Y-tools (contained only internal tools)
+    - removed autotools-specific artifacts (configure, Makefile, etc.)
+    - removed dummy documentation files
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 20 Jan 2016 16:09:01 +0100
+
+llvm-toolchain-snapshot (1:3.8~svn255217-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Fix an install issue with clang-tidy
+  * clang-modernize has been removed. Long live to clang-tidy, its
+    replacement
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 10 Dec 2015 05:18:29 +0100
+
+llvm-toolchain-snapshot (1:3.8~svn254193-2) UNRELEASED; urgency=medium
+
+  * disable lldb and polly on powerpc, currently ftbfs.
+    setting the lldb archs in debian/control in just one
+    place would be appreciated.
+  * quoting fixes in debian/rules, when make macros
+    are empty
+    Thanks to Doko for the two previous changes (Closes: #806729)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 30 Nov 2015 15:34:12 +0100
+
+llvm-toolchain-snapshot (1:3.8~svn254193-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Remove some warnings in the manpages generation (Closes: #795310)
+  * Also ship sancov in clang-3.8
+  * Fix the links to scan-build-3.8 & scan-view-3.8
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 20 Oct 2015 14:07:06 +0200
+
+llvm-toolchain-snapshot (1:3.8~svn250696-1) unstable; urgency=medium
+
+  * Remove macho-dump from LLVM (removed by upstream r248302)
+  * Introduce clang-tidy-3.8 as a separate package. Replaces clang-modernize
+  * Ship run-clang-tidy.py & clang-tidy-diff.py in clang-tidy-3.8
+  * Remove cpp11-migrate-3.8 package. Has been replaced by clang-modernize
+    for a while (which will be replaced by clang-tidy)
+  * Add three new symbols in libclang1
+    - clang_CompileCommand_getFilename@Base
+    - clang_CompileCommand_getMappedSourceContent@Base 3.8
+    - clang_CompileCommand_getMappedSourcePath@Base 3.8
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 21 Sep 2015 13:16:35 +0200
+
+llvm-toolchain-snapshot (1:3.8~svn247576-1) unstable; urgency=medium
+
+  [ Sylvestre Ledru ]
+  * New snapshot release
+  * Remove CVE-2015-2305.patch. Already fixed upstream in a different
+    way
+  * remove patches merge upstream
+    - lit-lang.diff
+    - locale-issue-ld.diff
+  * Also generate liblldb-3.8-dbg
+  * Select LLVM OpenMP as the default backend
+
+  [ Gianfranco Costamagna ]
+  * d/control: Add more conflicting packages (python-clang and python-lldb)
+    (Closes: #796811, #796843)
+  * Remove an obsolete declaration about dragonegg
+    (cherry-pick from 3.7 branch)
+
+  [ James Price ]
+  * d/p/fix-cmake-config-prefix.diff: fix cmake path,
+    needs a change after upstream revision r241080
+    (Addresses: #794905)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 14 Sep 2015 18:29:09 +0200
+
+llvm-toolchain-snapshot (1:3.8~svn245286-1) unstable; urgency=medium
+
+  * New snapshot release (3.7 => 3.8)
+    No need to rename libllvm as 3.8 was not part of the debian archive
+
+  [ Gianfranco Costamagna ]
+  * Fix VCS fields.
+  * d/p/CVE-2015-2305.patch, fix security issue on regcomp.c
+  * Fix many lintian warning/errors
+    - copyright fixes
+    - control files
+    - disabled ocaml documentation
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 18 Aug 2015 14:28:36 +0200
+
+llvm-toolchain-snapshot (1:3.7~svn231060-1~exp2) UNRELEASED; urgency=medium
+
+  * Reflect upstream changes wrt vim package. Split the files into different
+    directories
+  * Disable the patch force-gcc-header-obj.diff. Seems to cause bug #23556
+  * Fix the CMake build. thanks to PaweÅ‚ Bylica for the fix.
+    Fix upstream bug #23352
+  * No longer building some clang help page, removing them
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 21 Apr 2015 09:41:41 +0200
+
+llvm-toolchain-snapshot (1:3.7~svn231060-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * Force the version of clang in the analyzer scripts
+    clang-analyzer-force-version.diff
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 03 Mar 2015 09:19:38 +0100
+
+llvm-toolchain-snapshot (1:3.7~svn230857-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Support of gcc 5.0 (Closes: #777988)
+  * compiler-rt-i586.diff: fix a build issue of compiler-rt under i386
+  * lldb-gdbserver & lldb-platform have been merged into lldb-server
+  * Bring back polly and remove libcloog-isl-dev & libisl-dev as build deps
+    (shipped in the polly source tree)
+  * Set the correct conflicts (Closes: #777580, #777581, #777582)
+  * lit-lang.diff: Force the call to ld to be in english
+    (was failing with a french locale)
+  * silent-MCJIIT-tests.diff: enable some tests and silents some other
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 28 Feb 2015 18:44:59 +0100
+
+llvm-toolchain-snapshot (1:3.7~svn227076-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Switch to version 3.7
+  * Standards-Version updated to 3.9.6
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 26 Jan 2015 09:23:41 +0100
+
+llvm-toolchain-snapshot (1:3.6~svn224810-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Update library filename declaration 3.5 => 3.6 (Closes: #772006)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 05 Dec 2014 17:46:56 -0800
+
+llvm-toolchain-snapshot (1:3.6~svn221998-1~exp1) experimental; urgency=medium
+
+  * Disable ocaml binding. Needs libctypes-ocaml 0.3.3 which is not available
+  * libllvm*.a is not longer built
+  * Update of the libclang symbols
+  * Improve the copyright file. Thanks to Dann Frazier (Closes: #766778)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 04 Nov 2014 14:43:28 +0100
+
+llvm-toolchain-snapshot (1:3.6~svn218612-1) unstable; urgency=medium
+
+  * Fix my screw up. Add .1 to the libclang soname to make
+    dpkg-shlibdeps happy
+  * Remove useless dependency on doxygen
+  * scan-build could not find clang binary (Closes: #758998)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 26 Sep 2014 17:05:26 +0200
+
+llvm-toolchain-snapshot (1:3.6~svn218446-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Upload in unstable
+  * Disable the co-instability of lldb & python-lldb
+    (Python stuff conflicts)
+  * Fix bad dependencies on lldb 3.6
+  * Refresh of the list of symbol in libclang
+  * Try to workaround the FTBFS under ppc64el (create an empty directory)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 24 Sep 2014 14:20:49 +0200
+
+llvm-toolchain-snapshot (1:3.6~svn216933-1~exp1) experimental; urgency=medium
+
+  * New snapshot release
+  * sync from 1:3.5~+rc4-2~exp1
+  * libclang-3.6.so should be used instead libclang.so. Update the soname
+    to match the new lib name (Closes: #759538)
+  * Rename liblldb.so to liblldb-3.6.so + update of the soname.
+  * python-clang-3.6 description updated
+  * liblldb-3.6 and python-lldb-3.6 added
+  * lldb-3.6-dev renamed to liblldb-3.6-dev to match the previous changes
+  * Manpages for llvm-ranlib, clang-apply-replacements, pp-trace and clang-tidy
+    added
+  * clang-3.6 should depends on binutils (for ld, at least)
+    (Closes: #751030)
+  * clang/www/analyzer/scripts/dbtree.js removed
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 30 Aug 2014 18:09:20 +0200
+
+llvm-toolchain-snapshot (1:3.6~svn215195-3) unstable; urgency=medium
+
+  * Just like in 3.4 & 3.5, bring back lldb & lldb-dev under mips & mipsel
+  * Ship clang-rename/clang-rename-3.6
+  * Disable libstdc++-header-i386.diff & include-target.diff (merged upstream)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 18 Aug 2014 09:02:30 +0200
+
+llvm-toolchain-snapshot (1:3.6~svn215195-2) unstable; urgency=medium
+
+  * try to build lldb-mi under kfreebsd (kfreebsd-lldb-mi.diff)
+  * kfreebsd-lldb-gdbserver.diff removed (applied upstream)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 11 Aug 2014 08:44:13 +0200
+
+llvm-toolchain-snapshot (1:3.6~svn215195-1) unstable; urgency=medium
+
+  * Upload in unstable
+  * Enable compressed debug sections (Closes: #757002)
+  * Force scan-build to use the same version of clang
+  * Old JIT has been removed. 0050-powerpcspe-fp.diff is useless
+  * try to build lldb-gdbserver under kfreebsd (kfreebsd-lldb-gdbserver.diff)
+  * Second try to fix build under HURD (hurd-EIEIO-undef.diff)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 04 Aug 2014 13:36:15 +0200
+
+llvm-toolchain-3.4 (1:3.4.2-8) unstable; urgency=medium
+
+  * Try to bring back lldb-3.4-dev on mips & mipsel (Closes: #758314)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 16 Aug 2014 22:39:13 +0200
+
+llvm-toolchain-3.4 (1:3.4.2-7) unstable; urgency=medium
+
+  * Upload in unstable
+  * Try to bring back lldb on mips & mipsel
+  * Force scan-build to use the same version of clang
+  * Try to fix hurd (hurd-EIEIO-undef.diff)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 05 Aug 2014 14:40:05 +0200
+
+llvm-toolchain-3.5 (1:3.5~+rc4-1) unstable; urgency=medium
+
+  * New snapshot release
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 27 Aug 2014 23:09:59 +0200
+
+llvm-toolchain-3.5 (1:3.5~+rc3-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Cherry-pick to commit from upstream (revisions 214906 214907)
+    to improve the gcc compat
+  * Remove scan-build-clang-path.diff (applied upstream)
+  * Just like in 3.4, bring back lldb & lldb-dev under mips & mipsel
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 20 Aug 2014 23:43:06 +0200
+
+llvm-toolchain-3.5 (1:3.5~+rc2-1) unstable; urgency=medium
+
+  * Fix the version
+  * try to build lldb-gdbserver under kfreebsd (kfreebsd-lldb-gdbserver.diff)
+  * Second try to fix build under HURD (hurd-EIEIO-undef.diff)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 08 Aug 2014 10:42:13 +0200
+
+llvm-toolchain-3.5 (1:3.5~+rc2-1~exp1) unstable; urgency=medium
+
+  * New snapshot release
+  * Enable compressed debug sections (Closes: #757002)
+  * Force scan-build to use the same version of clang
+  * Bring back scan-build-search-path.diff (Closes: #757219)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 04 Aug 2014 13:35:35 +0200
+
+llvm-toolchain-snapshot (1:3.6~svn214630-1~exp1) experimental; urgency=medium
+
+  * New snapshot release (3.5 => 3.6)
+  * Co installation of clang (Closes: #736057)
+    - scan-build => scan-build-3.6
+    - scan-view => scan-view-3.6
+    - asan_symbolize => asan_symbolize-3.6
+  * Refresh of the patches
+  * Install yaml2obj, obj2yaml & verify-uselistorder in llvm-3.6
+  * Remove of pollycc
+  * clang alternatives are managed by llvm-defaults
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 31 Jul 2014 18:12:59 +0200
+
+llvm-toolchain-3.5 (1:3.5~+rc1-2) unstable; urgency=medium
+
+  * Sync with 3.4 svn to retrieve some changes:
+  * Replace $(CURDIR)/debian/tmp by a variable
+  * Move the polly installation in the dh_auto_install rules instead
+    of using *.install files. In llvm.org/apt/, I have to sometime disable
+    polly
+  * hurd-EIEIO-undef.diff: try to undef an errno.h to fix the ftbfs
+  * clang-X suggests clang-X-doc (Closes: #755922)
+  * Manage all files using .in mechanism. It will simplify the upgrade of
+    version
+  * Disable lldb for ppc64el. Thanks to Dimitri John Ledkov (Closes: #756380)
+  * Fix the FTBFS under PowerPC. Thanks to Dimitri John Ledkov for the patch
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 24 Jul 2014 11:42:56 +0200
+
+llvm-toolchain-3.5 (1:3.5~+rc1-1) unstable; urgency=medium
+
+  * First RC release of the 3.5 llvm toolchain
+  * Apply lldb-kfreebsd.diff patch to fix FTBFS under KFreeBSD
+    Thanks to Ed Maste
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 23 Jul 2014 08:57:59 +0200
+
+llvm-toolchain-snapshot (1:3.5~svn213451-1) unstable; urgency=medium
+
+  * New snapshot release
+  * If the version of gcc is too old, force the usage of gcc 4.8
+  * Clang will now show the full version. Example: 3.5.0-svn213052-1~exp1
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 19 Jul 2014 15:27:11 +0200
+
+llvm-toolchain-snapshot (1:3.5~svn211669-2) unstable; urgency=medium
+
+  * Remove useless dependency on g++
+  * Use the option stable '-analyzer-config stable-report-filename=true'
+    to the llvm scan-build reports
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 29 Jun 2014 19:13:05 +0200
+
+llvm-toolchain-snapshot (1:3.5~svn211669-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Fix CVE-2014-2893 (Closes: #744817)
+  * Merge with 3.4/debian
+  * Ship lldb-mi in lldb
+  * Remove scan-build-fix-clang-detection.diff (applied upstream)
+  * Ship the compiler-rt static libraries
+  * Running tests respect DEB_BUILD_OPTIONS=parallel=X
+   (Closes: #751943)
+  * Fix FTBFS on powerpc and powerpcspe (Closes: #733890)
+  * Broken library symlink fixed in lldb-3.5 (Closes: #715130)
+  * Fix --use-cc when no absolute path is provided (Closes: #748777)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 25 Jun 2014 07:58:03 +0200
+
+llvm-toolchain-snapshot (1:3.5~svn209039-2) unstable; urgency=medium
+
+  * Provide a link as compatibility with previous lib name (Closes: #748569)
+  * Be less permissive when installing lldb. Remove duplication of the install
+    of liblldb.so.1
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 18 May 2014 20:01:40 +0200
+
+llvm-toolchain-snapshot (1:3.5~svn209039-1) unstable; urgency=medium
+
+  * New snapshot release
+  * Fix the cmake install patch
+  * Disable profile_rt.diff for now
+  * Refresh of libclang1-3.5.symbols
+  * Fix path to /usr/lib/clang/3.5.0/ (Closes upstream #19088)
+  * Fix the wrong dependency declaration on llvm-3.5-tools
+  * Add gnustep & gnustep-devel as suggests of clang-3.5
+  * Add libc6-dev as an explicit dependency of clang-3.5
+  * Build with dh_install --fail-missing
+  * Start to use /usr/bin/foo-X.Y. First step to have several clang versions
+    installed together
+  * Add some missing files:
+    - lli-child-target         - llvm-3.5-runtime
+    - count                    - llvm-3.5-tools
+    - html.tar.gz              - llvm-3.5-doc
+    - ocamldoc.tar.gz          - llvm-3.5-doc
+    - BugpointPasses.so        - llvm-3.5-dev
+    - liblldb*                 - lldb-3.5-dev
+    - clang-apply-replacements - clang-3.5
+    - clang-tidy               - clang-3.5
+    - clang-query              - clang-3.5
+    - pp-trace                 - clang-3.5
+    - lldb-platform            - lldb-3.5
+    - lldb-gdbserver           - lldb-3.5
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 16 May 2014 23:23:50 +0200
+
+llvm-toolchain-3.4 (1:3.4.2-2) unstable; urgency=medium
+
+  * Improve the CVE-2014-2893 fix (Closes: #744817)
+  * Add a check to avoid an error on arch where compiler-rt is not available
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 16 Jun 2014 23:00:47 +0200
+
+llvm-toolchain-3.4 (1:3.4.2-1) unstable; urgency=medium
+
+  * New upstream release
+  * Add build conflict on libllvm-3.5-ocaml-dev
+  * Also disable lldb tests under armel (like armhf). Timeout
+  * Update of the repack script
+  * Use llvm-3.4-dev.links.in to manage the symlinks
+  * Fix the soname of liblldb.so to see it treated as a real library
+    (Closes: #750868)
+  * Switch to the default gcc/g++ compiler. Currently 4.9 (Closes: #751322)
+  * Fixes CVE-2014-2893 (Closes: #744817)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 06 Jun 2014 15:55:57 +0200
+
+llvm-toolchain-3.4 (1:3.4.1-4) unstable; urgency=medium
+
+  * Be less permissive when installing lldb. Remove duplication of the install
+    of liblldb.so.1
+  * Add symlinks lldb-3.4, lldb-platform-3.4 & lldb-gdbserver-3.4 without 3.4
+  * Clang was unusable with libstdc++ from gcc 4.9 (Closes: #744792)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 18 May 2014 20:18:19 +0200
+
+llvm-toolchain-3.4 (1:3.4.1-3) unstable; urgency=medium
+
+  * Fix path for arch without support of compiler-rt. Should fix most of the
+    FTBFS
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 16 May 2014 15:27:37 +0200
+
+llvm-toolchain-3.4 (1:3.4.1-2) unstable; urgency=medium
+
+  * Fix the soname. No changes in the ABI, so, no need to update the soname
+    (Closes: #747701)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 11 May 2014 17:29:22 +0200
+
+llvm-toolchain-3.4 (1:3.4.1-1) unstable; urgency=medium
+
+  * New upstream release. Note that only LLVM & Clang had a new release.
+    I just copied the 3.4 tarballs for clang-extra-tools, polly, lldb and
+    compiler-rt.
+  * Symlink for current build mode missing (Closes upstream #18836)
+  * Add link usr/lib/llvm-3.4/ to usr/lib/llvm-3.4/build/Debug+Asserts
+  * Backport of a r201586 from upstream. scan-build was failing on some project
+    like firefox build system. (Yeh, advantage to be the packager of a software
+    that I use ;) ). See scan-build-fix-clang-detection.diff
+  * Fix the version in the symbol list (libclang1-3.4.symbols)
+  * Update the path regarding upstream changed (3.4 => 3.4.1)
+    (Patch improved also by Martin Nowack)
+  * Remove generated file libllvm3.4.install
+  * Add gnustep & gnustep-devel as suggests of clang-3.4
+  * Add libc6-dev as an explicit dependency of clang-3.4
+  * Build with dh_install --fail-missing
+  * Start to use /usr/bin/foo-X.Y. First step to have several clang versions
+    installed together
+  * Add some missing files:
+    - lli-child-target         - llvm-3.4-runtime
+    - count                    - llvm-3.4-tools
+    - html.tar.gz              - llvm-3.4-doc
+    - ocamldoc.tar.gz          - llvm-3.4-doc
+    - BugpointPasses.so        - llvm-3.4-dev
+    - liblldb*                 - lldb-3.4-dev
+    - lldb-platform-3.4        - lldb-3.4
+    - clang-apply-replacements - clang-3.4
+    - clang-tidy               - clang-3.4
+    - pp-trace                 - clang-3.4
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 09 May 2014 19:57:33 +0200
+
+llvm-toolchain-snapshot (1:3.5~svn200375-1) unstable; urgency=medium
+
+  * New snapshot release
+  * polly unnopstream is now using the isl trunk. Disabling it for now.
+  * Only explicit the link against atomic when running mips & mipsel
+  * Fix the cindex.py declaration (3.3 => 3.5). Closes upstream bug #18365
+  * Bring back the dependency on gcc 4.8. It breaks the nightly snapshot
+    packages and it should be the norm now...
+
+  [ Martin Nowack ]
+  * Fixed build directory for llvm-config
+  * Add Unittests for running tests for llvm-based projects
+  * Install FileCheck and not for testing
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 29 Jan 2014 07:36:29 -0800
+
+llvm-toolchain-snapshot (1:3.5~svn199601-1) unstable; urgency=low
+
+  * New snapshot release
+  * Update clang-format declaration from 3.4 => 3.5. Closes upstream bug #18451
+  * Fix the cindex.py declaration (3.3 => 3.5). Closes upstream bug #18365
+  * Force gcc 4.8. LLVM & Co are now in C++ 11.
+  * Also make clang-3.5 breaks/replaces clang. Conflicts on
+    /usr/share/clang/scan-view/ScanView.py (Closes: #730266)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 15 Jan 2014 15:08:03 +0100
+
+llvm-toolchain-snapshot (1:3.5~svn197556-1) unstable; urgency=low
+
+  * New snapshot release
+  * Merge changes from 1:3.4~+rc3-1
+  * Disable much of the display of the lldb display
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 17 Dec 2013 12:02:52 +0100
+
+llvm-toolchain-snapshot (1:3.5~svn195337-1) unstable; urgency=low
+
+  * Sync from 3.4~+rc2-1
+  * Make lldb 3.5 also conflict with 3.4 (Closes: #730163)
+  * Make python-clang 3.5 also conflict with 3.4 (Closes: #730164)
+  * Fix a FTBFS with clang
+  * Refresh the /usr/include/clang mess
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 10 Dec 2013 09:57:15 +0100
+
+llvm-toolchain-snapshot (1:3.5~svn195337-1) unstable; urgency=low
+
+  * Switch from 3.4 to 3.5
+  * Remove patch 0046-Revert-Patch-to-set-is_stmt-a-little-better-for-prol.patch
+    Useless now and misleading
+  * Standards-Version updated to 3.9.5
+  * kfreebsd.diff remove (applied upstream)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 20 Nov 2013 21:24:28 +0100
+
+llvm-toolchain-3.4 (1:3.4-2) unstable; urgency=medium
+
+  * Only explicit the link against atomic when running mips & mipsel
+  * Fix the cindex.py declaration (3.3 => 3.5). Closes upstream bug #18365
+  * Bring back the dependency on gcc 4.8. It breaks the nightly snapshot
+    packages and it should be the norm now...
+  * Introduce llvm-3.4-tools to contain the new files needed by Martin
+
+  [ Matthias Klose ]
+  * Disable the lldb build for AArch64.
+  * Don't run the lldb tests on armhf (time out on the buildd).
+
+  [ Martin Nowack ]
+  * Fixed build directory for llvm-config
+  * Add Unittests for running tests for llvm-based projects
+  * Install FileCheck and not for testing
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 11 Feb 2014 11:19:21 +0100
+
+llvm-toolchain-3.4 (1:3.4-1) unstable; urgency=medium
+
+  * New upstream release
+  * Remove explicit dep on gcc 4.8
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 20 Dec 2013 18:36:58 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc3-1ubuntu4) trusty; urgency=medium
+
+  * Rebuild for ocaml-4.01.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 23 Dec 2013 12:11:17 +0000
+
+llvm-toolchain-3.4 (1:3.4~+rc3-1ubuntu3) trusty; urgency=low
+
+  * Bring over Ubuntu changes from 3.3:
+    - Revert to using the static copy of libjsoncpp, since the shared
+      library lacks sane versioning, and this is only a few thousand
+      lines of cargo-culted code from a reasonably stagnant upstream.
+    - Drop lcov build-dep to avoid pulling it into main, due to its
+      being fundamentally incompatibe with our newer GCC versions.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 20 Dec 2013 12:59:01 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc3-1ubuntu2) trusty; urgency=low
+
+  * Don't run the lldb tests on armhf (time out on the buildd).
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 18 Dec 2013 12:29:56 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc3-1ubuntu1) trusty; urgency=low
+
+  * Disable the lldb build for AArch64.
+  * Build-depend on gcc-multilib on amd64 and i386.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 17 Dec 2013 18:44:50 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc3-1) unstable; urgency=low
+
+  * New testing upstream release
+  * Relative call in the chroot without proc failed.
+    See: fix-an-issue-in-chroot-witout-proc.diff
+  * Bring back lldb-link-atomic.diff to make sure lldb builds under
+    powerpc
+  * Also limit the number of archs for liblldb-dev
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 17 Dec 2013 11:27:40 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc2-3) unstable; urgency=low
+
+  * Fix the bad declaration on the lldb desactivation
+  * Also disable lldb under powerpc
+  * Hopefully, fix lldb under Kfreebsd-* (thanks to Ed Maste if it works)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 04 Dec 2013 23:53:49 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc2-2) unstable; urgency=low
+
+  * Add the Ocaml ABI dependency (Closes: #731344)
+  * Disable LLDB also for ia64, mips & mipsel
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 04 Dec 2013 15:37:39 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc2-1) unstable; urgency=low
+
+  * New testing upstream release
+  * 0047-version-name.diff ocamldoc.diff removed (applied upstream)
+  * r600 is now compiled by default (remove the configure arg)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 03 Dec 2013 10:25:59 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc1-3) unstable; urgency=low
+
+  * Remove the usage of --with-c-include-dirs, --with-cxx-include-root,
+    --with-cxx-include-arch and --with-cxx-include-64bit-dir
+    It was blocking the automatic detection of the path of clang.
+    In particular in the context of the usage of -target.
+    However, it does not completely fix the detection of the i386 C++ path.
+    See the next item.
+    (Closes: #729933)
+  * Bring back the path to libstdc++ under i386. Still not fixed upstream
+    (Closes: #730857)
+  * Define also MAXPATHLEN in Path.inc for HURD.
+  * Silent the trillion of warnings in the LLDB Python wrapper (swig generated)
+    See silent-swig-warning.diff
+  * Silent some i386 tests failing (it is expected)
+    See silent-MCJIIT-tests.diff
+  * Make lldb 3.4 also conflict with 3.5 (Closes: #730163)
+  * Make python-clang 3.4 also conflict with 3.5 (Closes: #730164)
+  * Port LLVM to mips64el. Thanks to YunQiang Su. Initially done for
+    3.3 and ported on the 3.4 (Closes: #730808)
+  * If we get an unexpected pass, do not break the tests
+    do-not-fail-on-unexpected-pass.diff (I am disabling some tests)
+  * Fix the path detection of the objective h headers.
+  * Also add usr/lib/llvm-3.4/lib/clang/3.4/include =>
+    usr/lib/clang/3.4/include symlink to simplify the path detection
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 01 Dec 2013 17:49:46 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc1-2) unstable; urgency=low
+
+  * Force the build to gcc 4.8... gcc 4.6 used on some Debian archs does not
+    support some C++ features.
+  * Fail the build when llvm tests are failing under amd64 + i386. More to come.
+  * Fix a libclang.so.1 issue during the clang tests
+  * Improve the patch 23-strlcpy_strlcat_warning_removed.diff
+    (also remove the tests)
+  * Make lldb 3.4 also conflict with 3.5 (Closes: #730163)
+  * Make python-clang 3.4 also conflict with 3.5 (Closes: #730164)
+  * Remove usr/lib/llvm-3.4/build/autoconf/LICENSE.TXT
+  * silent warning "manpage-has-useless-whatis-entry" in lldb-3.4
+  * silent warning "package-name-doesnt-match-sonames libclang1"
+  * Refresh patch kfreebsd_v2.diff to, maybe, fix lldb build under kfreebsd.
+    Thanks to Ed Maste for the patch.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 26 Nov 2013 18:32:49 +0100
+
+llvm-toolchain-3.4 (1:3.4~+rc1-1) unstable; urgency=low
+
+  * New testing upstream release
+  * kfreebsd.diff removed. Applied upstream
+  * Remove patch 0046-Revert-Patch-to-set-is_stmt-a-little-better-for-prol.patch
+    Useless now and misleading
+  * Branch from llvm-toolchain-snapshot
+  * Standards-Version updated to 3.9.5
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 20 Nov 2013 21:24:28 +0100
+
+llvm-toolchain-snapshot (1:3.4~svn194079-1) unstable; urgency=low
+
+  * New snapshot release
+  * Also install clang 3.4 examples (clang-3.4-examples) (Closes: #728260)
+  * Move c-index-test* from llvm-3.4 => clang-3.4. It was triggering an
+    unnecessary dependency from llvm-3.4 to libclang
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 01 Nov 2013 05:19:55 +0100
+
+llvm-toolchain-snapshot (1:3.4~svn193628-1) unstable; urgency=low
+
+  * New snapshot release
+    - Fix the scan-build warning (Closes: #725332)
+  * Merge changes from the 3.3 branch (see 1:3.3-12)
+  * Add lldb-3.4-dev package
+  * Remove mipsel-ftbfs.diff (applied upstream)
+  * Add support of coverity checker (non-free and not packaged)
+  * libprofile_rt and runtime has been removed upstream (r191835)
+    Features are provided by compiler-rt
+  * Update the build dependency from tcl8.5 to tcl (Closes: #725954)
+  * clang-modernize-3.4 was not coinstallable with clang 3.4
+    (Closes: #724245)
+  * The package wasn't cleaned correctly (Closes: #722155)
+  * libtinfo-dev is now a dependency of llvm-3.4-dev (Closes: #727129)
+  * Install libclang.so in /usr/lib/*/libclang-3.4.so
+  * Install libclang.so.1 in /usr/lib/*/libclang-3.4.so.1
+  * Also ship the python clang binding (python-clang-3.4)
+  * Enable polly if the dependencies are OK (only Debian unstable for now)
+  * Bring back /usr/lib/llvm-3.4/lib/libclang.so (libclang-3.4-dev) and
+    /usr/lib/llvm-3.4/lib/libclang.so.1 (libclang1-3.4)
+  * Honor the option "nocheck"
+  * Disable the build of lldb under HURD
+  * Ship the lldb headers into lldb-X.Y-dev (Closes: #723743)
+    I might create a liblldb-X.Y library at some point but I think it is too
+    early.
+  * Update the build dependency from tcl8.5 to tcl (Closes: #725953)
+  * Update of the clang descriptions (Closes: #727684)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 29 Oct 2013 17:56:18 +0100
+
+llvm-toolchain-snapshot (1:3.4~svn190846-1) unstable; urgency=low
+
+  * New snapshot release
+  * Merge changes from the 3.3 branch (see 1:3.3-9)
+  * Remove ia64-fix.diff (applied upstream)
+  * cpp11-migrate renamed to clang-modernize
+  * lldb-3.4 is back to Architectures: any
+  * Patch lldb-hurd.diff removed (applied upstream)
+  * Directory www/ from tarballs polly & lldb removed
+  * Update of the description of LLVM packages
+    (LLVM no longer mean Low Level Virtual Machine)
+
+  [ Luca Falavigna ]
+  * debian/control:
+    - Add llvm-3.4-dev to lldb-3.4 Depends field.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 05 Sep 2013 12:04:35 +0200
+
+llvm-toolchain-3.3 (1:3.3-9) unstable; urgency=low
+
+  [ Luca Falavigna ]
+  * debian/control:
+    - Add llvm-3.3-dev to lldb-3.3 Depends field (Closes: #715129).
+
+  [ Sylvestre Ledru ]
+  * Only use -fuse-ld=gold on supported distribution. Simplify the
+    backports.
+  * Fix  'bits/c++config.h' file not found under i386
+    See libstdc++-header-i386.diff. (Closes: #714890)
+  * Add more fixes for the HURD port... (but still fails)
+
+  [ Robert Millan ]
+  * clang under KfFreeBSD was not exporting the correct defines
+    (Closes: #721880)
+
+  [ Jon Severinsson ]
+  * Merge from llvm-toolchain-3.2 branch up to 3.2repack-11.
+  * Drop auto-generated file debian/libllvm3.3.install.
+  * Automatically determine GCC_VERSION and dep:devlibs based on g++ package
+    version.
+  * Automatically determine if -fuse-ld=gold is supported based on binutils
+    package version.
+
+  [ Adam Conrad ]
+  * debian/patches/lldb-link-atomic.diff: Link lldb with -latomic to get
+    builtin GCC atomic helpers on arches (like powerpc) that need them.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 26 Aug 2013 14:48:42 +0200
+
+llvm-toolchain-3.3 (1:3.3-8) unstable; urgency=low
+
+  [ Sylvestre Ledru ]
+  * Fix another issues under HURD...
+
+  [ Luca Falavigna ]
+  * debian/patches/libprofile_rt_sparc.patch:
+    - Re-enable libprofile_rt on Sparc, fix FTBFS.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 23 Aug 2013 15:02:05 +0200
+
+llvm-toolchain-3.3 (1:3.3-7) unstable; urgency=low
+
+  * debhelper version 9.20130720 fails on the call to dh_auto_clean
+    Remove it. It was anyway useless.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 22 Aug 2013 14:28:25 +0200
+
+llvm-toolchain-3.3 (1:3.3-6) unstable; urgency=low
+
+  * Fix the FTBFS under hurd and KFreeBSD
+  * Do not remove all *.o in tests. Some of them are from upstream source
+    tarball. Thanks to Maarten Lankhorst for the fix.
+  * Fix the lintian error 'lldb-3.3: postinst-must-call-ldconfig'
+  * Add the manpages of clang-format-3.3
+  * Overrides the manpages warnings
+  * Also apply unwind-chain-inclusion.diff from the snapshot branch to make sure
+    we can build the package locally even if libclang-dev is installed
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 22 Aug 2013 09:01:04 +0200
+
+llvm-toolchain-3.3 (1:3.3-5) unstable; urgency=low
+
+  * Install llvm-c headers also in usr/include/llvm-3.3/llvm-c
+  * Fix the FTBFS under mips & mipsel
+  * Refresh of the kfreebsd i386 patch
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 07 Aug 2013 13:12:23 +0200
+
+llvm-toolchain-3.3 (1:3.3-4) unstable; urgency=low
+
+  * Use the static library libjsoncpp.a instead of the ship library in polly
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 11 Aug 2013 09:54:17 +0200
+
+llvm-toolchain-snapshot (1:3.4~svn185325-1) unstable; urgency=low
+
+  * binutils-gold no longer exists. Use -fuse-ld=gold instead.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 01 Aug 2013 14:06:38 +0200
+
+llvm-toolchain-snapshot (1:3.3-2) unstable; urgency=low
+
+  * Fix warning python-script-but-no-python-dep on clang-format-X.Y
+  * manpages are generated during build time (simplifies maintenance)
+  * Fix duplicate underscore.js and jquery.js
+  * Move libjs-jquery & libjs-underscore dependencies to llvm-X.Y-doc
+  * Add lldb-X.Y manpage
+  * Hopefully fix the ftbfs under mipsel (mipsel-ftbfs.diff)
+  * Disable the usage of binutils-gold under armel. It currently fails with:
+    "attempt to map 2752512 bytes at offset 2066666 exceeds size of file;
+    the file may be corrupt"
+
+  [ Léo Cavaillé ]
+  * Add patch to find correctly LLVMGold.so with -O4 (Closes: #712437)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 20 Jun 2013 15:39:11 +0200
+
+llvm-toolchain-snapshot (1:3.4~svn184294-1~exp1) experimental; urgency=low
+
+  * New snapshot release
+  * Improve some scripts and fix cpp11-migrate install from
+    clang-tools-extra.
+  * Fix "versionless" clang manpages install.
+  * Fix Toolchain patch from change of scope (add namespaces).
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 19 Jun 2013 14:20:12 +0200
+
+llvm-toolchain-snapshot (1:3.4~svn183914-1) unstable; urgency=low
+
+  * New snapshot release
+  * Upload to unstable (will be blocked by a RC bug)
+  * Sync changes from llvm-toolchain-3.3:
+    - Introduce cpp11-migrate-3.4 and clang-format-3.4
+    - Install the vim llvm script at the right place
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 13 Jun 2013 18:47:08 +0200
+
+llvm-toolchain-snapshot (1:3.4~svn182733-1~exp1) experimental; urgency=low
+
+   * New snapshot release (3.4 release)
+   * Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
+       to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
+     * Various packages rename to allow co installations:
+       * libclang1 => libclang1-3.4
+       * libclang1-dbg => libclang1-3.4-dbg
+       * libclang-dev => libclang-3.4-dev
+       * libclang-common-dev => libclang-common-3.4-dev
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 27 May 2013 15:01:57 +0200
+
+llvm-toolchain-snapshot (1:3.3~svn179851-1~exp1) experimental; urgency=low
+
+  * Draft of a snapshot release (3.3)
+  * Enable r600 experimental backend
+  * Improve the dependencies:
+    * clang-3.3 depends on the exact same libllvm3.3 release
+    * idem for lldb-3.3
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 19 Apr 2013 09:31:38 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-11) unstable; urgency=low
+
+  * dh_auto_clean removed, just like in the 3.3
+  * Use the static library libjsoncpp.a instead of shipping library in polly
+    Backport of the modification of 3.3
+
+  [ Adam Conrad ]
+  * Revive deltas from the previous Ubuntu versions of llvm and clang:
+    - debian/patches/35-ubuntu-releases.diff: Add UbuntuSaucy to table.
+    - debian/patches/JITEmitter.patch: Fix a segfault in the exception
+      table of the JIT code emitter (See Launchpad bug #1160587)
+
+  [ Luca Falavigna ]
+  * debian/patches/libprofile_rt_sparc.patch:
+    - Re-enable libprofile_rt on Sparc, fix FTBFS.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Fri, 23 Aug 2013 11:49:09 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-10) unstable; urgency=low
+
+  * Fix the wrong package declaration on libstdc++-4.8-dev (Closes: #713944)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 24 Jun 2013 23:00:47 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-9) unstable; urgency=low
+
+  * Switch to libstdc++ 4.8 instead of 4.7 for the headers (Closes: #712520)
+  * Depends against libobjc-4.8-dev and libgcc-4.8-dev
+  * Disable the usage of binutils-gold under armel. It currently fails with:
+      "attempt to map 2752512 bytes at offset 2066666 exceeds size of file;
+      the file may be corrupt"
+  * Add DEBUGMAKE=1 to get information about compiler-rt compilation
+  * Fix "libclang-common-dev: missing-depends-line"
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 22 Jun 2013 07:38:41 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-8) unstable; urgency=low
+
+  * Fix the build under ia64. Thanks to Luca Falavigna for the patch
+    (ia64-fix.diff)
+  * Disable lldb-3.2:
+    - the quality is not good enough
+    - We have lldb-3.3 now in the archive
+    - Too many backported patches would be necessary for lldb-3.2 to work
+    - It blocks some important transitions (mesa)
+  * Add the detection of Ubuntu saucy
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 03 Jun 2013 11:32:29 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-7) unstable; urgency=low
+
+  * For now, enable only lldb for amd64 and i386 (blocks too many things)
+    (Bis) (Closes: #707866)
+  * Add a symlink of libLLVM-3.2.so.1 to usr/lib/llvm-3.2/lib/libLLVM-3.2.so
+    to fix make the llvm-config-3.2 --libdir work (Closes: #708677)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Mon, 27 May 2013 13:20:30 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-6) unstable; urgency=low
+
+  * Create the compiler-rt directory to make the install of compiler-rt works
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 18 May 2013 18:08:52 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-5) unstable; urgency=low
+
+  * For now, enable only lldb for amd64 and i386 (blocks too many things)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 18 May 2013 10:24:04 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-4) unstable; urgency=low
+
+  * Add several patches which, hopefully, will fix the build under ARM, S390,
+    S390X, etc (lldb-apple_only.diff, lldb-user-remove.diff & lldb-hurd.diff)
+  * Include sys/wait.h also under kfreebsd (kfreebsd-thread.diff)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 15 May 2013 12:04:24 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-3) unstable; urgency=low
+
+  * Before the configure, show which version of CC is being used.
+  * Add support of kfreebsd and hurd in lldb (kfreebsd-hurd-lldb.diff)
+  * Force the usage of gcc 4.7 for all archs. Should fix some FTBFS
+    (Closes: #707866)
+  * Fix the symlink on clang++.1.gz llvm-clang.1.gz (Closes: #707832)
+
+  [ Jon Severinsson ]
+  * Re-enable the r600 backend and update it to the mesa-9.1.1 tag.
+   (Closes: #708009)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 14 May 2013 12:10:07 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-2) unstable; urgency=low
+
+  * Do not depend on libobjc-4.7-dev & libgcc-4.7-dev.
+    They are still only in experimental
+  * Disable the usage of binutils-gold under [powerpc powerpcspe ppc64 sparc
+    sparc64] to fix FTBFS
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 07 May 2013 13:15:20 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-1) unstable; urgency=low
+
+  * Upload to unstable
+  * Standards-Version update to 3.9.4
+  * clang pure virtual function call crash with binaries built with C++11's
+    std::thread. Upstream commit 178816 (Closes: #705838)
+  * Introduce a symbols file for libclang1 (Closes: #705672)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 21 Apr 2013 14:06:23 +0200
+
+llvm-toolchain-3.2 (1:3.2repack-1~exp4) experimental; urgency=low
+
+  * Build using binutls-gold to improve the quality of the binaries.
+    See: http://allievi.sssup.it/techblog/?p=791
+  * Detect the vendor (Debian or Ubuntu) and update the configuration
+  * Port to powerpcspe. Thanks to Roland Stigge (Closes: #701587)
+    See: 31-powerpcspe.diff
+  * Fix the path detection of scan-build (Closes: #698352)
+    See: 32-scan-build-path.diff
+  * debian/patches/r600-snapshot.diff: Move backports into individual patches.
+  * debian/patches/r600-snapshot.diff: Update to mesa-9.1 git tag.
+    (Closes: #703671, #697356)
+  * Fix a typo in the detection of the vendor
+
+  [ Peter Michael Green ]
+  * Use binutils-gold only on architectures where it is actually available
+  * 33-armhf-defaults.diff Fix defaults to use correct CPU and FPU for
+    debian  armhf (Closes: #704111)
+  * 34-powerpc-no-altivec.diff disable altivec by default on powerpc because
+    debian powerpc does not require altivec (patch cherry picked from ubuntu)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 14 Mar 2013 17:47:12 +0100
+
+llvm-toolchain-3.2 (1:3.2repack-1~exp3) experimental; urgency=low
+
+  * Remove package "clang". It is now provided by llvm-defaults.
+  * Fix some issues relative to the epoch change
+  * Fix a wrong path in the _lldb.so Python symlink
+  * Install cmake files to build LLVM extensions (Closes: #701153)
+  * Remove the embedded copy of libjs-jquery (Closes: #701087)
+  * Fix the install of lli manpage (Closes: #697117)
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sun, 17 Feb 2013 12:05:15 +0100
+
+llvm-toolchain-3.2 (1:3.2repack-1~exp2) experimental; urgency=low
+
+  * Install the python files for lldb. Thanks to Daniel Malea for spotting this.
+  * Update of the clean target
+  * Introduce an epoch to match the changes in bug #699899
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Wed, 13 Feb 2013 12:22:30 +0100
+
+llvm-toolchain-3.2 (3.2repack-1~exp1) experimental; urgency=low
+
+  * Build the whole LLVM toolchain at once. This includes:
+    - LLVM
+    - Clang
+    - compiler-rt
+    - lldb
+    - polly
+  * Also install clang-check & clang-tblgen in the clang-3.2 package
+  * Fix the patch detection of clang from scan-build (Closes: #698352)
+  * debian/patches/0050-powerpcspe-fp.diff: Add, hopefully fix FTBFS on
+    powerpcspe, by disabling save / restore of floating point registers which
+    don't exist on powerpcspe. Thanks to Roland Stigge for the patch.
+    (Closes: #696474)
+  * libLLVM-3.2.so.1 is now shipped only once (Closes: #696913)
+  * Enable RTTI (Closes: #697754)
+  * Introduce lldb as a new package (Closes: #698601)
+  * Add a script pollycc which will call clang with the right arguments.
+  * Use __builtin___clear_cache on ARM to fix a clang bug.
+    Thanks to Matthias Klose.
+
+ -- Sylvestre Ledru <sylvestre@debian.org>  Sat, 09 Feb 2013 12:14:10 +0100
diff --git a/clang-X.Y-doc.docs.in b/clang-X.Y-doc.docs.in
new file mode 100644 (file)
index 0000000..b3cc6a0
--- /dev/null
@@ -0,0 +1,2 @@
+tools/clang/docs/_build/html/
+
diff --git a/clang-X.Y-examples.examples.in b/clang-X.Y-examples.examples.in
new file mode 100644 (file)
index 0000000..49cbc5f
--- /dev/null
@@ -0,0 +1 @@
+clang/examples/*
diff --git a/clang-X.Y.install.in b/clang-X.Y.install.in
new file mode 100644 (file)
index 0000000..c92899f
--- /dev/null
@@ -0,0 +1,12 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/clang
+usr/lib/llvm-@LLVM_VERSION@/bin/clang++
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-cpp
+
+#usr/share/man/man1/clang.1     usr/share/man/man1/
+usr/lib/llvm-@LLVM_VERSION@/lib/cmake/clang/*.cmake
+usr/lib/llvm-@LLVM_VERSION@/share/clang/bash-autocomplete.sh
+
+usr/bin/clang-@LLVM_VERSION@
+usr/bin/clang++-@LLVM_VERSION@
+usr/bin/clang-cpp-@LLVM_VERSION@
+
diff --git a/clang-X.Y.links.in b/clang-X.Y.links.in
new file mode 100644 (file)
index 0000000..412b2ca
--- /dev/null
@@ -0,0 +1,3 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/clang usr/lib/llvm-@LLVM_VERSION@/bin/clang-@LLVM_VERSION@
+usr/lib/llvm-@LLVM_VERSION@/lib/cmake/clang usr/lib/cmake/clang-@LLVM_VERSION@
+usr/lib/llvm-@LLVM_VERSION@/share/clang/bash-autocomplete.sh usr/share/bash-completion/completions/clang-@LLVM_VERSION@
diff --git a/clang-X.Y.lintian-overrides.in b/clang-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..a389e01
--- /dev/null
@@ -0,0 +1,2 @@
+# Does not link otherwise
+clang-@LLVM_VERSION@: embedded-library usr/lib/llvm-@LLVM_VERSION@/bin/clang: libjsoncpp
diff --git a/clang-X.Y.manpages.in b/clang-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..b19400a
--- /dev/null
@@ -0,0 +1 @@
+clang/docs/_build/man/clang-@LLVM_VERSION@.1
diff --git a/clang-format-X.Y.install.in b/clang-format-X.Y.install.in
new file mode 100644 (file)
index 0000000..d3a18a5
--- /dev/null
@@ -0,0 +1,10 @@
+clang/tools/clang-format/clang-format-@LLVM_VERSION@.py usr/share/vim/addons/syntax/
+clang/tools/clang-format/clang-format-diff-@LLVM_VERSION@ /usr/bin/
+usr/bin/clang-format-@LLVM_VERSION@
+usr/bin/git-clang-format-@LLVM_VERSION@
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-format
+usr/lib/llvm-@LLVM_VERSION@/bin/git-clang-format
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-format-diff.py usr/share/clang/clang-format-@LLVM_VERSION@/
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-format.py usr/share/clang/clang-format-@LLVM_VERSION@/
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-format.el usr/share/emacs/site-lisp/clang-format-@LLVM_VERSION@/
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-format-sublime.py usr/share/clang/clang-format-@LLVM_VERSION@/
diff --git a/clang-format-X.Y.lintian-overrides.in b/clang-format-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..aa78679
--- /dev/null
@@ -0,0 +1,4 @@
+# I know but well...
+clang-format-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/clang-format-diff-@LLVM_VERSION@.1.gz
+clang-format-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/clang-format-@LLVM_VERSION@.1.gz
+
diff --git a/clang-format-X.Y.manpages.in b/clang-format-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..db4dd8f
--- /dev/null
@@ -0,0 +1,3 @@
+debian/man/clang-format-diff-@LLVM_VERSION@.1
+debian/man/clang-format-@LLVM_VERSION@.1
+
diff --git a/clang-tidy-X.Y.install.in b/clang-tidy-X.Y.install.in
new file mode 100644 (file)
index 0000000..ef992c5
--- /dev/null
@@ -0,0 +1,5 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-tidy
+usr/lib/llvm-@LLVM_VERSION@/share/clang/run-clang-tidy.py
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-tidy-diff.py
+
+usr/bin/clang-tidy-@LLVM_VERSION@
diff --git a/clang-tidy-X.Y.links.in b/clang-tidy-X.Y.links.in
new file mode 100644 (file)
index 0000000..ad03ae1
--- /dev/null
@@ -0,0 +1,4 @@
+usr/lib/llvm-@LLVM_VERSION@/share/clang/run-clang-tidy.py usr/bin/run-clang-tidy-@LLVM_VERSION@.py
+usr/lib/llvm-@LLVM_VERSION@/share/clang/run-clang-tidy.py usr/bin/run-clang-tidy-@LLVM_VERSION@
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-tidy-diff.py usr/bin/clang-tidy-diff-@LLVM_VERSION@.py
+
diff --git a/clang-tidy-X.Y.lintian-overrides.in b/clang-tidy-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..c915da6
--- /dev/null
@@ -0,0 +1,3 @@
+# I know but well...
+clang-tidy-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/clang-tidy-@LLVM_VERSION@.1.gz
+
diff --git a/clang-tidy-X.Y.manpages.in b/clang-tidy-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..fa4a814
--- /dev/null
@@ -0,0 +1 @@
+debian/man/clang-tidy-@LLVM_VERSION@.1
diff --git a/clang-tools-X.Y.install.in b/clang-tools-X.Y.install.in
new file mode 100644 (file)
index 0000000..8bfe1f6
--- /dev/null
@@ -0,0 +1,57 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-check
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-apply-replacements
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-query
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-rename
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-rename.el
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-rename.py
+usr/lib/llvm-@LLVM_VERSION@/bin/scan-view
+usr/lib/llvm-@LLVM_VERSION@/bin/scan-build
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-cl
+usr/lib/llvm-@LLVM_VERSION@/bin/sancov
+usr/lib/llvm-@LLVM_VERSION@/share/scan-view/
+usr/lib/llvm-@LLVM_VERSION@/share/scan-build/
+usr/lib/llvm-@LLVM_VERSION@/share/man/man1/scan-build.1
+usr/lib/llvm-@LLVM_VERSION@/libexec/ccc-analyzer
+usr/lib/llvm-@LLVM_VERSION@/libexec/c++-analyzer
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-offload-bundler
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-reorder-fields
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-change-namespace
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-import-test
+usr/lib/llvm-@LLVM_VERSION@/bin/modularize
+usr/lib/llvm-@LLVM_VERSION@/bin/c-index-test
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-include-fixer
+usr/lib/llvm-@LLVM_VERSION@/bin/find-all-symbols
+usr/lib/llvm-@LLVM_VERSION@/bin/clangd
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-refactor
+usr/lib/llvm-@LLVM_VERSION@/bin/clang-func-mapping
+usr/lib/llvm-@LLVM_VERSION@/bin/diagtool
+usr/lib/llvm-@LLVM_VERSION@/bin/hmaptool
+
+tools/clang/tools/scan-build-@LLVM_VERSION@      usr/share/clang/
+tools/clang/tools/scan-build-py-@LLVM_VERSION@      usr/share/clang/
+tools/clang/tools/scan-view-@LLVM_VERSION@       usr/share/clang/
+
+usr/lib/llvm-@LLVM_VERSION@/share/clang/run-find-all-symbols.py
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-include-fixer.py
+usr/lib/llvm-@LLVM_VERSION@/share/clang/clang-include-fixer.el
+usr/bin/clang-check-@LLVM_VERSION@
+usr/bin/clang-apply-replacements-@LLVM_VERSION@
+usr/bin/clang-query-@LLVM_VERSION@
+usr/bin/clang-rename-@LLVM_VERSION@
+usr/bin/sancov-@LLVM_VERSION@
+usr/bin/clang-cl-@LLVM_VERSION@
+usr/bin/modularize-@LLVM_VERSION@
+usr/bin/scan-build-@LLVM_VERSION@
+usr/bin/scan-view-@LLVM_VERSION@
+usr/bin/c-index-test-@LLVM_VERSION@
+usr/bin/clang-offload-bundler-@LLVM_VERSION@
+usr/bin/clang-reorder-fields-@LLVM_VERSION@
+usr/bin/find-all-symbols-@LLVM_VERSION@
+usr/bin/clang-include-fixer-@LLVM_VERSION@
+usr/bin/clang-change-namespace-@LLVM_VERSION@
+usr/bin/clang-import-test-@LLVM_VERSION@
+usr/bin/clangd-@LLVM_VERSION@
+usr/bin/clang-refactor-@LLVM_VERSION@
+usr/bin/clang-func-mapping-@LLVM_VERSION@
+usr/bin/diagtool-@LLVM_VERSION@
+usr/bin/hmaptool-@LLVM_VERSION@
diff --git a/clang-tools-X.Y.links.in b/clang-tools-X.Y.links.in
new file mode 100644 (file)
index 0000000..985ab16
--- /dev/null
@@ -0,0 +1,3 @@
+usr/share/clang/scan-build-@LLVM_VERSION@/bin/scan-build  usr/bin/scan-build-@LLVM_VERSION@
+usr/share/clang/scan-build-py-@LLVM_VERSION@/bin/scan-build  usr/bin/scan-build-py-@LLVM_VERSION@
+usr/share/clang/scan-view-@LLVM_VERSION@/bin/scan-view    usr/bin/scan-view-@LLVM_VERSION@
diff --git a/clang-tools-X.Y.lintian-overrides.in b/clang-tools-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..eb04eb7
--- /dev/null
@@ -0,0 +1,6 @@
+# I know but well...
+clang-tools-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/clang-check.1.gz
+clang-tools-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/scan-view.1.gz
+clang-tools-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/clang-apply-replacements-@LLVM_VERSION@.1.gz
+clang-tools-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/clang-check-@LLVM_VERSION@.1.gz
+clang-tools-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/scan-view-@LLVM_VERSION@.1.gz
diff --git a/clang-tools-X.Y.manpages.in b/clang-tools-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..5cb7dbd
--- /dev/null
@@ -0,0 +1,11 @@
+clang/tools/scan-build/man/scan-build-@LLVM_VERSION@.1
+debian/man/clang-check-@LLVM_VERSION@.1
+debian/man/clang-rename-@LLVM_VERSION@.1
+debian/man/clang-query-@LLVM_VERSION@.1
+debian/man/clang-apply-replacements-@LLVM_VERSION@.1
+debian/man/sancov-@LLVM_VERSION@.1
+debian/man/scan-view-@LLVM_VERSION@.1
+debian/man/modularize-@LLVM_VERSION@.1
+debian/man/find-all-symbols-@LLVM_VERSION@.1
+debian/man/clang-include-fixer-@LLVM_VERSION@.1
+debian/man/clang-reorder-fields-@LLVM_VERSION@.1
diff --git a/compat b/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
+++ b/compat
@@ -0,0 +1 @@
+9
diff --git a/control b/control
new file mode 100644 (file)
index 0000000..f22d523
--- /dev/null
+++ b/control
@@ -0,0 +1,608 @@
+Source: llvm-toolchain-7
+Section: devel
+Priority: optional
+Rules-Requires-Root: no
+Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
+Uploaders: Sylvestre Ledru <sylvestre@debian.org>
+Build-Depends: debhelper (>= 9.0), cmake, chrpath, texinfo, sharutils,
+    libffi-dev (>= 3.0.9),
+    lsb-release, patchutils, diffstat, xz-utils, python-dev,
+    libedit-dev, libncurses5-dev, swig, python-six, python-sphinx (>= 1.3.6),
+    binutils-dev,
+    libjsoncpp-dev, pkg-config,
+    lcov, procps, help2man, zlib1g-dev,
+    g++-multilib [amd64 i386 kfreebsd-amd64 mips mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32],
+    libjs-mathjax,
+    doxygen, gfortran,
+    ocaml-nox [amd64 arm64 armhf i386 ppc64el s390x],
+    ocaml-findlib [amd64 arm64 armhf i386 ppc64el s390x],
+    libctypes-ocaml-dev [amd64 arm64 armhf i386 ppc64el s390x],
+    dh-ocaml [amd64 arm64 armhf i386 ppc64el s390x],
+Build-Conflicts: oprofile, ocaml, libllvm-3.8-ocaml-dev, libllvm-3.9-ocaml-dev
+Standards-Version: 4.2.1
+Homepage: https://www.llvm.org/
+Vcs-Git: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain.git -b 7
+Vcs-Browser: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/tree/7
+
+# ------------- clang -------------
+
+Package: clang-7
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs},
+ ${dep:devlibs-objc}, libclang-common-7-dev (= ${binary:Version}),
+ libclang1-7 (= ${binary:Version}), libc6-dev, binutils
+Provides: c-compiler, objc-compiler, c++-compiler
+Recommends: llvm-7-dev, python, libomp-7-dev
+Suggests: clang-7-doc
+Description: C, C++ and Objective-C compiler
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+
+Package: clang-tools-7
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, clang-7 (= ${binary:Version}),
+ python
+Description: clang-based tools for C/C++ developments
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This package contains some clang-based tools like scan-build, clangd,
+ clang-cl, etc.
+
+Package: clang-format-7
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, python,
+ libllvm7 (= ${binary:Version})
+Description: Tool to format C/C++/Obj-C code
+ Clang-format is both a library and a stand-alone tool with the goal of
+ automatically reformatting C++ sources files according to configurable
+ style guides. To do so, clang-format uses Clang's Lexer to transform an
+ input file into a token stream and then changes all the whitespace around
+ those tokens. The goal is for clang-format to both serve both as a user
+ tool (ideally with powerful IDE integrations) and part of other
+ refactoring tools, e.g. to do a reformatting of all the lines changed
+ during a renaming.
+ .
+ This package also provides vim and emacs plugins.
+
+Package: clang-tidy-7
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, python,
+ libllvm7 (= ${binary:Version}), libclang-common-7-dev,
+ clang-tools-7, python-yaml
+Replaces: clang-modernize-7, clang-7 (<< 7~svn250696-1)
+Breaks: clang-modernize-7, clang-7 (<< 7~svn250696-1)
+Description: clang-based C++ linter tool
+ Provide an extensible framework for diagnosing and fixing typical programming
+ errors, like style violations, interface misuse, or bugs that can be deduced
+ via static analysis. clang-tidy is modular and provides a convenient interface
+ for writing new checks.
+
+Package: clang-7-doc
+Architecture: all
+Section: doc
+Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-mathjax
+Description: C, C++ and Objective-C compiler - Documentation
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This package contains the documentation.
+
+Package: libclang1-7
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Description: C interface to the Clang library
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This package contains the Clang library.
+ .
+ The C Interface to Clang provides a relatively small API that exposes
+ facilities for parsing source code into an abstract syntax tree (AST),
+ loading already-parsed ASTs, traversing the AST, associating physical source
+ locations with elements within the AST, and other facilities that support
+ Clang-based development tools.
+
+Package: libclang-7-dev
+Architecture: any
+Section: libdevel
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs},
+ ${dep:devlibs-objc}, libclang1-7 (= ${binary:Version}),
+ libclang-common-7-dev (= ${binary:Version})
+Description: Clang library - Development package
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This package contains the Clang headers to develop extensions over
+ libclang1-7.
+
+Package: libclang-common-7-dev
+Architecture: any
+Section: libdevel
+Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm7 (= ${binary:Version})
+Description: Clang library - Common development package
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This package contains the Clang generic headers and some libraries
+ (profiling, etc).
+
+
+Package: libfuzzer-7-dev
+Architecture: linux-any
+Section: libdevel
+Depends: ${shlibs:Depends}, ${misc:Depends}, clang-7 (= ${binary:Version})
+Description: Library for coverage-guided fuzz testing
+ LibFuzzer is a library for in-process, coverage-guided, evolutionary fuzzing
+ of other libraries.
+ .
+ LibFuzzer is similar in concept to American Fuzzy Lop (AFL), but it performs
+ all of its fuzzing inside a single process. This in-process fuzzing can be
+ more restrictive and fragile, but is potentially much faster as there is no
+ overhead for process start-up.
+ .
+ The fuzzer is linked with the library under test, and feeds fuzzed inputs to
+ the library via a specific fuzzing entrypoint (aka 'target function'); the
+ fuzzer then tracks which areas of the code are reached, and generates mutations
+ on the corpus of input data in order to maximize the code coverage. The code
+ coverage information for libFuzzer is provided by LLVM's SanitizerCoverage
+ instrumentation.
+
+
+Package: python-clang-7
+Section: python
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, python
+Replaces: python-clang-3.8, python-clang-3.9, python-clang-x.y
+Breaks: python-clang-3.8, python-clang-3.9
+Conflicts: python-clang-x.y
+Provides: python-clang-x.y
+Description: Clang Python Bindings
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This binding package provides access to the Clang compiler and libraries.
+
+
+Package: clang-7-examples
+Architecture: any
+Section: doc
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Clang examples
+ Clang project is a C, C++, Objective C and Objective C++ front-end
+ based on the LLVM compiler. Its goal is to offer a replacement to the
+ GNU Compiler Collection (GCC).
+ .
+ Clang implements all of the ISO C++ 1998, 11 and 14 standards and also
+ provides most of the support of C++17.
+ .
+ This package contains the Clang examples.
+
+# ------------- LLVM -------------
+
+Package: libllvm7
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Breaks: libllvm3.9v4
+Replaces: libllvm3.9v4
+Description: Modular compiler and toolchain technologies, runtime library
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ This package contains the LLVM runtime library.
+
+Package: llvm-7
+Architecture: any
+Suggests: llvm-7-doc
+Depends: llvm-7-runtime (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Recommends: llvm-7-dev
+Description: Modular compiler and toolchain technologies
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ The strengths of the LLVM infrastructure are its extremely
+ simple design (which makes it easy to understand and use),
+ source-language independence, powerful mid-level optimizer, automated
+ compiler debugging support, extensibility, and its stability and
+ reliability. LLVM is currently being used to host a wide variety of
+ academic research projects and commercial projects. LLVM includes C
+ and C++ front-ends, a front-end for a Forth-like language (Stacker),
+ a young scheme front-end, and Java support is in development. LLVM can
+ generate code for X86, SparcV9, PowerPC or many other architectures.
+
+Package: llvm-7-runtime
+Architecture: any
+Depends: binfmt-support, ${shlibs:Depends}, ${misc:Depends}
+Description: Modular compiler and toolchain technologies, IR interpreter
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ This package provides the minimal required to execute programs in LLVM
+ format.
+
+Package: llvm-7-dev
+Architecture: any
+Depends: ${shlibs:Depends}, libffi-dev (>= 3.0.9), ${misc:Depends},
+ llvm-7 (= ${binary:Version}), libllvm7 (= ${binary:Version}), libtinfo-dev
+Description: Modular compiler and toolchain technologies, libraries and headers
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ This package provides the libraries and headers to develop applications
+ using llvm.
+
+Package: llvm-7-tools
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, python,
+ python-pygments, python-yaml,
+ llvm-7-dev (= ${binary:Version})
+Description: Modular compiler and toolchain technologies, tools
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ This package provides tools for testing.
+
+Package: libllvm-7-ocaml-dev
+Section: ocaml
+Architecture: amd64 arm64 armhf i386 ppc64el s390x
+Suggests: llvm-7-doc
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}, llvm-7-dev (= ${binary:Version})
+Replaces: libllvm-x.y-ocaml-dev
+Conflicts: libllvm-x.y-ocaml-dev
+Provides: ${ocaml:Provides}, libllvm-x.y-ocaml-dev
+Description: Modular compiler and toolchain technologies, OCaml bindings
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ This package provides the OCaml bindings to develop applications using llvm.
+
+Package: llvm-7-doc
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}, libjs-jquery, libjs-underscore
+Description: Modular compiler and toolchain technologies, documentation
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ This package contains all documentation (extensive).
+
+Package: llvm-7-examples
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}, llvm-7-dev (>= ${source:Version}), llvm-7-dev (<< ${source:Version}+c~)
+Description: Modular compiler and toolchain technologies, examples
+ LLVM is a collection of libraries and tools that make it easy to build
+ compilers, optimizers, just-in-time code generators, and many other
+ compiler-related programs.
+ .
+ LLVM uses a single, language-independent virtual instruction set both
+ as an offline code representation (to communicate code between
+ compiler phases and to run-time systems) and as the compiler internal
+ representation (to analyze and transform programs). This persistent
+ code representation allows a common set of sophisticated compiler
+ techniques to be applied at compile-time, link-time, install-time,
+ run-time, or "idle-time" (between program runs).
+ .
+ This package contains examples for using LLVM, both in developing
+ extensions to LLVM and in using it to compile code.
+
+
+# ------------- lld -------------
+
+Package: lld-7
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32
+# ia64 hurd powerpc have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm7 (= ${binary:Version})
+Pre-Depends: ${misc:Pre-Depends}
+Description: LLVM-based linker
+ LLD is a new, high-performance linker. It is built as a set of reusable
+ components which highly leverage existing libraries in the larger LLVM
+ Project.
+
+Package: liblld-7
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32
+# ia64 hurd powerpc have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm7 (= ${binary:Version})
+Pre-Depends: ${misc:Pre-Depends}
+Section: libs
+Description: LLVM-based linker, library
+ LLD is a new, high-performance linker. It is built as a set of reusable
+ components which highly leverage existing libraries in the larger LLVM
+ Project.
+ .
+ This package contains the LLD runtime library.
+
+Package: liblld-7-dev
+Section: libdevel
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32
+# ia64 hurd powerpc have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, lld-7 (= ${binary:Version}),
+ liblld-7 (= ${binary:Version})
+Pre-Depends: ${misc:Pre-Depends}
+Description: LLVM-based linker, header files
+ LLD is a new, high-performance linker. It is built as a set of reusable
+ components which highly leverage existing libraries in the larger LLVM
+ Project.
+ .
+ This package provides the header files to build extension over lld.
+
+
+# ------------- lldb -------------
+
+Package: lldb-7
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k sh4 x32
+# ia64 hurd powerpc powerpcspe ppc64 alpha s390x sparc64 have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm7 (= ${binary:Version}), llvm-7-dev,
+ python-lldb-7
+Pre-Depends: ${misc:Pre-Depends}
+Description: Next generation, high-performance debugger
+ LLDB is a next generation, high-performance debugger. It is built as a set of
+ reusable components which highly leverage existing libraries in the larger LLVM
+ Project, such as the Clang expression parser and LLVM disassembler.
+
+Package: liblldb-7
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k sh4 x32
+# ia64 hurd powerpc powerpcspe ppc64 alpha s390x sparc64 have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm7 (= ${binary:Version})
+Pre-Depends: ${misc:Pre-Depends}
+Section: libs
+Replaces: lldb-7 (<= 7~svn215195-2)
+Breaks: lldb-7 (<< 7~svn215195-2)
+Description: Next generation, high-performance debugger, library
+ LLDB is a next generation, high-performance debugger. It is built as a set of
+ reusable components which highly leverage existing libraries in the larger LLVM
+ Project, such as the Clang expression parser and LLVM disassembler.
+ .
+ This package contains the LLDB runtime library.
+
+Package: python-lldb-7
+Section: python
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k sh4 x32
+# ia64 hurd powerpc powerpcspe ppc64 alpha s390x sparc64 have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, python, python-six
+Conflicts: python-lldb-3.8, python-lldb-3.9, python-lldb-x.y
+Replaces: python-lldb-x.y
+Provides: python-lldb-x.y
+Pre-Depends: ${misc:Pre-Depends}
+Description: Next generation, high-performance debugger, python lib
+ LLDB is a next generation, high-performance debugger. It is built as a set of
+ reusable components which highly leverage existing libraries in the larger LLVM
+ Project, such as the Clang expression parser and LLVM disassembler.
+ .
+ This binding package provides access to lldb.
+
+
+Package: liblldb-7-dev
+Section: libdevel
+Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k sh4 x32
+# ia64 hurd powerpc powerpcspe ppc64 alpha s390x sparc64 have been removed
+Depends: ${shlibs:Depends}, ${misc:Depends}, lldb-7 (= ${binary:Version})
+Replaces: lldb-7-dev (<= 7~svn215195-2)
+Breaks: lldb-7-dev (<< 7~svn215195-2)
+Pre-Depends: ${misc:Pre-Depends}
+Description: Next generation, high-performance debugger, header files
+ LLDB is a next generation, high-performance debugger. It is built as a set of
+ reusable components which highly leverage existing libraries in the larger LLVM
+ Project, such as the Clang expression parser and LLVM disassembler.
+ .
+ This package provides the header files to build extension over lldb.
+
+
+# ------------- openmp -------------
+# 44 because it was the first version in which openmp & libc++ have been
+# managed in llvm-defaults
+
+Package: libomp-7-dev
+Section: libdevel
+Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64
+Depends: libomp5-7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Suggests: libomp-7-doc
+Breaks: libiomp-dev (<< 3.7-1), libomp-dev (<< 44)
+Provides: libomp-x.y-dev
+Conflicts: libomp-x.y-dev
+Replaces: libomp-x.y-dev
+Description: LLVM OpenMP runtime - dev package
+ The runtime is the part of the OpenMP implementation that your code is
+ linked against, and that manages the multiple threads in an OpenMP program
+ while it is executing.
+
+Package: libomp5-7
+Multi-Arch: same
+Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Breaks: libomp5 (<< 44)
+Provides: libomp-x.y
+Conflicts: libomp-x.y
+Replaces: libomp-x.y
+Description: LLVM OpenMP runtime
+ The runtime is the part of the OpenMP implementation that your code is
+ linked against, and that manages the multiple threads in an OpenMP program
+ while it is executing.
+
+Package: libomp-7-doc
+Section: doc
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery
+Replaces: libiomp-x.y-doc
+Breaks: libiomp-x.y-doc
+Description: LLVM OpenMP runtime - Documentation
+ The runtime is the part of the OpenMP implementation that your code is
+ linked against, and that manages the multiple threads in an OpenMP program
+ while it is executing.
+ .
+ This package contains the documentation of this package.
+
+# ------------- libcxx -------------
+
+Package: libc++1-7
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Suggests: clang
+Breaks: libc++1 (<< 44)
+Provides: libc++-x.y
+Conflicts: libc++-x.y
+Replaces: libc++-x.y
+Description: LLVM C++ Standard library
+ libc++ is another implementation of the C++ standard library.
+ .
+ Features and Goals
+ .
+   * Correctness as defined by the C++ standards.
+   * Fast execution.
+   * Minimal memory use.
+   * Fast compile times.
+   * ABI compatibility with gcc's libstdc++ for some low-level features such
+     as exception objects, rtti and memory allocation.
+   * Extensive unit tests.
+
+Package: libc++-7-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: libc++1-7 (= ${binary:Version}), ${misc:Depends}
+Breaks: libc++-dev (<< 44)
+Provides: libc++-x.y-dev
+Conflicts: libc++-x.y-dev
+Replaces: libc++-x.y-dev
+Description: LLVM C++ Standard library (development files)
+ libc++ is another implementation of the C++ standard library
+ .
+ Features and Goals
+ .
+   * Correctness as defined by the C++ standards.
+   * Fast execution.
+   * Minimal memory use.
+   * Fast compile times.
+   * ABI compatibility with gcc's libstdc++ for some low-level features such
+     as exception objects, rtti and memory allocation.
+   * Extensive unit tests.
+
+# ------------- libcxxabi -------------
+
+Package: libc++abi1-7
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Breaks: libc++abi1 (<< 44)
+Provides: libc++abi-x.y
+Conflicts: libc++abi-x.y
+Replaces: libc++abi-x.y
+Description: LLVM low level support for a standard C++ library
+ libc++abi is another implementation of low level support for a standard C++
+ library.
+ .
+ Features and Goals
+ .
+   * Correctness as defined by the C++ standards.
+   * Provide a portable sublayer to ease the porting of libc++
+
+Package: libc++abi-7-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: libc++abi1-7 (= ${binary:Version}), ${misc:Depends}
+Breaks: libc++abi-dev (<= 44)
+Provides: libc++abi-x.y-dev
+Conflicts: libc++abi-x.y-dev
+Replaces: libc++abi-x.y-dev
+Description: LLVM low level support for a standard C++ library (development files)
+ libc++abi is another implementation of low level support for a standard C++
+ library.
+ .
+ Features and Goals
+ .
+   * Correctness as defined by the C++ standards.
+   * Provide a portable sublayer to ease the porting of libc++
diff --git a/copyright b/copyright
new file mode 100644 (file)
index 0000000..dce9d49
--- /dev/null
+++ b/copyright
@@ -0,0 +1,500 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: LLVM/Clang
+Source: https://llvm.org/releases/download.html
+
+Files: *
+Copyright: 2003-2017 University of Illinois at Urbana-Champaign.
+License: U-OF-I-BSD-LIKE
+
+Files: */install-sh
+Copyright: 1994 X Consortium
+License: LLVM
+ This script is licensed under the LLVM license, with the following
+ additional copyrights and restrictions:
+ .
+ Copyright 1991 by the Massachusetts Institute of Technology
+ .
+ Permission to use, copy, modify, distribute, and sell this software and its
+ documentation for any purpose is hereby granted without fee, provided that
+ the above copyright notice appear in all copies and that both that
+ copyright notice and this permission notice appear in supporting
+ documentation, and that the name of M.I.T. not be used in advertising or
+ publicity pertaining to distribution of the software without specific,
+ written prior permission.  M.I.T. makes no representations about the
+ suitability of this software for any purpose.  It is provided "as is"
+ without express or implied warranty.
+ .
+ ==============================================================================
+ LLVM Release License
+ ==============================================================================
+ University of Illinois/NCSA
+ Open Source License
+ .
+ Copyright (c) 2003-2013 University of Illinois at Urbana-Champaign.
+ All rights reserved.
+ .
+ Developed by:
+ .
+     LLVM Team
+ .
+     University of Illinois at Urbana-Champaign
+ .
+     http://llvm.org
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal with
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+ .
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimers.
+ .
+     * Redistributions in binary form must reproduce the above copyright notice,
+       this list of conditions and the following disclaimers in the
+       documentation and/or other materials provided with the distribution.
+ .
+     * Neither the names of the LLVM Team, University of Illinois at
+       Urbana-Champaign, nor the names of its contributors may be used to
+       endorse or promote products derived from this Software without specific
+       prior written permission.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+ SOFTWARE.
+
+Files: clang/lib/Headers/*
+Copyright: 2003-2007 University of Illinois at Urbana-Champaign
+License: Expat
+
+Files: clang/lib/Headers/iso646.h
+Copyright: 2008 Eli Friedman
+License: Expat
+
+Files: clang/lib/Headers/limits.h
+Copyright: 2009 Chris Lattner
+License: Expat
+
+Files: clang/lib/Headers/stdarg.h
+Copyright: 2008 Eli Friedman
+License: Expat
+
+Files: clang/lib/Headers/stdbool.h
+Copyright: 2008 Eli Friedman
+License: Expat
+
+Files: clang/lib/Headers/stddef.h
+Copyright: 2008 Eli Friedman
+License: Expat
+
+Files: clang/lib/Headers/stdint.h
+Copyright: 2009 Chris Lattner
+License: Expat
+
+Files: clang/lib/Headers/tgmath.h
+Copyright: 2009 Howard Hinnant
+License: Expat
+
+Files: compiler-rt/*
+Copyright: 2009-2013 Craig van Vliet
+           2009-2013 Edward O'Callaghan
+           2009-2013 Howard Hinnant
+License: U-OF-I-BSD-LIKE or MIT
+
+Files: compiler-rt/lib/BlocksRuntime/Block.h
+Copyright: 2008-2010 Apple, Inc.
+License: MIT
+
+Files: compiler-rt/lib/BlocksRuntime/Block_private.h
+Copyright: 2008-2010 Apple, Inc.
+License: MIT
+
+Files: compiler-rt/lib/BlocksRuntime/data.c
+Copyright: 2008-2010 Apple, Inc.
+License: MIT
+
+Files: compiler-rt/lib/BlocksRuntime/runtime.c
+Copyright: 2008-2010 Apple, Inc.
+License: MIT
+
+Files: include/llvm/Support/*
+Copyright: 2003-2013 University of Illinois at Urbana-Champaign.
+           Copyright (C) 2004 eXtensible Systems, Inc.
+License: U-OF-I-BSD-LIKE
+
+Files: lib/Support/reg*
+Copyright: 1992, 1993, 1994 Henry Spencer
+           1992, 1993, 1994 The Regents of the University of California
+License: BSD-3-clause
+
+Files: lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
+Copyright: 2001 Alexander Peslyak aka Solar Designer <solar at openwall.com>
+License: solar-public-domain
+ This software was written by Alexander Peslyak in 2001.  No copyright is
+ claimed, and the software is hereby placed in the public domain.
+ In case this attempt to disclaim copyright and place the software in the
+ public domain is deemed null and void, then the software is
+ Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
+ general public under the following terms:
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted.
+ .
+ * There's ABSOLUTELY NO WARRANTY, express or implied.
+
+Files: lib/Target/ARM/*
+Copyright: ARM Limited
+License: ARM
+ ARM Limited
+ .
+ Software Grant License Agreement ("Agreement")
+ .
+ Except for the license granted herein to you, ARM Limited ("ARM") reserves all
+ right, title, and interest in and to the Software (defined below).
+ .
+ Definition
+ .
+ "Software" means the code and documentation as well as any original work of
+ authorship, including any modifications or additions to an existing work, that
+ is intentionally submitted by ARM to llvm.org (http://llvm.org) ("LLVM") for
+ inclusion in, or documentation of, any of the products owned or managed by LLVM
+ (the "Work"). For the purposes of this definition, "submitted" means any form of
+ electronic, verbal, or written communication sent to LLVM or its
+ representatives, including but not limited to communication on electronic
+ mailing lists, source code control systems, and issue tracking systems that are
+ managed by, or on behalf of, LLVM for the purpose of discussing and improving
+ the Work, but excluding communication that is conspicuously marked otherwise.
+ .
+ 1. Grant of Copyright License. Subject to the terms and conditions of this
+    Agreement, ARM hereby grants to you and to recipients of the Software
+    distributed by LLVM a perpetual, worldwide, non-exclusive, no-charge,
+    royalty-free, irrevocable copyright license to reproduce, prepare derivative
+    works of, publicly display, publicly perform, sublicense, and distribute the
+    Software and such derivative works.
+ .
+ 2. Grant of Patent License. Subject to the terms and conditions of this
+    Agreement, ARM hereby grants you and to recipients of the Software
+    distributed by LLVM a perpetual, worldwide, non-exclusive, no-charge,
+    royalty-free, irrevocable (except as stated in this section) patent license
+    to make, have made, use, offer to sell, sell, import, and otherwise transfer
+    the Work, where such license applies only to those patent claims licensable
+    by ARM that are necessarily infringed by ARM's Software alone or by
+    combination of the Software with the Work to which such Software was
+    submitted. If any entity institutes patent litigation against ARM or any
+    other entity (including a cross-claim or counterclaim in a lawsuit) alleging
+    that ARM's Software, or the Work to which ARM has contributed constitutes
+    direct or contributory patent infringement, then any patent licenses granted
+    to that entity under this Agreement for the Software or Work shall terminate
+    as of the date such litigation is filed.
+ .
+ Unless required by applicable law or agreed to in writing, the software is
+ provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ either express or implied, including, without limitation, any warranties or
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE.
+
+Files: lldb/*
+Copyright: 2010, 2012 Apple Inc.
+License: NCSA
+ University of Illinois/NCSA
+ Open Source License
+ .
+ Copyright (c) 2010 Apple Inc.
+ All rights reserved.
+ .
+ Developed by:
+ .
+     LLDB Team
+ .
+     http://lldb.llvm.org/
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal with
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+ .
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimers.
+ .
+     * Redistributions in binary form must reproduce the above copyright notice,
+       this list of conditions and the following disclaimers in the
+       documentation and/or other materials provided with the distribution.
+ .
+     * Neither the names of the LLDB Team, copyright holders, nor the names of
+       its contributors may be used to endorse or promote products derived from
+       this Software without specific prior written permission.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+ SOFTWARE.
+
+Files: lldb/test/pexpect-2.4/*
+Copyright: 2008 Noah Spurrier
+License: Expat
+
+License: Expat
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Files: lldb/test/unittest2/*
+Copyright: 1999-2003 Steve Purcell
+           2003-2010 Python Software Foundation
+License: Python
+ This module is free software, and you may redistribute it and/or modify
+ it under the same terms as Python itself, so long as this copyright message
+ and disclaimer are retained in their original form.
+ .
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+ SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
+ .
+ THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
+ AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+Files: polly/*
+Copyright: 2009-2013 Polly Team
+License: Polly
+ ==============================================================================
+ Polly Release License
+ ==============================================================================
+ University of Illinois/NCSA
+ Open Source License
+ .
+ Copyright (c) 2009-2013 Polly Team
+ All rights reserved.
+ .
+ Developed by:
+ .
+     Polly Team
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal with
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+ .
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimers.
+ .
+     * Redistributions in binary form must reproduce the above copyright notice,
+       this list of conditions and the following disclaimers in the
+       documentation and/or other materials provided with the distribution.
+ .
+     * Neither the names of the Polly Team, copyright holders, nor the names of
+       its contributors may be used to endorse or promote products derived from
+       this Software without specific prior written permission.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+ SOFTWARE.
+
+Files: polly/lib/JSON/*
+Copyright: Polly Team
+License: public-domain
+ **FIXME**
+ polly/lib/JSON/LICENSE.txt claims that these files are in the public domain, but
+ the machine-readable copyright spec requires additional clarification.
+
+Files: polly/tools/GPURuntime/*
+Copyright: Polly Team
+License: U-OF-I-BSD-LIKE or MIT
+
+Files: test/YAMLParser/*
+Copyright: 2006 Kirill Simonov
+License: MIT
+
+Files: lldb/tools/debugserver/source/MacOSX/stack_logging.h
+Copyright: 1999-2007 Apple Inc.
+License: Apple
+ This file contains Original Code and/or Modifications of Original Code
+ as defined in and that are subject to the Apple Public Source License
+ Version 2.0 (the 'License'). You may not use this file except in
+ compliance with the License. Please obtain a copy of the License at
+ http://www.opensource.apple.com/apsl/ and read it before using this
+ file.
+ .
+ The Original Code and all software distributed under the License are
+ distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ Please see the License for the specific language governing rights and
+ limitations under the License.
+
+Files: utils/unittest/googletest/*
+Copyright: 2006-2008, Google Inc.
+License: BSD-3-Clause
+
+Files: libcxx/*
+License: BSD-3-Clause
+ This software is provided 'as-is', without any express or implied
+ warranty.  In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+    claim that you wrote the original software. If you use this software
+    in a product, an acknowledgment in the product documentation would be
+    appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+    misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+Files: libcxx*/*
+Copyright: 2009-2012 by the contributors listed below
+ N: Howard Hinnant
+ E: hhinnant@apple.com
+ D: Architect and primary author of libc++
+ .
+ N: Marshall Clow
+ E: marshall@idio.com
+ E: mclow@qualcomm.com
+ D: Minor patches and bug fixes.
+ .
+ N: Bjorn Reese
+ E: breese@users.sourceforge.net
+ D: Initial regex prototype
+ .
+ N: David Chisnall
+ E: theraven at theravensnest dot org
+ D: FreeBSD and Solaris ports, libcxxrt support, some atomics work.
+ .
+ N: Ruben Van Boxem
+ E: vanboxem dot ruben at gmail dot com
+ D: Initial Windows patches.
+ .
+ N: Arvid Picciani
+ E: aep at exys dot org
+ D: Minor patches and musl port.
+ .
+ N: Craig Silverstein
+ E: csilvers@google.com
+ D: Implemented Cityhash as the string hash function on 64-bit machines
+ .
+ N: Google Inc.
+ D: Copyright owner and contributor of the CityHash algorithm
+ .
+ N: Jeffrey Yasskin
+ E: jyasskin@gmail.com
+ E: jyasskin@google.com
+ D: Linux fixes.
+ .
+ N: Jonathan Sauer
+ D: Minor patches, mostly related to constexpr
+ .
+ N: Richard Smith
+ D: Minor patches.
+ .
+ The list is sorted by surname and formatted to allow easy grepping and
+ beautification by scripts.  The fields are: name (N), email (E), web-address
+ (W), PGP key ID and fingerprint (P), description (D), and snail-mail address
+ (S).
+ .
+License: NCSA or MIT
+
+Files: openmp/*
+Copyright: 1997-2015 Intel Corporation
+License: U-OF-I-BSD-LIKE
+
+License: U-OF-I-BSD-LIKE
+ ==============================================================================
+ LLVM Release License
+ ==============================================================================
+ University of Illinois/NCSA
+ Open Source License
+ .
+ Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign.
+ All rights reserved.
+ .
+ Developed by:
+ .
+     LLVM Team
+ .
+     University of Illinois at Urbana-Champaign
+ .
+     http://llvm.org
+ .
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal with
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+ .
+     * Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimers.
+ .
+     * Redistributions in binary form must reproduce the above copyright notice,
+       this list of conditions and the following disclaimers in the
+       documentation and/or other materials provided with the distribution.
+ .
+     * Neither the names of the LLVM Team, University of Illinois at
+       Urbana-Champaign, nor the names of its contributors may be used to
+       endorse or promote products derived from this Software without specific
+       prior written permission.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+ SOFTWARE.
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/debian_path.h b/debian_path.h
new file mode 100644 (file)
index 0000000..539636f
--- /dev/null
@@ -0,0 +1,16 @@
+//===----------------------------------------------------------------------===//
+//
+// Debian paths declaration management
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef DEBIAN_PATH_H
+#define DEBIAN_PATH_H
+
+// Provides the debian revision
+#define DEB_PATCHSETVERSION  "@DEB_PATCHSETVERSION@"
+
+#endif
diff --git a/libc++-X.Y-dev.install.in b/libc++-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..d14e68c
--- /dev/null
@@ -0,0 +1,5 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++.so
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++.a
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++fs.a
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++experimental.a
+usr/lib/llvm-@LLVM_VERSION@/include/c++/ 
diff --git a/libc++-X.Y-dev.links.in b/libc++-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..73efe8f
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++.so /usr/lib/x86_64-linux-gnu/libc++.so
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++.a /usr/lib/x86_64-linux-gnu/libc++.a
diff --git a/libc++-X.Y-dev.lintian-overrides.in b/libc++-X.Y-dev.lintian-overrides.in
new file mode 100644 (file)
index 0000000..f3a3487
--- /dev/null
@@ -0,0 +1,3 @@
+libc++-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libc++.a
+libc++-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libc++fs.a
+libc++-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libc++experimental.a
diff --git a/libc++1-X.Y.install.in b/libc++1-X.Y.install.in
new file mode 100644 (file)
index 0000000..78e2cd3
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++.so.*
diff --git a/libc++1-X.Y.links.in b/libc++1-X.Y.links.in
new file mode 100644 (file)
index 0000000..4d1955c
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++.so.1.0 /usr/lib/@DEB_HOST_MULTIARCH@/libc++.so.1.0
+/usr/lib/@DEB_HOST_MULTIARCH@/libc++.so.1.0    /usr/lib/@DEB_HOST_MULTIARCH@/libc++.so.1
diff --git a/libc++1-X.Y.lintian-overrides.in b/libc++1-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..d8d46f9
--- /dev/null
@@ -0,0 +1 @@
+libc++1-@LLVM_VERSION@: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libc++.so.1.0
diff --git a/libc++abi-X.Y-dev.install.in b/libc++abi-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..8774c6a
--- /dev/null
@@ -0,0 +1,3 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi*so
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi.a
+libcxxabi/include/* usr/lib/llvm-@LLVM_VERSION@/include/
diff --git a/libc++abi-X.Y-dev.links.in b/libc++abi-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..6dd5f55
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi.so  /usr/lib/@DEB_HOST_MULTIARCH@/libc++abi.so
diff --git a/libc++abi-X.Y-dev.lintian-overrides.in b/libc++abi-X.Y-dev.lintian-overrides.in
new file mode 100644 (file)
index 0000000..e0aa6ed
--- /dev/null
@@ -0,0 +1 @@
+libc++abi-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi.a
diff --git a/libc++abi1-X.Y.install.in b/libc++abi1-X.Y.install.in
new file mode 100644 (file)
index 0000000..6e27733
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi.so.*
diff --git a/libc++abi1-X.Y.links.in b/libc++abi1-X.Y.links.in
new file mode 100644 (file)
index 0000000..a57ef06
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi.so.1.0  /usr/lib/@DEB_HOST_MULTIARCH@/libc++abi.so.1.0
+/usr/lib/@DEB_HOST_MULTIARCH@/libc++abi.so.1.0 /usr/lib/@DEB_HOST_MULTIARCH@/libc++abi.so.1
diff --git a/libc++abi1-X.Y.lintian-overrides.in b/libc++abi1-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..f51d4b1
--- /dev/null
@@ -0,0 +1 @@
+libc++abi1-@LLVM_VERSION@: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libc++abi.so.1.0
diff --git a/libclang-X.Y-dev.install.in b/libclang-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..79d9db7
--- /dev/null
@@ -0,0 +1,10 @@
+usr/lib/llvm-@LLVM_VERSION@/include/clang
+usr/lib/llvm-@LLVM_VERSION@/include/clang-c
+usr/lib/llvm-@LLVM_VERSION@/lib/libclang*a
+usr/lib/llvm-@LLVM_VERSION@/lib/libclang*so
+usr/lib/llvm-@LLVM_VERSION@/lib/libfindAllSymbols.a
+
+#usr/include/clang                  /usr/include/
+#usr/include/clang-c                /usr/include/
+#usr/lib/libclang.so                /usr/lib/
+#usr/lib/libclang*a                 /usr/lib/
diff --git a/libclang-X.Y-dev.links.in b/libclang-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..6f99d5b
--- /dev/null
@@ -0,0 +1,3 @@
+usr/lib/@DEB_HOST_MULTIARCH@/libclang-@LLVM_VERSION@.so.1 usr/lib/@DEB_HOST_MULTIARCH@/libclang-@LLVM_VERSION@.so
+usr/lib/@DEB_HOST_MULTIARCH@/libclang-@LLVM_VERSION@.so.1 usr/lib/llvm-@LLVM_VERSION@/lib/libclang.so
+usr/lib/@DEB_HOST_MULTIARCH@/libclang-@LLVM_VERSION@.so.1 usr/lib/llvm-@LLVM_VERSION@/lib/libclang-@LLVM_VERSION@.so
diff --git a/libclang-common-X.Y-dev.install.in b/libclang-common-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..3d6dd35
--- /dev/null
@@ -0,0 +1,14 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/include
+
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/lib
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/*.txt
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/share/*.txt
+
+#usr/lib/clang/@LLVM_VERSION_FULL@/lib             /usr/lib/clang/@LLVM_VERSION@/
+#usr/lib/clang/@LLVM_VERSION_FULL@/include/         /usr/include/clang/@LLVM_VERSION@/
+
+usr/lib/llvm-@LLVM_VERSION@/bin/yaml-bench
+
+usr/bin/yaml-bench-@LLVM_VERSION@
+
+
diff --git a/libclang-common-X.Y-dev.links.in b/libclang-common-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..717c6b2
--- /dev/null
@@ -0,0 +1,7 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/include usr/include/clang/@LLVM_VERSION@/include
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/include usr/lib/clang/@LLVM_VERSION@/include
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/lib usr/lib/clang/@LLVM_VERSION@/lib
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/include usr/include/clang/@LLVM_VERSION_FULL@/include
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/include usr/lib/clang/@LLVM_VERSION_FULL@/include
+usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION_FULL@/lib usr/lib/clang/@LLVM_VERSION_FULL@/lib
+
diff --git a/libclang1-X.Y.install.in b/libclang1-X.Y.install.in
new file mode 100644 (file)
index 0000000..d44e84f
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libclang-@LLVM_VERSION@.so.1 /usr/lib/@DEB_HOST_MULTIARCH@/
+usr/lib/llvm-@LLVM_VERSION@/lib/libclang.so.1
diff --git a/libclang1-X.Y.links.in b/libclang1-X.Y.links.in
new file mode 100644 (file)
index 0000000..3ea44c8
--- /dev/null
@@ -0,0 +1,3 @@
+# as upstream
+usr/lib/@DEB_HOST_MULTIARCH@/libclang-@LLVM_VERSION@.so.1 usr/lib/llvm-@LLVM_VERSION@/lib/libclang-@LLVM_VERSION@.so.1
+usr/lib/llvm-@LLVM_VERSION@/lib/libclang-@LLVM_VERSION@.so.1 usr/lib/llvm-@LLVM_VERSION@/lib/libclang.so.1
diff --git a/libclang1-X.Y.lintian-overrides.in b/libclang1-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..9fc47a7
--- /dev/null
@@ -0,0 +1,5 @@
+# I know and I am not planning to change that yet.
+libclang1-@LLVM_VERSION@: package-name-doesnt-match-sonames libclang1-@LLVM_VERSION@-1
+# Provided as transition
+libclang1-@LLVM_VERSION@: dev-pkg-without-shlib-symlink usr/lib/*/libclang-@LLVM_VERSION@.so.1 usr/lib/*/libclang.so
+libclang1-@LLVM_VERSION@: ldconfig-symlink-missing-for-shlib usr/lib/*/libclang-LLVM_VERSION@.so usr/lib/*/libclang-LLVM_VERSION@.so.1 libclang-LLVM_VERSION@.so
diff --git a/libclang1-X.Y.symbols.in b/libclang1-X.Y.symbols.in
new file mode 100644 (file)
index 0000000..47e86b0
--- /dev/null
@@ -0,0 +1,372 @@
+libclang-@LLVM_VERSION@.so.1 libclang1-@LLVM_VERSION@ #MINVER#
+ (optional)LLVM_@LLVM_VERSION@@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_BlockCommandComment_getArgText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_BlockCommandComment_getCommandName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_BlockCommandComment_getNumArgs@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_BlockCommandComment_getParagraph@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXCursorSet_contains@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXCursorSet_insert@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXIndex_getGlobalOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXIndex_setGlobalOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXIndex_setInvocationEmissionPathOption@LLVM_@LLVM_VERSION@ 1:6.0~svn320926-1~
+ clang_CXXConstructor_isConvertingConstructor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXConstructor_isCopyConstructor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXConstructor_isDefaultConstructor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXConstructor_isMoveConstructor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXField_isMutable@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXMethod_isConst@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXMethod_isDefaulted@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXMethod_isPureVirtual@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXMethod_isStatic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXMethod_isVirtual@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CXXRecord_isAbstract@LLVM_@LLVM_VERSION@ 1:6.0~svn320926-1~
+ clang_Comment_getChild@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Comment_getKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Comment_getNumChildren@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Comment_isWhitespace@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompilationDatabase_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompilationDatabase_fromDirectory@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompilationDatabase_getAllCompileCommands@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompilationDatabase_getCompileCommands@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommand_getArg@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommand_getDirectory@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommand_getFilename@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommand_getMappedSourceContent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommand_getMappedSourcePath@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommand_getNumArgs@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommands_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommands_getCommand@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_CompileCommands_getSize@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_Evaluate@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getArgument@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getBriefCommentText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getCXXManglings@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getCommentRange@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getMangling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getModule@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getNumArguments@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getNumTemplateArguments@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getObjCDeclQualifiers@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getObjCManglings@LLVM_@LLVM_VERSION@ 1:6.0~svn320926-1~
+ clang_Cursor_getObjCPropertyAttributes@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getObjCSelectorIndex@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getOffsetOfField@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getParsedComment@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getRawCommentText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getReceiverType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getSpellingNameRange@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getStorageClass@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getTemplateArgumentKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getTemplateArgumentType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getTemplateArgumentUnsignedValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getTemplateArgumentValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_getTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_hasAttrs@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isAnonymous@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isBitField@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isDynamicCall@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isExternalSymbol@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_Cursor_isFunctionInlined@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isMacroBuiltin@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isMacroFunctionLike@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isNull@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isObjCOptional@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Cursor_isVariadic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_EnumDecl_isScoped@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_EvalResult_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_EvalResult_getAsDouble@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_EvalResult_getAsInt@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_EvalResult_getAsLongLong@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_EvalResult_getAsStr@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_EvalResult_getAsUnsigned@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_EvalResult_getKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_EvalResult_isUnsignedInt@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_File_isEqual@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_File_tryGetRealPathName@LLVM_@LLVM_VERSION@ 1:7~svn329516-1~
+ clang_FullComment_getAsHTML@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_FullComment_getAsXML@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_HTMLStartTagComment_isSelfClosing@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_HTMLStartTag_getAttrName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_HTMLStartTag_getAttrValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_HTMLStartTag_getNumAttrs@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_HTMLTagComment_getAsString@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_HTMLTagComment_getTagName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_IndexAction_create@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_IndexAction_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_InlineCommandComment_getArgText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_InlineCommandComment_getCommandName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_InlineCommandComment_getNumArgs@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_InlineCommandComment_getRenderKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_InlineContentComment_hasTrailingNewline@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Location_isFromMainFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Location_isInSystemHeader@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ModuleMapDescriptor_create@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ModuleMapDescriptor_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ModuleMapDescriptor_setFrameworkModuleName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ModuleMapDescriptor_setUmbrellaHeader@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ModuleMapDescriptor_writeToBuffer@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_getASTFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_getFullName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_getName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_getNumTopLevelHeaders@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_getParent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_getTopLevelHeader@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Module_isSystem@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ParamCommandComment_getDirection@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ParamCommandComment_getParamIndex@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ParamCommandComment_getParamName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ParamCommandComment_isDirectionExplicit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_ParamCommandComment_isParamIndexValid@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_PrintingPolicy_dispose@LLVM_@LLVM_VERSION@ 1:7~svn324835-1~
+ clang_PrintingPolicy_getProperty@LLVM_@LLVM_VERSION@ 1:7~svn324835-1~
+ clang_PrintingPolicy_setProperty@LLVM_@LLVM_VERSION@ 1:7~svn324835-1~
+ clang_Range_isNull@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_TParamCommandComment_getDepth@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_TParamCommandComment_getIndex@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_TParamCommandComment_getParamName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_TParamCommandComment_isParamPositionValid@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_TargetInfo_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_TargetInfo_getPointerWidth@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_TargetInfo_getTriple@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_TextComment_getText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getAlignOf@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getCXXRefQualifier@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getClassType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getNamedType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getNumTemplateArguments@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getObjCEncoding@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getOffsetOf@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getSizeOf@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_getTemplateArgumentAsType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_Type_isTransparentTagTypedef@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_Type_visitFields@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VerbatimBlockLineComment_getText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VerbatimLineComment_getText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VirtualFileOverlay_addFileMapping@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VirtualFileOverlay_create@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VirtualFileOverlay_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VirtualFileOverlay_setCaseSensitivity@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_VirtualFileOverlay_writeToBuffer@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_annotateTokens@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteAt@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteGetContainerKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteGetContainerUSR@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteGetContexts@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteGetDiagnostic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteGetNumDiagnostics@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_codeCompleteGetObjCSelector@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_constructUSR_ObjCCategory@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_constructUSR_ObjCClass@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_constructUSR_ObjCIvar@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_constructUSR_ObjCMethod@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_constructUSR_ObjCProperty@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_constructUSR_ObjCProtocol@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_createCXCursorSet@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_createIndex@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_createTranslationUnit2@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_createTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_createTranslationUnitFromSourceFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_defaultCodeCompleteOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_defaultDiagnosticDisplayOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_defaultEditingTranslationUnitOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_defaultReparseOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_defaultSaveOptions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeCXCursorSet@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeCXPlatformAvailability@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeCXTUResourceUsage@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeCodeCompleteResults@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeDiagnostic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeDiagnosticSet@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeIndex@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeOverriddenCursors@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeSourceRangeList@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeString@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeStringSet@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeTokens@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_disposeTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_enableStackTraces@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_equalCursors@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_equalLocations@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_equalRanges@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_equalTypes@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_executeOnThread@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_findIncludesInFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_findIncludesInFileWithBlock@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_findReferencesInFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_findReferencesInFileWithBlock@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_formatDiagnostic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_free@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getAddressSpace@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_getAllSkippedRanges@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_getArgType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getArrayElementType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getArraySize@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getBuildSessionTimestamp@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCString@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCXTUResourceUsage@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCXXAccessSpecifier@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCanonicalCursor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCanonicalType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getChildDiagnostics@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getClangVersion@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionAnnotation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionAvailability@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionBriefComment@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionChunkCompletionString@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionChunkKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionChunkText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionFixIt@LLVM_7 1:7~svn334604-1~
+ clang_getCompletionNumAnnotations@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionNumFixIts@LLVM_7 1:7~svn334604-1~exp1+0~
+ clang_getCompletionParent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCompletionPriority@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorAvailability@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorCompletionString@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorDefinition@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorDisplayName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorExceptionSpecificationType@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_getCursorExtent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorKindSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorLanguage@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorLexicalParent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorLinkage@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorPlatformAvailability@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorPrettyPrinted@LLVM_@LLVM_VERSION@ 1:7~svn324835-1~
+ clang_getCursorPrintingPolicy@LLVM_@LLVM_VERSION@ 1:7~svn324835-1~
+ clang_getCursorReferenceNameRange@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorReferenced@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorResultType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorSemanticParent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorTLSKind@LLVM_@LLVM_VERSION@ 1:6.0~svn320926-1~
+ clang_getCursorType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorUSR@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getCursorVisibility@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDeclObjCTypeEncoding@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDefinitionSpellingAndExtent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnostic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticCategory@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticCategoryName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticCategoryText@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticFixIt@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticInSet@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticNumFixIts@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticNumRanges@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticOption@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticRange@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticSetFromTU@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticSeverity@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getDiagnosticSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getElementType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getEnumConstantDeclUnsignedValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getEnumConstantDeclValue@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getEnumDeclIntegerType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getExceptionSpecificationType@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_getExpansionLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFieldDeclBitWidth@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFileContents@LLVM_@LLVM_VERSION@ 1:6.0~svn321745-1~
+ clang_getFileLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFileName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFileTime@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFileUniqueID@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getFunctionTypeCallingConv@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getIBOutletCollectionType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getIncludedFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getInclusions@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getInstantiationLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getLocationForOffset@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getModuleForFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNullCursor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNullLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNullRange@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNumArgTypes@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNumCompletionChunks@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNumDiagnostics@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNumDiagnosticsInSet@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNumElements@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getNumOverloadedDecls@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getOverloadedDecl@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getOverriddenCursors@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getPointeeType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getPresumedLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getRange@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getRangeEnd@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getRangeStart@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getRemappings@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getRemappingsFromFileList@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getResultType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getSkippedRanges@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getSpecializedCursorTemplate@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getSpellingLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTUResourceUsageName@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTemplateCursorKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getToken@LLVM_7 1:7~svn334604-1~
+ clang_getTokenExtent@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTokenKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTokenLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTokenSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTranslationUnitCursor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTranslationUnitSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTranslationUnitTargetInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn302377-1~
+ clang_getTypeDeclaration@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTypeKindSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTypeSpelling@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTypedefDeclUnderlyingType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_getTypedefName@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_hashCursor@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_indexLoc_getCXSourceLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_indexLoc_getFileLocation@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_indexSourceFile@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_indexSourceFileFullArgv@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_indexTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getCXXClassDeclInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getClientContainer@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getClientEntity@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getIBOutletCollectionAttrInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getObjCCategoryDeclInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getObjCContainerDeclInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getObjCInterfaceDeclInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getObjCPropertyDeclInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_getObjCProtocolRefListInfo@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_isEntityObjCContainerKind@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_setClientContainer@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_index_setClientEntity@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isAttribute@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isConstQualifiedType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isCursorDefinition@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isDeclaration@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isExpression@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isFileMultipleIncludeGuarded@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isFunctionTypeVariadic@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isInvalid@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isInvalidDeclaration@LLVM_@LLVM_VERSION@ 1:7~svn321385-1~
+ clang_isPODType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isPreprocessing@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isReference@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isRestrictQualifiedType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isStatement@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isUnexposed@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isVirtualBase@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_isVolatileQualifiedType@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_loadDiagnostics@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_parseTranslationUnit2@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_parseTranslationUnit2FullArgv@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_parseTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_remap_dispose@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_remap_getFilenames@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_remap_getNumFiles@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_reparseTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_saveTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_sortCodeCompletionResults@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_suspendTranslationUnit@LLVM_@LLVM_VERSION@ 1:5.0~+rc1~
+ clang_toggleCrashRecovery@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_tokenize@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_visitChildren@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
+ clang_visitChildrenWithBlock@LLVM_@LLVM_VERSION@ 1:5.0~svn298832-1~
diff --git a/liblld-X.Y-dev.install.in b/liblld-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..b1446f0
--- /dev/null
@@ -0,0 +1,2 @@
+/usr/lib/llvm-@LLVM_VERSION@/include/lld
+
diff --git a/liblld-X.Y.install.in b/liblld-X.Y.install.in
new file mode 100644 (file)
index 0000000..3d86306
--- /dev/null
@@ -0,0 +1,11 @@
+#usr/lib/llvm-@LLVM_VERSION@/lib/liblld-@LLVM_VERSION@.so.1 /usr/lib/@DEB_HOST_MULTIARCH@/
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldReaderWriter.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldDriver.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldYAML.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldELF.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldCore.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldMachO.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldCOFF.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldMinGW.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldCommon.a
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldWasm.a
diff --git a/liblld-X.Y.links.in b/liblld-X.Y.links.in
new file mode 100644 (file)
index 0000000..5d16d10
--- /dev/null
@@ -0,0 +1,4 @@
+usr/lib/@DEB_HOST_MULTIARCH@/liblld-@LLVM_VERSION@.so.1       usr/lib/@DEB_HOST_MULTIARCH@/liblld-@LLVM_VERSION@.so
+usr/lib/@DEB_HOST_MULTIARCH@/liblld-@LLVM_VERSION@.so         usr/lib/python2.7/dist-packages/lld-@LLVM_VERSION@/_lld.so
+usr/lib/@DEB_HOST_MULTIARCH@/liblld-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/liblld.so.1
+
diff --git a/liblldb-7.install.kfreebsd b/liblldb-7.install.kfreebsd
new file mode 100644 (file)
index 0000000..8ae5cf7
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/llvm-7/lib/liblldb-7.so.1 /usr/lib/i386-kfreebsd-gnu/
+usr/lib/llvm-7/lib/python2.7/site-packages/readline.so
diff --git a/liblldb-X.Y-dev.install.in b/liblldb-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..d6dd2e1
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/lib/llvm-@LLVM_VERSION@/include/lldb
+/usr/lib/llvm-@LLVM_VERSION@/lib/liblldb*a
+/usr/lib/llvm-@LLVM_VERSION@/lib/liblldb*so
diff --git a/liblldb-X.Y-dev.links.in b/liblldb-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..3c6aef9
--- /dev/null
@@ -0,0 +1,3 @@
+usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/liblldb.so
+usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/liblldb-@LLVM_VERSION@.so
+usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/liblldb-@LLVM_VERSION@.so.1
diff --git a/liblldb-X.Y.install.in b/liblldb-X.Y.install.in
new file mode 100644 (file)
index 0000000..73f1b98
--- /dev/null
@@ -0,0 +1,4 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldb-@LLVM_VERSION@.so.1 /usr/lib/@DEB_HOST_MULTIARCH@/
+usr/lib/llvm-@LLVM_VERSION@/lib/python2.7/site-packages/readline.so
+
+usr/lib/llvm-@LLVM_VERSION@/lib/liblldbIntelFeatures.so.*
diff --git a/liblldb-X.Y.links.in b/liblldb-X.Y.links.in
new file mode 100644 (file)
index 0000000..ae73a19
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so.1       usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so
+usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/liblldb.so.1
diff --git a/liblldb-X.Y.lintian-overrides.in b/liblldb-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..180aec3
--- /dev/null
@@ -0,0 +1,5 @@
+# That is normal. The lib is not (yet?) shipped as a new package
+liblldb-@LLVM_VERSION@: package-name-doesnt-match-sonames liblldb-@LLVM_VERSION@-1
+# For now, override this warning. We might create a -dev at some point
+liblldb-@LLVM_VERSION@: non-dev-pkg-with-shlib-symlink usr/lib/*/liblldb.so.1 usr/lib/*/liblldb.so
+liblldb-@LLVM_VERSION@: non-dev-pkg-with-shlib-symlink usr/lib/*/liblldb-@LLVM_VERSION@.so.1 usr/lib/*/liblldb-@LLVM_VERSION@.so
diff --git a/libllvm-X.Y-ocaml-dev.META.in b/libllvm-X.Y-ocaml-dev.META.in
new file mode 100644 (file)
index 0000000..366820d
--- /dev/null
@@ -0,0 +1,63 @@
+description = "Low Level Virtual Machine bindings"
+version = "@LLVM_VERSION@"
+
+directory = "+llvm-@LLVM_VERSION@"
+
+archive(byte)   = "llvm.cma"
+archive(native) = "llvm.cmxa"
+linkopts = "-cclib -lstdc++ -cclib -lllvm"
+
+package "executionengine"
+(
+  requires = "llvm-@LLVM_VERSION@"
+  version = "@LLVM_VERSION@"
+  archive(native) = "llvm_executionengine.cmxa"
+  archive(byte)   = "llvm_executionengine.cma"
+  linkopts = "-cclib -lllvm_executionengine"
+)
+
+package "target"
+(
+  requires = "llvm-@LLVM_VERSION@"
+  version = "@LLVM_VERSION@"
+  archive(native) = "llvm_target.cmxa"
+  archive(byte)   = "llvm_target.cma"
+  linkopts = "-cclib -lllvm_target"
+)
+
+package "scalar_opts"
+(
+  requires = "llvm-@LLVM_VERSION@ llvm-@LLVM_VERSION@.target"
+  version = "@LLVM_VERSION@"
+  archive(native) = "llvm_scalar_opts.cmxa"
+  archive(byte)   = "llvm_scalar_opts.cma"
+  linkopts = "-cclib -lllvm_scalar_opts"
+)
+
+package "analysis"
+(
+  requires = "llvm-@LLVM_VERSION@"
+  version = "@LLVM_VERSION@"
+  archive(native) = "llvm_analysis.cmxa"
+  archive(byte)   = "llvm_analysis.cma"
+  linkopts = "-cclib -lllvm_analysis"
+)
+
+package "bitwriter"
+(
+  requires = "llvm-@LLVM_VERSION@"
+  version = "@LLVM_VERSION@"
+  archive(native) = "llvm_bitwriter.cmxa"
+  archive(byte)   = "llvm_bitwriter.cma"
+  linkopts = "-cclib -lllvm_bitwriter"
+)
+
+package "bitreader"
+(
+  requires = "llvm-@LLVM_VERSION@ llvm-@LLVM_VERSION@.bitwriter"
+  version = "@LLVM_VERSION@"
+  archive(native) = "llvm_bitreader.cmxa"
+  archive(byte)   = "llvm_bitreader.cma"
+  linkopts = "-cclib -lllvm_bitreader"
+)
+
diff --git a/libllvm-X.Y-ocaml-dev.dirs.in b/libllvm-X.Y-ocaml-dev.dirs.in
new file mode 100644 (file)
index 0000000..6c9c736
--- /dev/null
@@ -0,0 +1,2 @@
+@OCAML_STDLIB_DIR@/META/
+
diff --git a/libllvm-X.Y-ocaml-dev.install.in b/libllvm-X.Y-ocaml-dev.install.in
new file mode 100644 (file)
index 0000000..4c68fb7
--- /dev/null
@@ -0,0 +1,2 @@
+@OCAML_STDLIB_DIR@
+usr/lib/llvm-@LLVM_VERSION@/share/doc/llvm/ocaml-html/ usr/share/doc/libllvm-@LLVM_VERSION@-ocaml-dev/
diff --git a/libllvm-X.Y-ocaml-dev.lintian-overrides.in b/libllvm-X.Y-ocaml-dev.lintian-overrides.in
new file mode 100644 (file)
index 0000000..5d25d44
--- /dev/null
@@ -0,0 +1,2 @@
+# It is in the section ocaml which is fine.
+libllvm-@LLVM_VERSION@-ocaml-dev: wrong-section-according-to-package-name libllvm-@LLVM_VERSION@-ocaml-dev => libdevel
diff --git a/libllvmX.Y.install.in b/libllvmX.Y.install.in
new file mode 100644 (file)
index 0000000..f8d968f
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@.so.1 /usr/lib/@DEB_HOST_MULTIARCH@/
diff --git a/libllvmX.Y.links.in b/libllvmX.Y.links.in
new file mode 100644 (file)
index 0000000..067b088
--- /dev/null
@@ -0,0 +1,4 @@
+# Should be uncommented for @LLVM_VERSION@.1 and other
+# usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@.so.1 /usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1    /usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so
+
diff --git a/libllvmX.Y.lintian-overrides.in b/libllvmX.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..49f7ef2
--- /dev/null
@@ -0,0 +1,2 @@
+# That is normal. Upstream does not match the debian convention
+libllvm@LLVM_VERSION@: package-name-doesnt-match-sonames libLLVM-@LLVM_VERSION@-1
diff --git a/libomp-X.Y-dev.install.in b/libomp-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..cb783d9
--- /dev/null
@@ -0,0 +1,4 @@
+/usr/lib/llvm-@LLVM_VERSION@/include/openmp/omp*.h
+/usr/lib/llvm-@LLVM_VERSION@/lib/libgomp.so
+/usr/lib/llvm-@LLVM_VERSION@/lib/libiomp5.so
+/usr/lib/llvm-@LLVM_VERSION@/lib/libomp*.so
diff --git a/libomp-X.Y-dev.links.in b/libomp-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..8b01da8
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so usr/lib/@DEB_HOST_MULTIARCH@/libomp5.so
+/usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so usr/lib/@DEB_HOST_MULTIARCH@/libiomp5.so
+
diff --git a/libomp-X.Y-doc.docs.in b/libomp-X.Y-doc.docs.in
new file mode 100644 (file)
index 0000000..fbb48ae
--- /dev/null
@@ -0,0 +1 @@
+openmp/runtime/doc/doxygen/generated/html/
diff --git a/libomp-X.Y.links.in b/libomp-X.Y.links.in
new file mode 100644 (file)
index 0000000..6bc3d4c
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so.5 usr/lib/@DEB_HOST_MULTIARCH@/libomp.so.5 
diff --git a/libomp5-X.Y.install.in b/libomp5-X.Y.install.in
new file mode 100644 (file)
index 0000000..858fb3e
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libomp*.so.5
diff --git a/libomp5-X.Y.links.in b/libomp5-X.Y.links.in
new file mode 100644 (file)
index 0000000..cd9227f
--- /dev/null
@@ -0,0 +1,3 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so.5  /usr/lib/@DEB_HOST_MULTIARCH@/libomp.so.5
+
+
diff --git a/libomp5-X.Y.lintian-overrides.in b/libomp5-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..201d42d
--- /dev/null
@@ -0,0 +1 @@
+libomp5-@LLVM_VERSION@: arch-dependent-file-not-in-arch-specific-directory usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so.5
diff --git a/libomp5-X.Y.symbols.in b/libomp5-X.Y.symbols.in
new file mode 100644 (file)
index 0000000..8111d2f
--- /dev/null
@@ -0,0 +1,1130 @@
+libomp.so.5 libomp5 #MINVER#
+ GOMP_1.0@GOMP_1.0 0.20131209
+ GOMP_2.0@GOMP_2.0 0.20131209
+ GOMP_3.0@GOMP_3.0 0.20131209
+ GOMP_4.0@GOMP_4.0 0.20131209
+ GOMP_4.5@GOMP_4.5 7
+ GOMP_atomic_end@GOMP_1.0 0.20131209
+ GOMP_atomic_end@VERSION 0.20130412
+ GOMP_atomic_start@GOMP_1.0 0.20131209
+ GOMP_atomic_start@VERSION 0.20130412
+ GOMP_barrier@GOMP_1.0 0.20131209
+ GOMP_barrier@VERSION 0.20130412
+ GOMP_barrier_cancel@GOMP_4.0 0.20140926
+ GOMP_barrier_cancel@VERSION 0.20140926
+ GOMP_cancel@GOMP_4.0 0.20140926
+ GOMP_cancel@VERSION 0.20140926
+ GOMP_cancellation_point@GOMP_4.0 0.20140926
+ GOMP_cancellation_point@VERSION 0.20140926
+ GOMP_critical_end@GOMP_1.0 0.20131209
+ GOMP_critical_end@VERSION 0.20130412
+ GOMP_critical_name_end@GOMP_1.0 0.20131209
+ GOMP_critical_name_end@VERSION 0.20130412
+ GOMP_critical_name_start@GOMP_1.0 0.20131209
+ GOMP_critical_name_start@VERSION 0.20130412
+ GOMP_critical_start@GOMP_1.0 0.20131209
+ GOMP_critical_start@VERSION 0.20130412
+ GOMP_doacross_post@GOMP_4.5 7
+ GOMP_doacross_post@VERSION 7
+ GOMP_doacross_ull_post@GOMP_4.5 7
+ GOMP_doacross_ull_post@VERSION 7
+ GOMP_doacross_ull_wait@GOMP_4.5 7
+ GOMP_doacross_ull_wait@VERSION 7
+ GOMP_doacross_wait@GOMP_4.5 7
+ GOMP_doacross_wait@VERSION 7
+ GOMP_loop_doacross_dynamic_start@GOMP_4.5 7
+ GOMP_loop_doacross_dynamic_start@VERSION 7
+ GOMP_loop_doacross_guided_start@GOMP_4.5 7
+ GOMP_loop_doacross_guided_start@VERSION 7
+ GOMP_loop_doacross_runtime_start@GOMP_4.5 7
+ GOMP_loop_doacross_runtime_start@VERSION 7
+ GOMP_loop_doacross_static_start@GOMP_4.5 7
+ GOMP_loop_doacross_static_start@VERSION 7
+ GOMP_loop_dynamic_next@GOMP_1.0 0.20131209
+ GOMP_loop_dynamic_next@VERSION 0.20130412
+ GOMP_loop_dynamic_start@GOMP_1.0 0.20131209
+ GOMP_loop_dynamic_start@VERSION 0.20130412
+ GOMP_loop_end@GOMP_1.0 0.20131209
+ GOMP_loop_end@VERSION 0.20130412
+ GOMP_loop_end_cancel@GOMP_4.0 0.20140926
+ GOMP_loop_end_cancel@VERSION 0.20140926
+ GOMP_loop_end_nowait@GOMP_1.0 0.20131209
+ GOMP_loop_end_nowait@VERSION 0.20130412
+ GOMP_loop_guided_next@GOMP_1.0 0.20131209
+ GOMP_loop_guided_next@VERSION 0.20130412
+ GOMP_loop_guided_start@GOMP_1.0 0.20131209
+ GOMP_loop_guided_start@VERSION 0.20130412
+ GOMP_loop_ordered_dynamic_next@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_dynamic_next@VERSION 0.20130412
+ GOMP_loop_ordered_dynamic_start@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_dynamic_start@VERSION 0.20130412
+ GOMP_loop_ordered_guided_next@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_guided_next@VERSION 0.20130412
+ GOMP_loop_ordered_guided_start@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_guided_start@VERSION 0.20130412
+ GOMP_loop_ordered_runtime_next@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_runtime_next@VERSION 0.20130412
+ GOMP_loop_ordered_runtime_start@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_runtime_start@VERSION 0.20130412
+ GOMP_loop_ordered_static_next@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_static_next@VERSION 0.20130412
+ GOMP_loop_ordered_static_start@GOMP_1.0 0.20131209
+ GOMP_loop_ordered_static_start@VERSION 0.20130412
+ GOMP_loop_runtime_next@GOMP_1.0 0.20131209
+ GOMP_loop_runtime_next@VERSION 0.20130412
+ GOMP_loop_runtime_start@GOMP_1.0 0.20131209
+ GOMP_loop_runtime_start@VERSION 0.20130412
+ GOMP_loop_static_next@GOMP_1.0 0.20131209
+ GOMP_loop_static_next@VERSION 0.20130412
+ GOMP_loop_static_start@GOMP_1.0 0.20131209
+ GOMP_loop_static_start@VERSION 0.20130412
+ GOMP_loop_ull_doacross_dynamic_start@GOMP_4.5 7
+ GOMP_loop_ull_doacross_dynamic_start@VERSION 7
+ GOMP_loop_ull_doacross_guided_start@GOMP_4.5 7
+ GOMP_loop_ull_doacross_guided_start@VERSION 7
+ GOMP_loop_ull_doacross_runtime_start@GOMP_4.5 7
+ GOMP_loop_ull_doacross_runtime_start@VERSION 7
+ GOMP_loop_ull_doacross_static_start@GOMP_4.5 7
+ GOMP_loop_ull_doacross_static_start@VERSION 7
+ GOMP_loop_ull_dynamic_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_dynamic_next@VERSION 0.20130412
+ GOMP_loop_ull_dynamic_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_dynamic_start@VERSION 0.20130412
+ GOMP_loop_ull_guided_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_guided_next@VERSION 0.20130412
+ GOMP_loop_ull_guided_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_guided_start@VERSION 0.20130412
+ GOMP_loop_ull_ordered_dynamic_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_dynamic_next@VERSION 0.20130412
+ GOMP_loop_ull_ordered_dynamic_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_dynamic_start@VERSION 0.20130412
+ GOMP_loop_ull_ordered_guided_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_guided_next@VERSION 0.20130412
+ GOMP_loop_ull_ordered_guided_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_guided_start@VERSION 0.20130412
+ GOMP_loop_ull_ordered_runtime_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_runtime_next@VERSION 0.20130412
+ GOMP_loop_ull_ordered_runtime_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_runtime_start@VERSION 0.20130412
+ GOMP_loop_ull_ordered_static_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_static_next@VERSION 0.20130412
+ GOMP_loop_ull_ordered_static_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_ordered_static_start@VERSION 0.20130412
+ GOMP_loop_ull_runtime_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_runtime_next@VERSION 0.20130412
+ GOMP_loop_ull_runtime_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_runtime_start@VERSION 0.20130412
+ GOMP_loop_ull_static_next@GOMP_2.0 0.20131209
+ GOMP_loop_ull_static_next@VERSION 0.20130412
+ GOMP_loop_ull_static_start@GOMP_2.0 0.20131209
+ GOMP_loop_ull_static_start@VERSION 0.20130412
+ GOMP_ordered_end@GOMP_1.0 0.20131209
+ GOMP_ordered_end@VERSION 0.20130412
+ GOMP_ordered_start@GOMP_1.0 0.20131209
+ GOMP_ordered_start@VERSION 0.20130412
+ GOMP_parallel@GOMP_4.0 0.20140926
+ GOMP_parallel@VERSION 0.20140926
+ GOMP_parallel_end@GOMP_1.0 0.20131209
+ GOMP_parallel_end@VERSION 0.20130412
+ GOMP_parallel_loop_dynamic@GOMP_4.0 0.20140926
+ GOMP_parallel_loop_dynamic@VERSION 0.20140926
+ GOMP_parallel_loop_dynamic_start@GOMP_1.0 0.20131209
+ GOMP_parallel_loop_dynamic_start@VERSION 0.20130412
+ GOMP_parallel_loop_guided@GOMP_4.0 0.20140926
+ GOMP_parallel_loop_guided@VERSION 0.20140926
+ GOMP_parallel_loop_guided_start@GOMP_1.0 0.20131209
+ GOMP_parallel_loop_guided_start@VERSION 0.20130412
+ GOMP_parallel_loop_runtime@GOMP_4.0 0.20140926
+ GOMP_parallel_loop_runtime@VERSION 0.20140926
+ GOMP_parallel_loop_runtime_start@GOMP_1.0 0.20131209
+ GOMP_parallel_loop_runtime_start@VERSION 0.20130412
+ GOMP_parallel_loop_static@GOMP_4.0 0.20140926
+ GOMP_parallel_loop_static@VERSION 0.20140926
+ GOMP_parallel_loop_static_start@GOMP_1.0 0.20131209
+ GOMP_parallel_loop_static_start@VERSION 0.20130412
+ GOMP_parallel_sections@GOMP_4.0 0.20140926
+ GOMP_parallel_sections@VERSION 0.20140926
+ GOMP_parallel_sections_start@GOMP_1.0 0.20131209
+ GOMP_parallel_sections_start@VERSION 0.20130412
+ GOMP_parallel_start@GOMP_1.0 0.20131209
+ GOMP_parallel_start@VERSION 0.20130412
+ GOMP_sections_end@GOMP_1.0 0.20131209
+ GOMP_sections_end@VERSION 0.20130412
+ GOMP_sections_end_cancel@GOMP_4.0 0.20140926
+ GOMP_sections_end_cancel@VERSION 0.20140926
+ GOMP_sections_end_nowait@GOMP_1.0 0.20131209
+ GOMP_sections_end_nowait@VERSION 0.20130412
+ GOMP_sections_next@GOMP_1.0 0.20131209
+ GOMP_sections_next@VERSION 0.20130412
+ GOMP_sections_start@GOMP_1.0 0.20131209
+ GOMP_sections_start@VERSION 0.20130412
+ GOMP_single_copy_end@GOMP_1.0 0.20131209
+ GOMP_single_copy_end@VERSION 0.20130412
+ GOMP_single_copy_start@GOMP_1.0 0.20131209
+ GOMP_single_copy_start@VERSION 0.20130412
+ GOMP_single_start@GOMP_1.0 0.20131209
+ GOMP_single_start@VERSION 0.20130412
+ GOMP_target@GOMP_4.0 0.20140926
+ GOMP_target@VERSION 0.20140926
+ GOMP_target_data@GOMP_4.0 0.20140926
+ GOMP_target_data@VERSION 0.20140926
+ GOMP_target_end_data@GOMP_4.0 0.20140926
+ GOMP_target_end_data@VERSION 0.20140926
+ GOMP_target_update@GOMP_4.0 0.20140926
+ GOMP_target_update@VERSION 0.20140926
+ GOMP_task@GOMP_2.0 0.20131209
+ GOMP_task@VERSION 0.20130412
+ GOMP_taskgroup_end@GOMP_4.0 0.20140926
+ GOMP_taskgroup_end@VERSION 0.20140926
+ GOMP_taskgroup_start@GOMP_4.0 0.20140926
+ GOMP_taskgroup_start@VERSION 0.20140926
+ GOMP_taskloop@GOMP_4.5 7
+ GOMP_taskloop@VERSION 7
+ GOMP_taskloop_ull@GOMP_4.5 7
+ GOMP_taskloop_ull@VERSION 7
+ GOMP_taskwait@GOMP_2.0 0.20131209
+ GOMP_taskwait@VERSION 0.20130412
+ GOMP_taskyield@GOMP_3.0 0.20131209
+ GOMP_taskyield@VERSION 0.20131209
+ GOMP_teams@GOMP_4.0 0.20140926
+ GOMP_teams@VERSION 0.20140926
+ OMP_1.0@OMP_1.0 0.20131209
+ OMP_2.0@OMP_2.0 0.20131209
+ OMP_3.0@OMP_3.0 0.20131209
+ OMP_3.1@OMP_3.1 0.20131209
+ OMP_4.0@OMP_4.0 0.20131209
+ OMP_4.5@OMP_4.5 7
+ VERSION@VERSION 0.20130412
+ _You_must_link_with_Intel_OpenMP_library@VERSION 0.20130412
+ _You_must_link_with_exactly_one_OpenMP_library@VERSION 0.20130412
+ ___kmp_allocate@VERSION 0.20130412
+ ___kmp_free@VERSION 0.20130412
+ __kmp_acquire_drdpa_lock@VERSION 0.20130715
+ __kmp_acquire_nested_drdpa_lock@VERSION 0.20130715
+ __kmp_acquire_nested_queuing_lock@VERSION 0.20130715
+ __kmp_acquire_nested_tas_lock@VERSION 0.20130715
+ __kmp_acquire_nested_ticket_lock@VERSION 0.20130715
+ __kmp_acquire_queuing_lock@VERSION 0.20130715
+ __kmp_acquire_tas_lock@VERSION 0.20130715
+ __kmp_acquire_ticket_lock@VERSION 0.20130715
+ __kmp_fork_call@VERSION 0.20130715
+ __kmp_get_reduce_method@VERSION 0.20130412
+ __kmp_invoke_microtask@VERSION 0.20130715
+ __kmp_itt_fini_ittlib@VERSION 0.20130715
+ __kmp_itt_init_ittlib@VERSION 0.20130715
+#MISSING: 4.0# __kmp_reap_monitor@VERSION 0.20130715
+ __kmp_reap_worker@VERSION 0.20130715
+#MISSING: 0.20140926# __kmp_release@VERSION 0.20130715
+#MISSING: 3.9.0-1# __kmp_release_32@VERSION 0.20140926
+ __kmp_release_64@VERSION 0.20140926
+#MISSING: 3.9.0-1# __kmp_release_oncore@VERSION 0.20140926
+ __kmp_thread_pool@VERSION 0.20130412
+ __kmp_thread_pool_nth@VERSION 0.20130412
+#MISSING: 3.9.0-1# __kmp_wait_32@VERSION 0.20140926
+ __kmp_wait_64@VERSION 0.20140926
+#MISSING: 3.9.0-1# __kmp_wait_oncore@VERSION 0.20140926
+#MISSING: 0.20140926# __kmp_wait_sleep@VERSION 0.20130715
+ __kmp_wait_yield_4@VERSION 0.20130715
+#MISSING: 3.8.0# __kmp_wait_yield_8@VERSION 0.20130715
+ __kmpc_atomic_10@VERSION 0.20130412
+ __kmpc_atomic_16@VERSION 0.20130412
+ __kmpc_atomic_1@VERSION 0.20130412
+ __kmpc_atomic_20@VERSION 0.20130412
+ __kmpc_atomic_2@VERSION 0.20130412
+ __kmpc_atomic_32@VERSION 0.20130412
+ __kmpc_atomic_4@VERSION 0.20130412
+ __kmpc_atomic_8@VERSION 0.20130412
+ __kmpc_atomic_cmplx10_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_add_cpt@VERSION 0.20130412
+ __kmpc_atomic_cmplx10_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_div_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_div_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_div_rev@VERSION 0.20130412
+ __kmpc_atomic_cmplx10_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_mul_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_rd@VERSION 0.20130412
+ __kmpc_atomic_cmplx10_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_sub_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_sub_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_sub_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx10_wr@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_cmplx16_add@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_cmplx16_div@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_cmplx16_mul@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_rd@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_cmplx16_sub@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_swp@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx16_wr@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_add@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_add_cmplx8@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_add_cpt@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_div@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_div_cmplx8@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_div_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_div_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_div_rev@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_mul@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_mul_cmplx8@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_mul_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_rd@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_sub@VERSION 0.20130412
+ __kmpc_atomic_cmplx4_sub_cmplx8@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_sub_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_sub_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_sub_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx4_wr@VERSION 0.20130412
+ __kmpc_atomic_cmplx8_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_add_cpt@VERSION 0.20130412
+ __kmpc_atomic_cmplx8_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_div_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_div_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_div_rev@VERSION 0.20130412
+ __kmpc_atomic_cmplx8_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_mul_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_rd@VERSION 0.20130412
+ __kmpc_atomic_cmplx8_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_sub_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_sub_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_sub_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_cmplx8_wr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_end@VERSION 0.20130412
+ (arch=!ppc64 !ppc64el)__kmpc_atomic_fixed1_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed1_add_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed1_andb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_andb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_andl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_andl_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_div_cpt_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed1_div_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed1_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed1_eqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_eqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_max@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_max_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_min@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_min_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_mul_cpt_fp@VERSION 4.0
+ __kmpc_atomic_fixed1_mul_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed1_mul_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed1_neqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_neqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_orb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_orb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed1_orl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_orl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_rd@VERSION 0.20130412
+ __kmpc_atomic_fixed1_shl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_shl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_shl_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_shl_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed1_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_shr_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed1_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed1_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_wr@VERSION 0.20130412
+ __kmpc_atomic_fixed1_xor@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1_xor_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed1u_add_fp@VERSION 4.0
+ __kmpc_atomic_fixed1u_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_div_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed1u_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_div_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_mul_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed1u_mul_fp@VERSION 4.0
+ __kmpc_atomic_fixed1u_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_shr_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_sub_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed1u_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed1u_sub_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf !arm64)__kmpc_atomic_fixed1u_sub_rev_fp@VERSION 5.0
+ __kmpc_atomic_fixed2_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed2_add_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed2_andb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_andb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_andl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_andl_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_div_cpt_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed2_div_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed2_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed2_eqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_eqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_max@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_max_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_min@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_min_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_mul_cpt_fp@VERSION 4.0
+ __kmpc_atomic_fixed2_mul_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed2_mul_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed2_neqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_neqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_orb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_orb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed2_orl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_orl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_rd@VERSION 0.20130412
+ __kmpc_atomic_fixed2_shl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_shl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_shl_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_shl_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed2_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_shr_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed2_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed2_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_wr@VERSION 0.20130412
+ __kmpc_atomic_fixed2_xor@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2_xor_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed2u_add_fp@VERSION 4.0
+ __kmpc_atomic_fixed2u_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_div_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed2u_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_div_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_mul_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed2u_mul_fp@VERSION 4.0
+ __kmpc_atomic_fixed2u_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_shr_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_sub_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed2u_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed2u_sub_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf !arm64)__kmpc_atomic_fixed2u_sub_rev_fp@VERSION 5.0
+ __kmpc_atomic_fixed4_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed4_add_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed4_andb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_andb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_andl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_andl_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_div_cpt_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed4_div_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed4_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed4_eqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_eqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_max@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_max_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_min@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_min_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_mul_cpt_fp@VERSION 4.0
+ __kmpc_atomic_fixed4_mul_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed4_mul_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed4_neqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_neqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_orb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_orb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed4_orl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_orl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_rd@VERSION 0.20130412
+ __kmpc_atomic_fixed4_shl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_shl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_shl_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_shl_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed4_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_shr_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed4_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed4_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_wr@VERSION 0.20130412
+ __kmpc_atomic_fixed4_xor@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4_xor_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed4u_add_fp@VERSION 4.0
+ (arch=!ppc64 !ppc64el)__kmpc_atomic_fixed4u_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_div_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed4u_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_div_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_mul_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed4u_mul_fp@VERSION 4.0
+ __kmpc_atomic_fixed4u_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_shr_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_sub_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed4u_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed4u_sub_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf !arm64)__kmpc_atomic_fixed4u_sub_rev_fp@VERSION 5.0
+ (arch=!ppc64 !ppc64el)__kmpc_atomic_fixed8_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed8_add_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed8_andb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_andb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_andl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_andl_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_div_cpt_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed8_div_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed8_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_fixed8_eqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_eqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_max@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_max_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_min@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_min_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_mul_cpt_fp@VERSION 4.0
+ __kmpc_atomic_fixed8_mul_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed8_mul_fp@VERSION 0.20130412
+ __kmpc_atomic_fixed8_neqv@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_neqv_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_orb@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_orb_cpt@VERSION 0.20130412
+ __kmpc_atomic_fixed8_orl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_orl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_rd@VERSION 0.20130412
+ __kmpc_atomic_fixed8_shl@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_shl_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_shl_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_shl_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed8_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_shr_rev@VERSION 0.20130412
+ __kmpc_atomic_fixed8_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed8_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_wr@VERSION 0.20130412
+ __kmpc_atomic_fixed8_xor@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8_xor_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed8u_add_fp@VERSION 4.0
+ __kmpc_atomic_fixed8u_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_div_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_fixed8u_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_div_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_mul_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed8u_mul_fp@VERSION 4.0
+ __kmpc_atomic_fixed8u_shr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_shr_cpt@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_shr_cpt_rev@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_shr_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_sub_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_fixed8u_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)__kmpc_atomic_fixed8u_sub_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf !arm64)__kmpc_atomic_fixed8u_sub_rev_fp@VERSION 5.0
+ __kmpc_atomic_float10_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float10_add_fp@VERSION 0.20130412
+ __kmpc_atomic_float10_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float10_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_float10_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_mul_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float10_mul_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_rd@VERSION 0.20130412
+ __kmpc_atomic_float10_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float10_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_wr@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float16_add@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float16_div@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float16_max@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_max_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float16_min@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_min_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float16_mul@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_rd@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float16_sub@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_swp@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float16_wr@VERSION 0.20130412
+ __kmpc_atomic_float4_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_add_cpt_fp@VERSION 4.0
+ (arch=!ppc64 !ppc64el)__kmpc_atomic_float4_add_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float4_add_fp@VERSION 0.20130412
+ __kmpc_atomic_float4_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_div_cpt_rev_fp@VERSION 4.0
+ __kmpc_atomic_float4_div_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float4_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_float4_max@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_max_cpt@VERSION 0.20130412
+ __kmpc_atomic_float4_min@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_min_cpt@VERSION 0.20130412
+ __kmpc_atomic_float4_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_mul_cpt_fp@VERSION 4.0
+ __kmpc_atomic_float4_mul_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float4_mul_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_rd@VERSION 0.20130412
+ __kmpc_atomic_float4_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_sub_cpt_rev_fp@VERSION 4.0
+ __kmpc_atomic_float4_sub_float8@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float4_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float4_wr@VERSION 0.20130412
+ __kmpc_atomic_float8_add@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_add_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_add_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float8_add_fp@VERSION 0.20130412
+ __kmpc_atomic_float8_div@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_div_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_div_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_div_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_div_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float8_div_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_div_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_div_rev_fp@VERSION 4.0
+ __kmpc_atomic_float8_max@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_max_cpt@VERSION 0.20130412
+ __kmpc_atomic_float8_min@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_min_cpt@VERSION 0.20130412
+ __kmpc_atomic_float8_mul@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_mul_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_mul_cpt_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float8_mul_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_rd@VERSION 0.20130412
+ __kmpc_atomic_float8_sub@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_sub_cpt@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_sub_cpt_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_sub_cpt_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_sub_cpt_rev_fp@VERSION 4.0
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float8_sub_fp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_sub_rev@VERSION 0.20130412
+#MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_sub_rev_fp@VERSION 4.0
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_swp@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float8_wr@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_start@VERSION 0.20130412
+ __kmpc_barrier@VERSION 0.20130412
+ __kmpc_barrier_master@VERSION 0.20130412
+ __kmpc_barrier_master_nowait@VERSION 0.20130412
+ __kmpc_begin@VERSION 0.20130412
+ __kmpc_bound_num_threads@VERSION 0.20130412
+ __kmpc_bound_thread_num@VERSION 0.20130412
+ __kmpc_cancel@VERSION 0.20131209
+ __kmpc_cancel_barrier@VERSION 0.20131209
+ __kmpc_cancellationpoint@VERSION 0.20131209
+ __kmpc_copyprivate@VERSION 0.20130412
+ __kmpc_critical@VERSION 0.20130412
+ __kmpc_critical_with_hint@VERSION 3.8.0
+ __kmpc_destroy_lock@VERSION 0.20130412
+ __kmpc_destroy_nest_lock@VERSION 0.20130412
+ __kmpc_dispatch_fini_4@VERSION 0.20130412
+ __kmpc_dispatch_fini_4u@VERSION 0.20130412
+ __kmpc_dispatch_fini_8@VERSION 0.20130412
+ __kmpc_dispatch_fini_8u@VERSION 0.20130412
+ __kmpc_dispatch_init_4@VERSION 0.20130412
+ __kmpc_dispatch_init_4u@VERSION 0.20130412
+ __kmpc_dispatch_init_8@VERSION 0.20130412
+ __kmpc_dispatch_init_8u@VERSION 0.20130412
+ __kmpc_dispatch_next_4@VERSION 0.20130412
+ __kmpc_dispatch_next_4u@VERSION 0.20130412
+ __kmpc_dispatch_next_8@VERSION 0.20130412
+ __kmpc_dispatch_next_8u@VERSION 0.20130412
+ __kmpc_dist_dispatch_init_4@VERSION 0.20140926
+ __kmpc_dist_dispatch_init_4u@VERSION 0.20140926
+ __kmpc_dist_dispatch_init_8@VERSION 0.20140926
+ __kmpc_dist_dispatch_init_8u@VERSION 0.20140926
+ __kmpc_dist_for_static_init_4@VERSION 0.20140926
+ __kmpc_dist_for_static_init_4u@VERSION 0.20140926
+ __kmpc_dist_for_static_init_8@VERSION 0.20140926
+ __kmpc_dist_for_static_init_8u@VERSION 0.20140926
+ __kmpc_doacross_fini@VERSION 3.9.0
+ __kmpc_doacross_init@VERSION 3.9.0
+ __kmpc_doacross_post@VERSION 3.9.0
+ __kmpc_doacross_wait@VERSION 3.9.0
+ __kmpc_end@VERSION 0.20130412
+ __kmpc_end_barrier_master@VERSION 0.20130412
+ __kmpc_end_critical@VERSION 0.20130412
+ __kmpc_end_master@VERSION 0.20130412
+ __kmpc_end_ordered@VERSION 0.20130412
+ __kmpc_end_reduce@VERSION 0.20130412
+ __kmpc_end_reduce_nowait@VERSION 0.20130412
+ __kmpc_end_serialized_parallel@VERSION 0.20130412
+ __kmpc_end_single@VERSION 0.20130412
+ __kmpc_end_taskgroup@VERSION 0.20130412
+ __kmpc_end_taskq@VERSION 0.20130412
+ __kmpc_end_taskq_task@VERSION 0.20130412
+ __kmpc_flush@VERSION 0.20130412
+ __kmpc_for_static_fini@VERSION 0.20130412
+ __kmpc_for_static_init_4@VERSION 0.20130412
+ __kmpc_for_static_init_4u@VERSION 0.20130412
+ __kmpc_for_static_init_8@VERSION 0.20130412
+ __kmpc_for_static_init_8u@VERSION 0.20130412
+ __kmpc_fork_call@VERSION 0.20130412
+ __kmpc_fork_teams@VERSION 0.20130715
+ __kmpc_get_parent_taskid@VERSION 0.20130412
+ __kmpc_get_target_offload@VERSION 7
+ __kmpc_get_taskid@VERSION 0.20130412
+ __kmpc_global_num_threads@VERSION 0.20130412
+ __kmpc_global_thread_num@VERSION 0.20130412
+ __kmpc_in_parallel@VERSION 0.20130412
+ __kmpc_init_lock@VERSION 0.20130412
+ __kmpc_init_lock_with_hint@VERSION 3.8.0
+ __kmpc_init_nest_lock@VERSION 0.20130412
+ __kmpc_init_nest_lock_with_hint@VERSION 3.8.0
+ __kmpc_invoke_task_func@VERSION 0.20130412
+ __kmpc_master@VERSION 0.20130412
+ __kmpc_ok_to_fork@VERSION 0.20130412
+ __kmpc_omp_task@VERSION 0.20130412
+ __kmpc_omp_task_alloc@VERSION 0.20130412
+ __kmpc_omp_task_begin_if0@VERSION 0.20130412
+ __kmpc_omp_task_complete_if0@VERSION 0.20130412
+ __kmpc_omp_task_parts@VERSION 0.20130412
+ __kmpc_omp_task_with_deps@VERSION 0.20130912
+ __kmpc_omp_taskwait@VERSION 0.20130412
+ __kmpc_omp_taskyield@VERSION 0.20130412
+ __kmpc_omp_wait_deps@VERSION 0.20130912
+ __kmpc_ordered@VERSION 0.20130412
+ __kmpc_pop_num_threads@VERSION 0.20130412
+ __kmpc_proxy_task_completed@VERSION 0.20150401
+ __kmpc_proxy_task_completed_ooo@VERSION 0.20150401
+ __kmpc_push_num_teams@VERSION 0.20130715
+ __kmpc_push_num_threads@VERSION 0.20130412
+ __kmpc_push_proc_bind@VERSION 0.20130412
+ __kmpc_reduce@VERSION 0.20130412
+ __kmpc_reduce_nowait@VERSION 0.20130412
+ __kmpc_serialized_parallel@VERSION 0.20130412
+ __kmpc_set_lock@VERSION 0.20130412
+ __kmpc_set_nest_lock@VERSION 0.20130412
+ __kmpc_single@VERSION 0.20130412
+ __kmpc_task@VERSION 0.20130412
+ __kmpc_task_buffer@VERSION 0.20130412
+ __kmpc_task_reduction_get_th_data@VERSION 5.0
+ __kmpc_task_reduction_init@VERSION 5.0
+ __kmpc_taskgroup@VERSION 0.20130412
+ __kmpc_taskloop@VERSION 3.9.0
+ __kmpc_taskq@VERSION 0.20130412
+ __kmpc_taskq_task@VERSION 0.20130412
+ __kmpc_team_static_init_4@VERSION 0.20140926
+ __kmpc_team_static_init_4u@VERSION 0.20140926
+ __kmpc_team_static_init_8@VERSION 0.20140926
+ __kmpc_team_static_init_8u@VERSION 0.20140926
+ __kmpc_test_lock@VERSION 0.20130412
+ __kmpc_test_nest_lock@VERSION 0.20130412
+ __kmpc_threadprivate@VERSION 0.20130412
+ __kmpc_threadprivate_cached@VERSION 0.20130412
+ __kmpc_threadprivate_register@VERSION 0.20130412
+ __kmpc_threadprivate_register_vec@VERSION 0.20130412
+ __kmpc_unset_lock@VERSION 0.20130412
+ __kmpc_unset_nest_lock@VERSION 0.20130412
+ kmp_a_debug@VERSION 7
+ kmp_aligned_malloc@VERSION 3.9.0
+ kmp_aligned_malloc_@VERSION 3.9.0
+ kmp_b_debug@VERSION 7
+ kmp_c_debug@VERSION 7
+ kmp_calloc@VERSION 0.20130412
+ kmp_calloc_@VERSION 0.20130412
+ kmp_create_affinity_mask@VERSION 0.20130412
+ kmp_create_affinity_mask_@VERSION 0.20130412
+ kmp_d_debug@VERSION 7
+ kmp_destroy_affinity_mask@VERSION 0.20130412
+ kmp_destroy_affinity_mask_@VERSION 0.20130412
+ kmp_diag@VERSION 7
+ kmp_e_debug@VERSION 7
+ kmp_f_debug@VERSION 7
+ kmp_free@VERSION 0.20130412
+ kmp_free_@VERSION 0.20130412
+ kmp_get_affinity@VERSION 0.20130412
+ kmp_get_affinity_@VERSION 0.20130412
+ kmp_get_affinity_mask_proc@VERSION 0.20130412
+ kmp_get_affinity_mask_proc_@VERSION 0.20130412
+ kmp_get_affinity_max_proc@VERSION 0.20130412
+ kmp_get_affinity_max_proc_@VERSION 0.20130412
+ kmp_get_blocktime@VERSION 0.20130412
+ kmp_get_blocktime_@VERSION 0.20130412
+ kmp_get_cancellation_status@VERSION 0.20131209
+ kmp_get_cancellation_status_@VERSION 0.20131209
+ kmp_get_library@VERSION 0.20130412
+ kmp_get_library_@VERSION 0.20130412
+ kmp_get_num_known_threads@VERSION 0.20130412
+ kmp_get_num_known_threads_@VERSION 0.20130412
+ kmp_get_stacksize@VERSION 0.20130412
+ kmp_get_stacksize_@VERSION 0.20130412
+ kmp_get_stacksize_s@VERSION 0.20130412
+ kmp_get_stacksize_s_@VERSION 0.20130412
+ kmp_malloc@VERSION 0.20130412
+ kmp_malloc_@VERSION 0.20130412
+ (arch=!armhf !mips64el)kmp_mutex_impl_info@VERSION 7
+ kmp_realloc@VERSION 0.20130412
+ kmp_realloc_@VERSION 0.20130412
+ kmp_set_affinity@VERSION 0.20130412
+ kmp_set_affinity_@VERSION 0.20130412
+ kmp_set_affinity_mask_proc@VERSION 0.20130412
+ kmp_set_affinity_mask_proc_@VERSION 0.20130412
+ kmp_set_blocktime@VERSION 0.20130412
+ kmp_set_blocktime_@VERSION 0.20130412
+ kmp_set_defaults@VERSION 0.20130412
+ kmp_set_defaults_@VERSION 0.20130412
+ kmp_set_disp_num_buffers@VERSION 3.9.0
+ kmp_set_disp_num_buffers_@VERSION 3.9.0
+ kmp_set_library@VERSION 0.20130412
+ kmp_set_library_@VERSION 0.20130412
+ kmp_set_library_serial@VERSION 0.20130412
+ kmp_set_library_serial_@VERSION 0.20130412
+ kmp_set_library_throughput@VERSION 0.20130412
+ kmp_set_library_throughput_@VERSION 0.20130412
+ kmp_set_library_turnaround@VERSION 0.20130412
+ kmp_set_library_turnaround_@VERSION 0.20130412
+ kmp_set_stacksize@VERSION 0.20130412
+ kmp_set_stacksize_@VERSION 0.20130412
+ kmp_set_stacksize_s@VERSION 0.20130412
+ kmp_set_stacksize_s_@VERSION 0.20130412
+ (arch=!ppc64 !ppc64el)kmp_set_thread_affinity_mask_initial@VERSION 3.8.0
+ kmp_set_warnings_off@VERSION 0.20130412
+ kmp_set_warnings_off_@VERSION 0.20130412
+ kmp_set_warnings_on@VERSION 0.20130412
+ kmp_set_warnings_on_@VERSION 0.20130412
+ kmp_threadprivate_insert@VERSION 0.20130412
+ kmp_threadprivate_insert_private_data@VERSION 0.20130412
+ kmp_unset_affinity_mask_proc@VERSION 0.20130412
+ kmp_unset_affinity_mask_proc_@VERSION 0.20130412
+ kmpc_aligned_malloc@VERSION 3.9.0
+ kmpc_calloc@VERSION 0.20130412
+ kmpc_free@VERSION 0.20130412
+ kmpc_get_affinity_mask_proc@VERSION 0.20130412
+ kmpc_malloc@VERSION 0.20130412
+ kmpc_realloc@VERSION 0.20130412
+ kmpc_set_affinity_mask_proc@VERSION 0.20130412
+ kmpc_set_blocktime@VERSION 0.20130412
+ kmpc_set_defaults@VERSION 0.20130412
+ kmpc_set_disp_num_buffers@VERSION 3.9.0
+ kmpc_set_library@VERSION 0.20130412
+ kmpc_set_stacksize@VERSION 0.20130412
+ kmpc_set_stacksize_s@VERSION 0.20130412
+ kmpc_unset_affinity_mask_proc@VERSION 0.20130412
+ omp_control_tool@VERSION 6.0
+ omp_destroy_lock@OMP_1.0 0.20131209
+ omp_destroy_lock@OMP_3.0 0.20131209
+ omp_destroy_lock@VERSION 0.20130412
+ omp_destroy_lock_@OMP_1.0 0.20131209
+ omp_destroy_lock_@OMP_3.0 0.20131209
+ omp_destroy_lock_@VERSION 0.20130412
+ omp_destroy_nest_lock@OMP_1.0 0.20131209
+ omp_destroy_nest_lock@OMP_3.0 0.20131209
+ omp_destroy_nest_lock@VERSION 0.20130412
+ omp_destroy_nest_lock_@OMP_1.0 0.20131209
+ omp_destroy_nest_lock_@OMP_3.0 0.20131209
+ omp_destroy_nest_lock_@VERSION 0.20130412
+ omp_get_active_level@OMP_3.0 0.20131209
+ omp_get_active_level@VERSION 0.20130412
+ omp_get_active_level_@OMP_3.0 0.20131209
+ omp_get_active_level_@VERSION 0.20130412
+ omp_get_ancestor_thread_num@OMP_3.0 0.20131209
+ omp_get_ancestor_thread_num@VERSION 0.20130412
+ omp_get_ancestor_thread_num_@OMP_3.0 0.20131209
+ omp_get_ancestor_thread_num_@VERSION 0.20130412
+ omp_get_cancellation@OMP_4.0 0.20131209
+ omp_get_cancellation@VERSION 0.20131209
+ omp_get_cancellation_@OMP_4.0 0.20131209
+ omp_get_cancellation_@VERSION 0.20131209
+ omp_get_default_device@OMP_4.0 4.0
+ omp_get_default_device@VERSION 4.0
+ omp_get_default_device_@OMP_4.0 4.0
+ omp_get_default_device_@VERSION 4.0
+ omp_get_dynamic@OMP_1.0 0.20131209
+ omp_get_dynamic@VERSION 0.20130412
+ omp_get_dynamic_@OMP_1.0 0.20131209
+ omp_get_dynamic_@VERSION 0.20130412
+ omp_get_level@OMP_3.0 0.20131209
+ omp_get_level@VERSION 0.20130412
+ omp_get_level_@OMP_3.0 0.20131209
+ omp_get_level_@VERSION 0.20130412
+ omp_get_max_active_levels@OMP_3.0 0.20131209
+ omp_get_max_active_levels@VERSION 0.20130412
+ omp_get_max_active_levels_@OMP_3.0 0.20131209
+ omp_get_max_active_levels_@VERSION 0.20130412
+ omp_get_max_task_priority@OMP_4.5 7
+ omp_get_max_task_priority@VERSION 3.9.0
+ omp_get_max_task_priority_@OMP_4.5 7
+ omp_get_max_task_priority_@VERSION 3.9.0
+ omp_get_max_threads@OMP_1.0 0.20131209
+ omp_get_max_threads@VERSION 0.20130412
+ omp_get_max_threads_@OMP_1.0 0.20131209
+ omp_get_max_threads_@VERSION 0.20130412
+ omp_get_nested@OMP_1.0 0.20131209
+ omp_get_nested@VERSION 0.20130412
+ omp_get_nested_@OMP_1.0 0.20131209
+ omp_get_nested_@VERSION 0.20130412
+ omp_get_num_places@OMP_4.5 7
+ omp_get_num_places@VERSION 3.9.0
+ omp_get_num_places_@OMP_4.5 7
+ omp_get_num_places_@VERSION 3.9.0
+ omp_get_num_procs@OMP_1.0 0.20131209
+ omp_get_num_procs@VERSION 0.20130412
+ omp_get_num_procs_@OMP_1.0 0.20131209
+ omp_get_num_procs_@VERSION 0.20130412
+ omp_get_num_teams@OMP_4.0 0.20131209
+ omp_get_num_teams@VERSION 0.20130715
+ omp_get_num_teams_@OMP_4.0 0.20131209
+ omp_get_num_teams_@VERSION 0.20130715
+ omp_get_num_threads@OMP_1.0 0.20131209
+ omp_get_num_threads@VERSION 0.20130412
+ omp_get_num_threads_@OMP_1.0 0.20131209
+ omp_get_num_threads_@VERSION 0.20130412
+ omp_get_partition_num_places@OMP_4.5 7
+ omp_get_partition_num_places@VERSION 3.9.0
+ omp_get_partition_num_places_@OMP_4.5 7
+ omp_get_partition_num_places_@VERSION 3.9.0
+ omp_get_partition_place_nums@OMP_4.5 7
+ omp_get_partition_place_nums@VERSION 3.9.0
+ omp_get_partition_place_nums_@OMP_4.5 7
+ omp_get_partition_place_nums_@VERSION 3.9.0
+ omp_get_place_num@OMP_4.5 7
+ omp_get_place_num@VERSION 3.9.0
+ omp_get_place_num_@OMP_4.5 7
+ omp_get_place_num_@VERSION 3.9.0
+ omp_get_place_num_procs@OMP_4.5 7
+ omp_get_place_num_procs@VERSION 3.9.0
+ omp_get_place_num_procs_@OMP_4.5 7
+ omp_get_place_num_procs_@VERSION 3.9.0
+ omp_get_place_proc_ids@OMP_4.5 7
+ omp_get_place_proc_ids@VERSION 3.9.0
+ omp_get_place_proc_ids_@OMP_4.5 7
+ omp_get_place_proc_ids_@VERSION 3.9.0
+ omp_get_proc_bind@OMP_4.0 0.20131209
+ omp_get_proc_bind@VERSION 0.20130412
+ omp_get_proc_bind_@OMP_4.0 0.20131209
+ omp_get_proc_bind_@VERSION 0.20130412
+ omp_get_schedule@OMP_3.0 0.20131209
+ omp_get_schedule@VERSION 0.20130412
+ omp_get_schedule_@OMP_3.0 0.20131209
+ omp_get_schedule_@VERSION 0.20130412
+ omp_get_team_num@OMP_4.0 0.20131209
+ omp_get_team_num@VERSION 0.20130715
+ omp_get_team_num_@OMP_4.0 0.20131209
+ omp_get_team_num_@VERSION 0.20130715
+ omp_get_team_size@OMP_3.0 0.20131209
+ omp_get_team_size@VERSION 0.20130412
+ omp_get_team_size_@OMP_3.0 0.20131209
+ omp_get_team_size_@VERSION 0.20130412
+ omp_get_thread_limit@OMP_3.0 0.20131209
+ omp_get_thread_limit@VERSION 0.20130412
+ omp_get_thread_limit_@OMP_3.0 0.20131209
+ omp_get_thread_limit_@VERSION 0.20130412
+ omp_get_thread_num@OMP_1.0 0.20131209
+ omp_get_thread_num@VERSION 0.20130412
+ omp_get_thread_num_@OMP_1.0 0.20131209
+ omp_get_thread_num_@VERSION 0.20130412
+ omp_get_wtick@OMP_2.0 0.20131209
+ omp_get_wtick@VERSION 0.20130412
+ omp_get_wtick_@OMP_2.0 0.20131209
+ omp_get_wtick_@VERSION 0.20130412
+ omp_get_wtime@OMP_2.0 0.20131209
+ omp_get_wtime@VERSION 0.20130412
+ omp_get_wtime_@OMP_2.0 0.20131209
+ omp_get_wtime_@VERSION 0.20130412
+ omp_in_final@OMP_3.1 0.20131209
+ omp_in_final@VERSION 0.20130412
+ omp_in_final_@OMP_3.1 0.20131209
+ omp_in_final_@VERSION 0.20130412
+ omp_in_parallel@OMP_1.0 0.20131209
+ omp_in_parallel@VERSION 0.20130412
+ omp_in_parallel_@OMP_1.0 0.20131209
+ omp_in_parallel_@VERSION 0.20130412
+ omp_init_lock@OMP_1.0 0.20131209
+ omp_init_lock@OMP_3.0 0.20131209
+ omp_init_lock@VERSION 0.20130412
+ omp_init_lock_@OMP_1.0 0.20131209
+ omp_init_lock_@OMP_3.0 0.20131209
+ omp_init_lock_@VERSION 0.20130412
+ omp_init_lock_with_hint@VERSION 3.8.0
+ omp_init_lock_with_hint_@VERSION 3.8.0
+ omp_init_nest_lock@OMP_1.0 0.20131209
+ omp_init_nest_lock@OMP_3.0 0.20131209
+ omp_init_nest_lock@VERSION 0.20130412
+ omp_init_nest_lock_@OMP_1.0 0.20131209
+ omp_init_nest_lock_@OMP_3.0 0.20131209
+ omp_init_nest_lock_@VERSION 0.20130412
+ omp_init_nest_lock_with_hint@VERSION 3.8.0
+ omp_init_nest_lock_with_hint_@VERSION 3.8.0
+ omp_is_initial_device@OMP_4.0 0.20141212
+ omp_is_initial_device@VERSION 0.20141212
+ omp_is_initial_device_@OMP_4.0 0.20141212
+ omp_is_initial_device_@VERSION 0.20141212
+ omp_set_default_device@OMP_4.0 4.0
+ omp_set_default_device@VERSION 4.0
+ omp_set_default_device_@OMP_4.0 4.0
+ omp_set_default_device_@VERSION 4.0
+ omp_set_dynamic@OMP_1.0 0.20131209
+ omp_set_dynamic@VERSION 0.20130412
+ omp_set_dynamic_@OMP_1.0 0.20131209
+ omp_set_dynamic_@VERSION 0.20130412
+ omp_set_lock@OMP_1.0 0.20131209
+ omp_set_lock@OMP_3.0 0.20131209
+ omp_set_lock@VERSION 0.20130412
+ omp_set_lock_@OMP_1.0 0.20131209
+ omp_set_lock_@OMP_3.0 0.20131209
+ omp_set_lock_@VERSION 0.20130412
+ omp_set_max_active_levels@OMP_3.0 0.20131209
+ omp_set_max_active_levels@VERSION 0.20130412
+ omp_set_max_active_levels_@OMP_3.0 0.20131209
+ omp_set_max_active_levels_@VERSION 0.20130412
+ omp_set_nest_lock@OMP_1.0 0.20131209
+ omp_set_nest_lock@OMP_3.0 0.20131209
+ omp_set_nest_lock@VERSION 0.20130412
+ omp_set_nest_lock_@OMP_1.0 0.20131209
+ omp_set_nest_lock_@OMP_3.0 0.20131209
+ omp_set_nest_lock_@VERSION 0.20130412
+ omp_set_nested@OMP_1.0 0.20131209
+ omp_set_nested@VERSION 0.20130412
+ omp_set_nested_@OMP_1.0 0.20131209
+ omp_set_nested_@VERSION 0.20130412
+ omp_set_num_threads@OMP_1.0 0.20131209
+ omp_set_num_threads@VERSION 0.20130412
+ omp_set_num_threads_@OMP_1.0 0.20131209
+ omp_set_num_threads_@VERSION 0.20130412
+ omp_set_schedule@OMP_3.0 0.20131209
+ omp_set_schedule@VERSION 0.20130412
+ omp_set_schedule_@OMP_3.0 0.20131209
+ omp_set_schedule_@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)omp_state_info@VERSION 6.0
+ omp_test_lock@OMP_1.0 0.20131209
+ omp_test_lock@OMP_3.0 0.20131209
+ omp_test_lock@VERSION 0.20130412
+ omp_test_lock_@OMP_1.0 0.20131209
+ omp_test_lock_@OMP_3.0 0.20131209
+ omp_test_lock_@VERSION 0.20130412
+ omp_test_nest_lock@OMP_1.0 0.20131209
+ omp_test_nest_lock@OMP_3.0 0.20131209
+ omp_test_nest_lock@VERSION 0.20130412
+ omp_test_nest_lock_@OMP_1.0 0.20131209
+ omp_test_nest_lock_@OMP_3.0 0.20131209
+ omp_test_nest_lock_@VERSION 0.20130412
+ omp_unset_lock@OMP_1.0 0.20131209
+ omp_unset_lock@OMP_3.0 0.20131209
+ omp_unset_lock@VERSION 0.20130412
+ omp_unset_lock_@OMP_1.0 0.20131209
+ omp_unset_lock_@OMP_3.0 0.20131209
+ omp_unset_lock_@VERSION 0.20130412
+ omp_unset_nest_lock@OMP_1.0 0.20131209
+ omp_unset_nest_lock@OMP_3.0 0.20131209
+ omp_unset_nest_lock@VERSION 0.20130412
+ omp_unset_nest_lock_@OMP_1.0 0.20131209
+ omp_unset_nest_lock_@OMP_3.0 0.20131209
+ omp_unset_nest_lock_@VERSION 0.20130412
+ ompc_get_ancestor_thread_num@VERSION 0.20130412
+ ompc_get_team_size@VERSION 0.20130412
+ ompc_set_dynamic@VERSION 0.20130412
+ ompc_set_max_active_levels@VERSION 0.20130412
+ ompc_set_nested@VERSION 0.20130412
+ ompc_set_num_threads@VERSION 0.20130412
+ ompc_set_schedule@VERSION 0.20130412
+ (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)ompt_start_tool@VERSION 6.0
diff --git a/lld-X.Y.install.in b/lld-X.Y.install.in
new file mode 100644 (file)
index 0000000..4d392c9
--- /dev/null
@@ -0,0 +1,11 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/ld.lld*
+usr/lib/llvm-@LLVM_VERSION@/bin/ld64.lld
+usr/lib/llvm-@LLVM_VERSION@/bin/lld-*
+usr/lib/llvm-@LLVM_VERSION@/bin/lld
+usr/lib/llvm-@LLVM_VERSION@/bin/wasm-ld
+
+usr/bin/lld-link-@LLVM_VERSION@
+usr/bin/ld.lld-@LLVM_VERSION@
+usr/bin/ld64.lld-@LLVM_VERSION@
+usr/bin/lld-@LLVM_VERSION@*
+usr/bin/wasm-ld-@LLVM_VERSION@
diff --git a/lld-X.Y.manpages.in b/lld-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..6cfafea
--- /dev/null
@@ -0,0 +1 @@
+lld/docs/ld.lld-@LLVM_VERSION@.1
diff --git a/lldb-X.Y.install.in b/lldb-X.Y.install.in
new file mode 100644 (file)
index 0000000..e6fe07e
--- /dev/null
@@ -0,0 +1,11 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/lldb*
+usr/lib/llvm-@LLVM_VERSION@/bin/lldb-mi*
+usr/lib/llvm-@LLVM_VERSION@/bin/lldb-server*
+usr/lib/llvm-@LLVM_VERSION@/bin/lldb-argdumper
+
+usr/bin/lldb-@LLVM_VERSION@*
+usr/bin/lldb-server-@LLVM_VERSION@*
+usr/bin/lldb-mi-@LLVM_VERSION@*
+usr/bin/lldb-argdumper-@LLVM_VERSION@
+usr/bin/lldb-test-@LLVM_VERSION@
+
diff --git a/lldb-X.Y.links.in b/lldb-X.Y.links.in
new file mode 100644 (file)
index 0000000..d30a5f6
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/lldb-server usr/lib/llvm-@LLVM_VERSION@/bin/lldb-server-@LLVM_VERSION_FULL@
+usr/lib/llvm-@LLVM_VERSION@/bin/lldb-server usr/lib/llvm-@LLVM_VERSION@/bin/lldb-server-@LLVM_VERSION@
diff --git a/lldb-X.Y.lintian-overrides.in b/lldb-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..a456a34
--- /dev/null
@@ -0,0 +1,3 @@
+lldb-@LLVM_VERSION@: non-dev-pkg-with-shlib-symlink usr/lib/*/liblldb.so.1 usr/lib/*/liblldb.so
+# Does not really matter
+lldb-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/lldb-@LLVM_VERSION@.1.gz
diff --git a/lldb-X.Y.manpages.in b/lldb-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..36a62ae
--- /dev/null
@@ -0,0 +1,2 @@
+debian/man/lldb-@LLVM_VERSION@.1
+debian/man/lldb-mi-@LLVM_VERSION@.1
diff --git a/lldb-X.Y.postinst.in b/lldb-X.Y.postinst.in
new file mode 100644 (file)
index 0000000..a5a6071
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+if [ "$1" = "configure" ]
+then
+        ldconfig
+fi
+
+#DEBHELPER#
diff --git a/llvm-X.Y-dev.dirs.in b/llvm-X.Y-dev.dirs.in
new file mode 100644 (file)
index 0000000..3b3b586
--- /dev/null
@@ -0,0 +1,5 @@
+/usr/lib/llvm-@LLVM_VERSION@/lib
+/usr/lib/llvm-@LLVM_VERSION@/build
+/usr/lib/llvm-@LLVM_VERSION@/include
+usr/share/doc/llvm-@LLVM_VERSION@-dev
+usr/share/emacs/site-lisp/llvm-@LLVM_VERSION@
diff --git a/llvm-X.Y-dev.install.in b/llvm-X.Y-dev.install.in
new file mode 100644 (file)
index 0000000..f367b8e
--- /dev/null
@@ -0,0 +1,32 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM*.a
+#usr/lib/llvm-@LLVM_VERSION@/lib/libllvm*.a
+usr/lib/llvm-@LLVM_VERSION@/lib/LLVM*.so
+usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM.so
+usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@.so
+usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION_FULL@.so
+usr/lib/llvm-@LLVM_VERSION@/lib/libLTO.*
+usr/lib/llvm-@LLVM_VERSION@/lib/BugpointPasses.so
+usr/lib/llvm-@LLVM_VERSION@/lib/TestPlugin.so
+usr/lib/llvm-@LLVM_VERSION@/include/llvm/      usr/include/llvm-@LLVM_VERSION@/
+usr/lib/llvm-@LLVM_VERSION@/include/llvm-c/    usr/include/llvm-c-@LLVM_VERSION@/
+# Explicit debian/tmp since there are multiple declarations
+debian/tmp/usr/lib/llvm-@LLVM_VERSION@/lib/cmake/llvm/*.cmake
+
+utils/vim/indent/llvm-@LLVM_VERSION@.vim                       usr/share/vim/addons/indent/
+
+utils/vim/syntax/llvm-@LLVM_VERSION@.vim                       usr/share/vim/addons/syntax/
+utils/vim/syntax/tablegen-@LLVM_VERSION@.vim               usr/share/vim/addons/syntax/
+
+utils/vim/ftdetect/llvm-@LLVM_VERSION@.vim                     usr/share/vim/addons/ftdetect/
+utils/vim/ftdetect/tablegen-@LLVM_VERSION@.vim             usr/share/vim/addons/ftdetect/
+
+utils/vim/ftplugin/llvm-@LLVM_VERSION@.vim                     usr/share/vim/addons/ftplugin/
+utils/vim/ftplugin/tablegen-@LLVM_VERSION@.vim             usr/share/vim/addons/ftplugin/
+
+utils/vim/llvm-@LLVM_VERSION@-vimrc                        usr/share/vim/addons
+
+
+utils/emacs/emacs.el               usr/share/emacs/site-lisp/llvm-@LLVM_VERSION@/
+utils/emacs/llvm-mode.el           usr/share/emacs/site-lisp/llvm-@LLVM_VERSION@/
+utils/emacs/tablegen-mode.el   usr/share/emacs/site-lisp/llvm-@LLVM_VERSION@/
+
diff --git a/llvm-X.Y-dev.links.in b/llvm-X.Y-dev.links.in
new file mode 100644 (file)
index 0000000..b3a2a2a
--- /dev/null
@@ -0,0 +1,19 @@
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@.so
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@.so.1
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION_FULL@.so.1
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1       usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION_FULL@.so
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION@.so.1       usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION_FULL@.so.1
+
+usr/include/llvm-c-@LLVM_VERSION@/llvm-c usr/lib/llvm-@LLVM_VERSION@/include/llvm-c
+usr/include/llvm-@LLVM_VERSION@/llvm usr/lib/llvm-@LLVM_VERSION@/include/llvm
+usr/include/llvm-c-@LLVM_VERSION@/llvm-c usr/lib/llvm-@LLVM_VERSION@/build/include/llvm-c
+usr/include/llvm-@LLVM_VERSION@/llvm usr/lib/llvm-@LLVM_VERSION@/build/include/llvm
+
+usr/lib/llvm-@LLVM_VERSION@/include/ usr/lib/llvm-@LLVM_VERSION@/build/include
+usr/lib/llvm-@LLVM_VERSION@/lib/     usr/lib/llvm-@LLVM_VERSION@/build/lib
+usr/lib/llvm-@LLVM_VERSION@/share/   usr/lib/llvm-@LLVM_VERSION@/build/share
+usr/lib/llvm-@LLVM_VERSION@/ usr/lib/llvm-@LLVM_VERSION@/build/Release
+usr/lib/llvm-@LLVM_VERSION@/ usr/lib/llvm-@LLVM_VERSION@/build/Debug+Asserts
+
+usr/lib/llvm-@LLVM_VERSION@/lib/cmake/llvm usr/lib/llvm-@LLVM_VERSION@/cmake
+usr/lib/llvm-@LLVM_VERSION@/lib/cmake/llvm usr/lib/llvm-@LLVM_VERSION@/share/llvm/cmake
diff --git a/llvm-X.Y-doc.dirs.in b/llvm-X.Y-doc.dirs.in
new file mode 100644 (file)
index 0000000..5379e8e
--- /dev/null
@@ -0,0 +1 @@
+usr/share/doc/llvm-@LLVM_VERSION@-doc
diff --git a/llvm-X.Y-doc.install.in b/llvm-X.Y-doc.install.in
new file mode 100644 (file)
index 0000000..6ac115a
--- /dev/null
@@ -0,0 +1,6 @@
+docs/_build/html usr/share/doc/llvm-@LLVM_VERSION@-doc/
+#usr/lib/llvm-@LLVM_VERSION@/docs/llvm/html.tar.gz
+#usr/lib/llvm-@LLVM_VERSION@/docs/llvm/ocamldoc.tar.gz
+#usr/lib/llvm-@LLVM_VERSION@/docs/llvm/html/Dummy.html
+#usr/lib/llvm-@LLVM_VERSION@/docs/llvm/html/doxygen.css
+#usr/lib/llvm-@LLVM_VERSION@/docs/llvm/html/LibASTMatchersReference.html
diff --git a/llvm-X.Y-examples.dirs.in b/llvm-X.Y-examples.dirs.in
new file mode 100644 (file)
index 0000000..a8b75c6
--- /dev/null
@@ -0,0 +1 @@
+usr/share/doc/llvm-@LLVM_VERSION@-examples
diff --git a/llvm-X.Y-examples.examples.in b/llvm-X.Y-examples.examples.in
new file mode 100644 (file)
index 0000000..e39721e
--- /dev/null
@@ -0,0 +1 @@
+examples/*
diff --git a/llvm-X.Y-examples.links.in b/llvm-X.Y-examples.links.in
new file mode 100644 (file)
index 0000000..a8d74aa
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/lib/llvm-@LLVM_VERSION@/build/Makefile.common     usr/share/doc/llvm-@LLVM_VERSION@-examples/Makefile.common
+/usr/lib/llvm-@LLVM_VERSION@/build/Makefile.config     usr/share/doc/llvm-@LLVM_VERSION@-examples/Makefile.config
+/usr/lib/llvm-@LLVM_VERSION@/build/Makefile.rules      usr/share/doc/llvm-@LLVM_VERSION@-examples/Makefile.rules
diff --git a/llvm-X.Y-runtime.binfmt.in b/llvm-X.Y-runtime.binfmt.in
new file mode 100644 (file)
index 0000000..6bb1df7
--- /dev/null
@@ -0,0 +1,3 @@
+package llvm-@LLVM_VERSION@-runtime
+interpreter /usr/bin/lli-@LLVM_VERSION@
+magic BC
diff --git a/llvm-X.Y-runtime.install.in b/llvm-X.Y-runtime.install.in
new file mode 100644 (file)
index 0000000..d8e16a7
--- /dev/null
@@ -0,0 +1,8 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/lli
+usr/lib/llvm-@LLVM_VERSION@/bin/lli-child-target
+
+usr/bin/lli-@LLVM_VERSION@
+usr/bin/lli-child-target-@LLVM_VERSION@
+
+debian/llvm-@LLVM_VERSION@-runtime.binfmt                  usr/share/binfmts/
+
diff --git a/llvm-X.Y-runtime.lintian-overrides.in b/llvm-X.Y-runtime.lintian-overrides.in
new file mode 100644 (file)
index 0000000..e94e713
--- /dev/null
@@ -0,0 +1 @@
+llvm-@LLVM_VERSION@-runtime: binary-without-manpage usr/bin/lli-child-target-@LLVM_VERSION@
diff --git a/llvm-X.Y-runtime.manpages.in b/llvm-X.Y-runtime.manpages.in
new file mode 100644 (file)
index 0000000..839952d
--- /dev/null
@@ -0,0 +1 @@
+debian/man/lli*
diff --git a/llvm-X.Y-runtime.postinst.in b/llvm-X.Y-runtime.postinst.in
new file mode 100644 (file)
index 0000000..987b3ea
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = "configure"; then
+    if test -x /usr/sbin/update-binfmts; then
+        update-binfmts --import llvm-@LLVM_VERSION@-runtime.binfmt || true
+    fi
+fi
+
+#DEBHELPER#
diff --git a/llvm-X.Y-runtime.prerm.in b/llvm-X.Y-runtime.prerm.in
new file mode 100644 (file)
index 0000000..3f16015
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = "remove"; then
+    if test -x /usr/sbin/update-binfmts; then
+        update-binfmts --package llvm-@LLVM_VERSION@-runtime \
+            --remove llvm-@LLVM_VERSION@-runtime.binfmt /usr/bin/lli-@LLVM_VERSION@ || true
+        if test -f /var/lib/binfmts/llvm-@LLVM_VERSION@.binfmt; then
+            # Purge old file
+            update-binfmts --package llvm-@LLVM_VERSION@-runtime \
+                --remove llvm-@LLVM_VERSION@.binfmt /usr/bin/lli-@LLVM_VERSION@ || true
+        fi
+    fi
+fi
+
+#DEBHELPER#
+
diff --git a/llvm-X.Y-tools.dirs.in b/llvm-X.Y-tools.dirs.in
new file mode 100644 (file)
index 0000000..401df06
--- /dev/null
@@ -0,0 +1,2 @@
+/usr/lib/llvm-@LLVM_VERSION@/build/unittests
+/usr/lib/llvm-@LLVM_VERSION@/build/utils/lit/
diff --git a/llvm-X.Y-tools.install.in b/llvm-X.Y-tools.install.in
new file mode 100644 (file)
index 0000000..9fec1e2
--- /dev/null
@@ -0,0 +1,17 @@
+
+usr/lib/llvm-@LLVM_VERSION@/bin/count
+usr/lib/llvm-@LLVM_VERSION@/bin/FileCheck
+usr/lib/llvm-@LLVM_VERSION@/bin/not
+usr/lib/llvm-@LLVM_VERSION@/share/opt-viewer/opt-viewer.py
+usr/lib/llvm-@LLVM_VERSION@/share/opt-viewer/optrecord.py
+usr/lib/llvm-@LLVM_VERSION@/share/opt-viewer/style.css
+usr/lib/llvm-@LLVM_VERSION@/share/opt-viewer/opt-diff.py
+usr/lib/llvm-@LLVM_VERSION@/share/opt-viewer/optpmap.py
+usr/lib/llvm-@LLVM_VERSION@/share/opt-viewer/opt-stats.py
+
+utils/lit/*             /usr/lib/llvm-@LLVM_VERSION@/build/utils/lit/
+
+usr/bin/count-@LLVM_VERSION@
+usr/bin/FileCheck-@LLVM_VERSION@
+usr/bin/not-@LLVM_VERSION@
+
diff --git a/llvm-X.Y.dirs.in b/llvm-X.Y.dirs.in
new file mode 100644 (file)
index 0000000..56a9655
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/lib/llvm-@LLVM_VERSION@/bin
+usr/share/man/man1
+usr/share/doc/llvm-@LLVM_VERSION@
diff --git a/llvm-X.Y.install.in b/llvm-X.Y.install.in
new file mode 100644 (file)
index 0000000..dc67100
--- /dev/null
@@ -0,0 +1,18 @@
+usr/lib/llvm-@LLVM_VERSION@/bin/llvm-*
+usr/lib/llvm-@LLVM_VERSION@/bin/opt*
+usr/lib/llvm-@LLVM_VERSION@/bin/bugpoint*
+usr/lib/llvm-@LLVM_VERSION@/bin/llc*
+usr/lib/llvm-@LLVM_VERSION@/bin/obj2yaml
+usr/lib/llvm-@LLVM_VERSION@/bin/yaml2obj
+usr/lib/llvm-@LLVM_VERSION@/bin/verify-uselistorder
+usr/lib/llvm-@LLVM_VERSION@/bin/sanstats
+usr/lib/llvm-@LLVM_VERSION@/bin/dsymutil
+usr/bin/llvm-*
+usr/bin/opt*
+usr/bin/bugpoint*
+usr/bin/llc*
+usr/bin/obj2yaml-*
+usr/bin/yaml2obj-*
+usr/bin/verify-uselistorder-*
+usr/bin/sanstats-*
+usr/bin/dsymutil-*
diff --git a/llvm-X.Y.lintian-overrides.in b/llvm-X.Y.lintian-overrides.in
new file mode 100644 (file)
index 0000000..35c8694
--- /dev/null
@@ -0,0 +1,12 @@
+# I know but well...
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-dwarfdump-@LLVM_VERSION@.1.gz
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-mc-@LLVM_VERSION@.1.gz
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-mcmarkup-@LLVM_VERSION@.1.gz
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-objdump-@LLVM_VERSION@.1.gz
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-rtdyld-@LLVM_VERSION@.1.gz
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-size-@LLVM_VERSION@.1.gz
+llvm-@LLVM_VERSION@: manpage-has-useless-whatis-entry usr/share/man/man1/llvm-ranlib-@LLVM_VERSION@.1.gz
+# Does not link otherwise
+llvm-@LLVM_VERSION@: embedded-library usr/lib/llvm-@LLVM_VERSION@/bin/bugpoint: libjsoncpp
+llvm-@LLVM_VERSION@: embedded-library usr/lib/llvm-@LLVM_VERSION@/bin/opt: libjsoncpp
+
diff --git a/llvm-X.Y.manpages.in b/llvm-X.Y.manpages.in
new file mode 100644 (file)
index 0000000..98f095f
--- /dev/null
@@ -0,0 +1,8 @@
+docs/_build/man/*
+debian/man/llvm-dwarfdump-@LLVM_VERSION@.1
+debian/man/llvm-mc-@LLVM_VERSION@.1
+debian/man/llvm-mcmarkup-@LLVM_VERSION@.1
+debian/man/llvm-objdump-@LLVM_VERSION@.1
+debian/man/llvm-rtdyld-@LLVM_VERSION@.1
+debian/man/llvm-size-@LLVM_VERSION@.1
+debian/man/llvm-ranlib-@LLVM_VERSION@.1
diff --git a/llvm-priv-dev.dirs b/llvm-priv-dev.dirs
new file mode 100644 (file)
index 0000000..dab8663
--- /dev/null
@@ -0,0 +1 @@
+/usr/lib/llvm-3.1/build
diff --git a/orig-tar.sh b/orig-tar.sh
new file mode 100755 (executable)
index 0000000..b405995
--- /dev/null
@@ -0,0 +1,227 @@
+#!/bin/sh
+# This script will create the following tarballs:
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-clang.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-clang-extra.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-compiler-rt.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-lld.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-lldb.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-polly.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-openmp.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-libcxx.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig-libcxxabi.tar.bz2
+# llvm-toolchain-snapshot-3.2_3.2repack.orig.tar.bz2
+
+set -e
+
+# TODO rest of the options
+
+# To create an rc1 release:
+# sh 4.0/debian/orig-tar.sh RELEASE_40 rc1
+
+SVN_BASE_URL=https://llvm.org/svn/llvm-project/
+MAJOR_VERSION=7
+CURRENT_VERSION=7.0.1 # Should be changed to 3.5.1 later
+
+if test -n "$1"; then
+# https://llvm.org/svn/llvm-project/{cfe,llvm,compiler-rt,...}/branches/google/stable/
+# For example: sh 4.0/debian/orig-tar.sh release_400
+    BRANCH=$1
+fi
+
+if test -n "$1" -a -n "$2"; then
+# https://llvm.org/svn/llvm-project/{cfe,llvm,compiler-rt,...}/tags/RELEASE_34/rc1/
+# For example: sh 4.0/debian/orig-tar.sh RELEASE_401 rc3 4.0.1
+    BRANCH=$1
+    TAG=$2
+    RCRELEASE="true"
+    if test -z "$3"; then
+        echo "Please provide the exact version. Used for the tarball name  Ex: 4.0.1"
+    fi
+    EXACT_VERSION=$3
+fi
+
+get_svn_url() {
+    MODULE=$1
+    BRANCH=$2
+    TAG=$3
+    if test -n "$TAG"; then
+            SVN_URL="$SVN_BASE_URL/$MODULE/tags/$BRANCH/$TAG"
+    else
+        if test -n "$BRANCH"; then
+            SVN_URL="$SVN_BASE_URL/$MODULE/branches/$BRANCH"
+        else
+            SVN_URL="$SVN_BASE_URL/$MODULE/trunk/"
+        fi
+    fi
+    echo $SVN_URL
+}
+
+get_higher_revision() {
+    PROJECTS="llvm cfe compiler-rt polly lld lldb clang-tools-extra"
+    REVISION_MAX=0
+    for f in $PROJECTS; do
+        REVISION=$(LANG=C svn info $(get_svn_url $f $BRANCH $TAG)|grep "^Last Changed Rev:"|awk '{print $4}')
+        if test $REVISION -gt $REVISION_MAX; then
+            REVISION_MAX=$REVISION
+        fi
+    done
+    echo $REVISION_MAX
+}
+
+SVN_ARCHIVES=svn-archives
+
+checkout_sources() {
+    PROJECT=$1
+    URL=$2
+    TARGET=$3
+    BRANCH=$4
+    if test -n "$BRANCH"; then
+        REVISION=$5
+    fi
+    echo "$PROJECT / $URL / $BRANCH / $TARGET / $REVISION"
+
+    cd $SVN_ARCHIVES/
+    DEST=$PROJECT-$BRANCH
+    if test -n "$TAG"; then
+       DEST=$DEST-$TAG
+    fi
+    if test -d $DEST; then
+        cd $DEST
+        if test -n "$BRANCH"; then
+            svn cleanup
+            svn up
+        else
+            svn cleanup
+            svn up -r $REVISION
+        fi
+        cd ..
+    else
+        if test -n "$BRANCH"; then
+            svn co $URL $DEST
+        else
+            svn co -r $REVISION $URL $DEST
+        fi
+    fi
+    rm -rf ../$TARGET
+    rsync -r --exclude=.svn $DEST/ ../$TARGET
+    cd ..
+}
+
+if test -n "$BRANCH"; then
+    REVISION=$(get_higher_revision)
+    # Do not use the revision when exporting branch. We consider that all the
+    # branch are sync
+    SVN_CMD="svn export"
+else
+    REVISION=$(LANG=C svn info $(get_svn_url llvm)|grep "^Revision:"|awk '{print $2}')
+    SVN_CMD="svn export -r $REVISION"
+fi
+
+if test -n "$RCRELEASE"; then
+    if test "$TAG" = "final"; then
+           VERSION=$EXACT_VERSION
+    else
+        VERSION=$EXACT_VERSION"~+"$TAG
+    fi
+    FULL_VERSION="llvm-toolchain-"$MAJOR_VERSION"_"$VERSION
+else
+    VERSION=$CURRENT_VERSION"~svn"$REVISION
+    if echo $BRANCH|grep -q release_; then
+       FULL_VERSION="llvm-toolchain-"$MAJOR_VERSION"_"$VERSION
+    else
+       FULL_VERSION="llvm-toolchain-snapshot_"$VERSION
+    fi
+fi
+
+mkdir -p $SVN_ARCHIVES
+
+# LLVM
+LLVM_TARGET=$FULL_VERSION
+checkout_sources llvm $(get_svn_url llvm $BRANCH $TAG) $LLVM_TARGET "$BRANCH" $REVISION
+tar jcf $FULL_VERSION.orig.tar.bz2 $LLVM_TARGET
+rm -rf $LLVM_TARGET
+
+
+# Clang
+CLANG_TARGET=clang_$VERSION
+checkout_sources clang $(get_svn_url cfe $BRANCH $TAG) $CLANG_TARGET "$BRANCH" $REVISION
+tar jcf $FULL_VERSION.orig-clang.tar.bz2 $CLANG_TARGET
+rm -rf $CLANG_TARGET
+
+
+# Clang extra
+CLANG_TARGET=clang-tools-extra_$VERSION
+checkout_sources clang-tools-extra $(get_svn_url clang-tools-extra $BRANCH $TAG) $CLANG_TARGET "$BRANCH" $REVISION
+tar jcf $FULL_VERSION.orig-clang-tools-extra.tar.bz2 $CLANG_TARGET
+rm -rf $CLANG_TARGET
+
+# Compiler-rt
+COMPILER_RT_TARGET=compiler-rt_$VERSION
+checkout_sources compiler-rt $(get_svn_url compiler-rt $BRANCH $TAG) $COMPILER_RT_TARGET "$BRANCH" $REVISION
+#$SVN_CMD $(get_svn_url compiler-rt $BRANCH $TAG) $COMPILER_RT_TARGET
+tar jcf $FULL_VERSION.orig-compiler-rt.tar.bz2 $COMPILER_RT_TARGET
+rm -rf $COMPILER_RT_TARGET
+
+# Polly
+POLLY_TARGET=polly_$VERSION
+checkout_sources polly $(get_svn_url polly $BRANCH $TAG) $POLLY_TARGET "$BRANCH" $REVISION
+#$SVN_CMD $(get_svn_url polly $BRANCH $TAG) $POLLY_TARGET
+rm -rf $POLLY_TARGET/www $POLLY_TARGET/autoconf/config.sub $POLLY_TARGET/autoconf/config.guess
+tar jcf $FULL_VERSION.orig-polly.tar.bz2 $POLLY_TARGET
+rm -rf $POLLY_TARGET
+
+# LLD
+LLD_TARGET=lld_$VERSION
+checkout_sources lld $(get_svn_url lld $BRANCH $TAG) $LLD_TARGET "$BRANCH" $REVISION
+#$SVN_CMD $(get_svn_url lld $BRANCH $TAG) $LLD_TARGET
+rm -rf $LLD_TARGET/www/
+tar jcf $FULL_VERSION.orig-lld.tar.bz2 $LLD_TARGET
+rm -rf $LLD_TARGET
+
+# LLDB
+LLDB_TARGET=lldb_$VERSION
+checkout_sources lldb $(get_svn_url lldb $BRANCH $TAG) $LLDB_TARGET "$BRANCH" $REVISION
+#$SVN_CMD $(get_svn_url lldb $BRANCH $TAG) $LLDB_TARGET
+rm -rf $LLDB_TARGET/www/
+tar jcf $FULL_VERSION.orig-lldb.tar.bz2 $LLDB_TARGET
+rm -rf $LLDB_TARGET
+
+# OPENMP
+OPENMP_TARGET=openmp_$VERSION
+checkout_sources openmp $(get_svn_url openmp $BRANCH $TAG) $OPENMP_TARGET "$BRANCH" $REVISION
+rm -rf $OPENMP_TARGET/www/
+tar jcf $FULL_VERSION.orig-openmp.tar.bz2 $OPENMP_TARGET
+rm -rf $OPENMP_TARGET
+
+# LIBCXX
+LIBCXX_TARGET=libcxx_$VERSION
+checkout_sources libcxx $(get_svn_url libcxx $BRANCH $TAG) $LIBCXX_TARGET "$BRANCH" $REVISION
+rm -rf $LIBCXX_TARGET/www/
+tar jcf $FULL_VERSION.orig-libcxx.tar.bz2 $LIBCXX_TARGET
+rm -rf $LIBCXX_TARGET
+
+# LIBCXXABI
+LIBCXXABI_TARGET=libcxxabi_$VERSION
+checkout_sources libcxxabi $(get_svn_url libcxxabi $BRANCH $TAG) $LIBCXXABI_TARGET "$BRANCH" $REVISION
+rm -rf $LIBCXXABI_TARGET/www/
+tar jcf $FULL_VERSION.orig-libcxxabi.tar.bz2 $LIBCXXABI_TARGET
+rm -rf $LIBCXXABI_TARGET
+
+
+PATH_DEBIAN="$(pwd)/$(dirname $0)/../"
+echo "going into $PATH_DEBIAN"
+export DEBFULLNAME="Sylvestre Ledru"
+export DEBEMAIL="sylvestre@debian.org"
+cd $PATH_DEBIAN
+
+if test -z "$DISTRIBUTION"; then
+    DISTRIBUTION="experimental"
+fi
+
+if test -n "$RCRELEASE" -o -n "$BRANCH"; then
+    EXTRA_DCH_FLAGS="--force-bad-version --allow-lower-version"
+fi
+
+dch $EXTRA_DCH_FLAGS --distribution $DISTRIBUTION --newversion 1:$VERSION-1~exp1 "New snapshot release"
+
+exit 0
diff --git a/patches/0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch b/patches/0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch
new file mode 100644 (file)
index 0000000..1aa8791
--- /dev/null
@@ -0,0 +1,34 @@
+From d0d969074f6e0f975ad53d21e7ce6c7b40cf2957 Mon Sep 17 00:00:00 2001
+From: Peter Wu <peter@lekensteyn.nl>
+Date: Fri, 4 May 2018 15:43:06 +0200
+Subject: [PATCH] [llvm] cmake: resolve symlinks in LLVMConfig.cmake
+
+Ensure that symlinks such as /usr/lib/llvm-X.Y/cmake (pointing to
+lib/cmake/llvm) are resolved. This ensures that LLVM_INSTALL_PREFIX
+becomes /usr/lib/llvm-X.Y instead of /usr.
+
+Partially addresses PR37128
+---
+ cmake/modules/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
+index 6074e835859..1cf4569b884 100644
+--- a/cmake/modules/CMakeLists.txt
++++ b/cmake/modules/CMakeLists.txt
+@@ -76,10 +76,10 @@ file(COPY .
+ # Generate LLVMConfig.cmake for the install tree.
+ set(LLVM_CONFIG_CODE "
+ # Compute the installation prefix from this LLVMConfig.cmake file location.
+-get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
++get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
+ # Construct the proper number of get_filename_component(... PATH)
+ # calls to compute the installation prefix.
+-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
++string(REGEX REPLACE "/" ";" _count "prefix/${LLVM_INSTALL_PACKAGE_DIR}")
+ foreach(p ${_count})
+   set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
+ get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
+-- 
+2.17.0
+
diff --git a/patches/0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch b/patches/0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
new file mode 100644 (file)
index 0000000..dca84e3
--- /dev/null
@@ -0,0 +1,34 @@
+From c830d84bc802ca1e9219415a5784c4ad97a34819 Mon Sep 17 00:00:00 2001
+From: Peter Wu <peter@lekensteyn.nl>
+Date: Fri, 4 May 2018 15:55:26 +0200
+Subject: [PATCH] [clang] cmake: resolve symlinks in ClangConfig.cmake
+
+Ensure that symlinks such as /usr/lib/cmake/clang-X.Y (pointing to
+/usr/lib/llvm-X.Y/lib/cmake/llvm) are resolved. This ensures that
+CLANG_INSTALL_PREFIX ends up to be /usr/lib/llvm-X.Y instead of /usr.
+
+Partially addresses PR37128
+---
+ cmake/modules/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
+index be6d1d7257..bcb61f6cc8 100644
+--- a/clang/cmake/modules/CMakeLists.txt
++++ b/clang/cmake/modules/CMakeLists.txt
+@@ -30,10 +30,10 @@ set(CLANG_CONFIG_EXPORTS_FILE)
+ # Generate ClangConfig.cmake for the install tree.
+ set(CLANG_CONFIG_CODE "
+ # Compute the installation prefix from this LLVMConfig.cmake file location.
+-get_filename_component(CLANG_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
++get_filename_component(CLANG_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
+ # Construct the proper number of get_filename_component(... PATH)
+ # calls to compute the installation prefix.
+-string(REGEX REPLACE "/" ";" _count "${CLANG_INSTALL_PACKAGE_DIR}")
++string(REGEX REPLACE "/" ";" _count "prefix/${CLANG_INSTALL_PACKAGE_DIR}")
+ foreach(p ${_count})
+   set(CLANG_CONFIG_CODE "${CLANG_CONFIG_CODE}
+ get_filename_component(CLANG_INSTALL_PREFIX \"\${CLANG_INSTALL_PREFIX}\" PATH)")
+-- 
+2.17.0
+
diff --git a/patches/0003-Debian-version-info-and-bugreport.patch b/patches/0003-Debian-version-info-and-bugreport.patch
new file mode 100644 (file)
index 0000000..6c8a1d5
--- /dev/null
@@ -0,0 +1,19 @@
+---
+ lib/Support/CommandLine.cpp |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: llvm-toolchain-snapshot_5.0~svn296106/lib/Support/CommandLine.cpp
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn296106.orig/lib/Support/CommandLine.cpp
++++ llvm-toolchain-snapshot_5.0~svn296106/lib/Support/CommandLine.cpp
+@@ -2064,6 +2064,10 @@ public:
+     OS << " " << LLVM_VERSION_INFO;
+ #endif
+     OS << "\n  ";
++#ifdef LLVM_DEBIAN_INFO
++    OS << LLVM_DEBIAN_INFO;
++#endif
++    OS << "\n  ";
+ #ifndef __OPTIMIZE__
+     OS << "DEBUG build";
+ #else
diff --git a/patches/0044-soname.diff b/patches/0044-soname.diff
new file mode 100644 (file)
index 0000000..89b2392
--- /dev/null
@@ -0,0 +1,30 @@
+---
+ clang/tools/libclang/CMakeLists.txt |    2 +-
+ tools/llvm-shlib/CMakeLists.txt     |    1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+Index: llvm-toolchain-snapshot_6.0~svn309319/clang/tools/libclang/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn309319.orig/clang/tools/libclang/CMakeLists.txt
++++ llvm-toolchain-snapshot_6.0~svn309319/clang/tools/libclang/CMakeLists.txt
+@@ -84,7 +84,7 @@ else()
+   set(output_name "clang")
+ endif()
+-add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC}
++add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} SONAME
+   OUTPUT_NAME ${output_name}
+   ${SOURCES}
+   DEPENDS clang-headers
+Index: llvm-toolchain-snapshot_6.0~svn309319/tools/llvm-shlib/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn309319.orig/tools/llvm-shlib/CMakeLists.txt
++++ llvm-toolchain-snapshot_6.0~svn309319/tools/llvm-shlib/CMakeLists.txt
+@@ -35,6 +35,7 @@ if(LLVM_DYLIB_EXPORTED_SYMBOL_FILE)
+ endif()
+ add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
++set_property(TARGET LLVM PROPERTY VERSION "1") # Append .1 to SONAME
+ list(REMOVE_DUPLICATES LIB_NAMES)
+ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
diff --git a/patches/0048-Set-html_static_path-_static-everywhere.patch b/patches/0048-Set-html_static_path-_static-everywhere.patch
new file mode 100644 (file)
index 0000000..10663a8
--- /dev/null
@@ -0,0 +1,63 @@
+From: Nicholas D Steeves <nsteeves@gmail.com>
+Date: Sat, 10 Feb 2018 21:00:55 -0500
+Subject: Set html_static_path = ['_static'] everywhere.
+
+---
+ clang-tools-extra/docs/conf.py | 2 +-
+ clang/docs/analyzer/conf.py    | 2 +-
+ clang/docs/conf.py             | 2 +-
+ polly/docs/conf.py             | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/clang-tools-extra/docs/conf.py b/clang-tools-extra/docs/conf.py
+index e872c55..69f425a 100644
+--- a/clang-tools-extra/docs/conf.py
++++ b/clang-tools-extra/docs/conf.py
+@@ -121,7 +121,7 @@ html_theme = 'haiku'
+ # Add any paths that contain custom static files (such as style sheets) here,
+ # relative to this directory. They are copied after the builtin static files,
+ # so a file named "default.css" will overwrite the builtin "default.css".
+-html_static_path = []
++html_static_path = ['_static']
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+diff --git a/clang/docs/analyzer/conf.py b/clang/docs/analyzer/conf.py
+index c40af7a..666308d 100644
+--- a/clang/docs/analyzer/conf.py
++++ b/clang/docs/analyzer/conf.py
+@@ -121,7 +121,7 @@ html_theme = 'haiku'
+ # Add any paths that contain custom static files (such as style sheets) here,
+ # relative to this directory. They are copied after the builtin static files,
+ # so a file named "default.css" will overwrite the builtin "default.css".
+-html_static_path = []
++html_static_path = ['_static']
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+diff --git a/clang/docs/conf.py b/clang/docs/conf.py
+index a9861cd..d125dc6 100644
+--- a/clang/docs/conf.py
++++ b/clang/docs/conf.py
+@@ -121,7 +121,7 @@ html_theme = 'haiku'
+ # Add any paths that contain custom static files (such as style sheets) here,
+ # relative to this directory. They are copied after the builtin static files,
+ # so a file named "default.css" will overwrite the builtin "default.css".
+-html_static_path = []
++html_static_path = ['_static']
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+diff --git a/polly/docs/conf.py b/polly/docs/conf.py
+index 64d3968..aa854ad 100644
+--- a/polly/docs/conf.py
++++ b/polly/docs/conf.py
+@@ -127,7 +127,7 @@ except ImportError:
+ # Add any paths that contain custom static files (such as style sheets) here,
+ # relative to this directory. They are copied after the builtin static files,
+ # so a file named "default.css" will overwrite the builtin "default.css".
+-html_static_path = []
++html_static_path = ['_static']
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
diff --git a/patches/0049-Use-Debian-provided-MathJax-everywhere.patch b/patches/0049-Use-Debian-provided-MathJax-everywhere.patch
new file mode 100644 (file)
index 0000000..02fa4db
--- /dev/null
@@ -0,0 +1,109 @@
+From: Nicholas D Steeves <nsteeves@gmail.com>
+Date: Sat, 10 Feb 2018 21:02:17 -0500
+Subject: Use Debian-provided MathJax everywhere.
+
+---
+ clang-tools-extra/docs/Doxyfile       | 2 +-
+ clang-tools-extra/docs/conf.py        | 3 +++
+ clang-tools-extra/docs/doxygen.cfg.in | 2 +-
+ clang/docs/analyzer/conf.py           | 3 +++
+ clang/docs/conf.py                    | 3 +++
+ clang/docs/doxygen.cfg.in             | 2 +-
+ docs/doxygen.cfg.in                   | 2 +-
+ polly/docs/doxygen.cfg.in             | 2 +-
+ 8 files changed, 14 insertions(+), 5 deletions(-)
+
+Index: llvm-toolchain-snapshot_7~svn336327/clang-tools-extra/docs/conf.py
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/clang-tools-extra/docs/conf.py
++++ llvm-toolchain-snapshot_7~svn336327/clang-tools-extra/docs/conf.py
+@@ -123,6 +123,9 @@ html_theme = 'haiku'
+ # so a file named "default.css" will overwrite the builtin "default.css".
+ html_static_path = ['_static']
++# Use Debian-provided MathJax
++mathjax_path = '/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
++
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+ #html_last_updated_fmt = '%b %d, %Y'
+Index: llvm-toolchain-snapshot_7~svn336327/clang-tools-extra/docs/doxygen.cfg.in
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/clang-tools-extra/docs/doxygen.cfg.in
++++ llvm-toolchain-snapshot_7~svn336327/clang-tools-extra/docs/doxygen.cfg.in
+@@ -1443,7 +1443,7 @@ MATHJAX_FORMAT         = HTML-CSS
+ # The default value is: http://cdn.mathjax.org/mathjax/latest.
+ # This tag requires that the tag USE_MATHJAX is set to YES.
+-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
++MATHJAX_RELPATH        = /usr/share/javascript/mathjax
+ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+ # extension names that should be enabled during MathJax rendering. For example
+Index: llvm-toolchain-snapshot_7~svn336327/clang/docs/analyzer/conf.py
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/clang/docs/analyzer/conf.py
++++ llvm-toolchain-snapshot_7~svn336327/clang/docs/analyzer/conf.py
+@@ -123,6 +123,9 @@ html_theme = 'haiku'
+ # so a file named "default.css" will overwrite the builtin "default.css".
+ html_static_path = ['_static']
++# Use Debian-provided MathJax
++mathjax_path = '/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
++
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+ #html_last_updated_fmt = '%b %d, %Y'
+Index: llvm-toolchain-snapshot_7~svn336327/clang/docs/conf.py
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/clang/docs/conf.py
++++ llvm-toolchain-snapshot_7~svn336327/clang/docs/conf.py
+@@ -123,6 +123,9 @@ html_theme = 'haiku'
+ # so a file named "default.css" will overwrite the builtin "default.css".
+ html_static_path = ['_static']
++# Use Debian-provided MathJax
++mathjax_path = '/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
++
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+ #html_last_updated_fmt = '%b %d, %Y'
+Index: llvm-toolchain-snapshot_7~svn336327/clang/docs/doxygen.cfg.in
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/clang/docs/doxygen.cfg.in
++++ llvm-toolchain-snapshot_7~svn336327/clang/docs/doxygen.cfg.in
+@@ -1432,7 +1432,7 @@ MATHJAX_FORMAT         = HTML-CSS
+ # The default value is: http://cdn.mathjax.org/mathjax/latest.
+ # This tag requires that the tag USE_MATHJAX is set to YES.
+-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
++MATHJAX_RELPATH        = /usr/share/javascript/mathjax
+ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+ # extension names that should be enabled during MathJax rendering. For example
+Index: llvm-toolchain-snapshot_7~svn336327/docs/doxygen.cfg.in
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/docs/doxygen.cfg.in
++++ llvm-toolchain-snapshot_7~svn336327/docs/doxygen.cfg.in
+@@ -1433,7 +1433,7 @@ MATHJAX_FORMAT         = HTML-CSS
+ # The default value is: http://cdn.mathjax.org/mathjax/latest.
+ # This tag requires that the tag USE_MATHJAX is set to YES.
+-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
++MATHJAX_RELPATH        = /usr/share/javascript/mathjax
+ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+ # extension names that should be enabled during MathJax rendering. For example
+Index: llvm-toolchain-snapshot_7~svn336327/polly/docs/doxygen.cfg.in
+===================================================================
+--- llvm-toolchain-snapshot_7~svn336327.orig/polly/docs/doxygen.cfg.in
++++ llvm-toolchain-snapshot_7~svn336327/polly/docs/doxygen.cfg.in
+@@ -1433,7 +1433,7 @@ MATHJAX_FORMAT         = HTML-CSS
+ # The default value is: http://cdn.mathjax.org/mathjax/latest.
+ # This tag requires that the tag USE_MATHJAX is set to YES.
+-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
++MATHJAX_RELPATH        = /usr/share/javascript/mathjax
+ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+ # extension names that should be enabled during MathJax rendering. For example
diff --git a/patches/19-clang_debian_version.patch b/patches/19-clang_debian_version.patch
new file mode 100644 (file)
index 0000000..c530e14
--- /dev/null
@@ -0,0 +1,21 @@
+Index: llvm-toolchain-snapshot_3.5~svn210337/clang/lib/Basic/Version.cpp
+===================================================================
+--- llvm-toolchain-snapshot_3.5~svn210337.orig/clang/lib/Basic/Version.cpp
++++ llvm-toolchain-snapshot_3.5~svn210337/clang/lib/Basic/Version.cpp
+@@ -15,6 +15,7 @@
+ #include "clang/Basic/LLVM.h"
+ #include "clang/Config/config.h"
+ #include "llvm/Support/raw_ostream.h"
++#include "clang/Debian/debian_path.h"
+ #include <cstdlib>
+ #include <cstring>
+@@ -125,7 +126,7 @@ std::string getClangToolFullVersion(Stri
+ #ifdef CLANG_VENDOR
+   OS << CLANG_VENDOR;
+ #endif
+-  OS << ToolName << " version " CLANG_VERSION_STRING " "
++  OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION " "
+      << getClangFullRepositoryVersion();
+   // If vendor supplied, include the base LLVM version as well.
diff --git a/patches/23-strlcpy_strlcat_warning_removed.diff b/patches/23-strlcpy_strlcat_warning_removed.diff
new file mode 100644 (file)
index 0000000..e25c44d
--- /dev/null
@@ -0,0 +1,207 @@
+---
+ clang/include/clang/Basic/Builtins.def                    |    8 +-
+ clang/lib/AST/Decl.cpp                                    |   12 +--
+ clang/lib/Sema/SemaChecking.cpp                           |   11 +-
+ clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp |    6 -
+ clang/test/Sema/builtins.c                                |   11 +-
+ clang/test/Sema/warn-strlcpycat-size.c                    |   55 --------------
+ 6 files changed, 25 insertions(+), 78 deletions(-)
+
+Index: llvm-toolchain-7_7~+rc1/clang/include/clang/Basic/Builtins.def
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/include/clang/Basic/Builtins.def
++++ llvm-toolchain-7_7~+rc1/clang/include/clang/Basic/Builtins.def
+@@ -503,8 +503,8 @@ BUILTIN(__builtin___memset_chk, "v*v*izz
+ BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF")
+ BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF")
+ BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF")
+-BUILTIN(__builtin___strlcat_chk, "zc*cC*zz", "nF")
+-BUILTIN(__builtin___strlcpy_chk, "zc*cC*zz", "nF")
++//BUILTIN(__builtin___strlcat_chk, "zc*cC*zz", "nF")
++//BUILTIN(__builtin___strlcpy_chk, "zc*cC*zz", "nF")
+ BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF")
+ BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF")
+ BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz", "nF")
+@@ -952,8 +952,8 @@ LIBBUILTIN(getcontext, "iK*",     "fj",
+ LIBBUILTIN(_longjmp, "vJi",       "fr",    "setjmp.h", ALL_GNU_LANGUAGES)
+ LIBBUILTIN(siglongjmp, "vSJi",    "fr",    "setjmp.h", ALL_GNU_LANGUAGES)
+ // non-standard but very common
+-LIBBUILTIN(strlcpy, "zc*cC*z",    "f",     "string.h", ALL_GNU_LANGUAGES)
+-LIBBUILTIN(strlcat, "zc*cC*z",    "f",     "string.h", ALL_GNU_LANGUAGES)
++//LIBBUILTIN(strlcpy, "zc*cC*z",    "f",     "string.h", ALL_GNU_LANGUAGES)
++//LIBBUILTIN(strlcat, "zc*cC*z",    "f",     "string.h", ALL_GNU_LANGUAGES)
+ //   id objc_msgSend(id, SEL, ...)
+ LIBBUILTIN(objc_msgSend, "GGH.",   "f",     "objc/message.h", OBJC_LANG)
+ // long double objc_msgSend_fpret(id self, SEL op, ...)
+Index: llvm-toolchain-7_7~+rc1/clang/lib/AST/Decl.cpp
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/lib/AST/Decl.cpp
++++ llvm-toolchain-7_7~+rc1/clang/lib/AST/Decl.cpp
+@@ -3591,13 +3591,13 @@ unsigned FunctionDecl::getMemoryFunction
+   case Builtin::BImemmove:
+     return Builtin::BImemmove;
+-  case Builtin::BIstrlcpy:
+-  case Builtin::BI__builtin___strlcpy_chk:
+-    return Builtin::BIstrlcpy;
++//  case Builtin::BIstrlcpy:
++//  case Builtin::BI__builtin___strlcpy_chk:
++//    return Builtin::BIstrlcpy;
+-  case Builtin::BIstrlcat:
+-  case Builtin::BI__builtin___strlcat_chk:
+-    return Builtin::BIstrlcat;
++//  case Builtin::BIstrlcat:
++//  case Builtin::BI__builtin___strlcat_chk:
++//    return Builtin::BIstrlcat;
+   case Builtin::BI__builtin_memcmp:
+   case Builtin::BImemcmp:
+Index: llvm-toolchain-7_7~+rc1/clang/lib/Sema/SemaChecking.cpp
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/lib/Sema/SemaChecking.cpp
++++ llvm-toolchain-7_7~+rc1/clang/lib/Sema/SemaChecking.cpp
+@@ -1224,8 +1224,8 @@ Sema::CheckBuiltinFunctionCall(FunctionD
+   case Builtin::BI__builtin___memcpy_chk:
+   case Builtin::BI__builtin___memmove_chk:
+   case Builtin::BI__builtin___memset_chk:
+-  case Builtin::BI__builtin___strlcat_chk:
+-  case Builtin::BI__builtin___strlcpy_chk:
++//  case Builtin::BI__builtin___strlcat_chk:
++//  case Builtin::BI__builtin___strlcpy_chk:
+   case Builtin::BI__builtin___strncat_chk:
+   case Builtin::BI__builtin___strncpy_chk:
+   case Builtin::BI__builtin___stpncpy_chk:
+@@ -4064,9 +4064,10 @@ bool Sema::CheckFunctionCall(FunctionDec
+     return false;
+   // Handle memory setting and copying functions.
+-  if (CMId == Builtin::BIstrlcpy || CMId == Builtin::BIstrlcat)
+-    CheckStrlcpycatArguments(TheCall, FnInfo);
+-  else if (CMId == Builtin::BIstrncat)
++//  if (CMId == Builtin::BIstrlcpy || CMId == Builtin::BIstrlcat)
++//    CheckStrlcpycatArguments(TheCall, FnInfo);
++//  else
++  if (CMId == Builtin::BIstrncat)
+     CheckStrncatArguments(TheCall, FnInfo);
+   else
+     CheckMemaccessArguments(TheCall, CMId, FnInfo);
+Index: llvm-toolchain-7_7~+rc1/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
++++ llvm-toolchain-7_7~+rc1/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+@@ -240,9 +240,9 @@ GenericTaintChecker::TaintPropagationRul
+     case Builtin::BIstrncpy:
+     case Builtin::BIstrncat:
+       return TaintPropagationRule(1, 2, 0, true);
+-    case Builtin::BIstrlcpy:
+-    case Builtin::BIstrlcat:
+-      return TaintPropagationRule(1, 2, 0, false);
++//    case Builtin::BIstrlcpy:
++//    case Builtin::BIstrlcat:
++//      return TaintPropagationRule(1, 2, 0, false);
+     case Builtin::BIstrndup:
+       return TaintPropagationRule(0, 1, ReturnValueIndex);
+Index: llvm-toolchain-7_7~+rc1/clang/test/Sema/builtins.c
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/test/Sema/builtins.c
++++ llvm-toolchain-7_7~+rc1/clang/test/Sema/builtins.c
+@@ -190,11 +190,11 @@ void test18() {
+   ptr = __builtin___memccpy_chk(dst, src, '\037', sizeof(src), sizeof(dst));
+   result = __builtin___strlcpy_chk(dst, src, sizeof(dst), sizeof(dst));
+-  result = __builtin___strlcat_chk(dst, src, sizeof(dst), sizeof(dst));
++//  result = __builtin___strlcat_chk(dst, src, sizeof(dst), sizeof(dst));
+   ptr = __builtin___memccpy_chk(dst, src, '\037', sizeof(src));      // expected-error {{too few arguments to function call}}
+   ptr = __builtin___strlcpy_chk(dst, src, sizeof(dst), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
+-  ptr = __builtin___strlcat_chk(dst, src, sizeof(dst), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
++//  ptr = __builtin___strlcat_chk(dst, src, sizeof(dst), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
+ }
+ void no_ms_builtins() {
+@@ -209,12 +209,12 @@ void unavailable() {
+ }
+ // rdar://18259539
+-size_t strlcpy(char * restrict dst, const char * restrict src, size_t size);
+-size_t strlcat(char * restrict dst, const char * restrict src, size_t size);
++//size_t strlcpy(char * restrict dst, const char * restrict src, size_t size);
++//size_t strlcat(char * restrict dst, const char * restrict src, size_t size);
+ void Test19(void)
+ {
+-        static char b[40];
++/*        static char b[40];
+         static char buf[20];
+         strlcpy(buf, b, sizeof(b)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} \\
+@@ -229,6 +229,7 @@ void Test19(void)
+         __builtin___strlcat_chk(buf, b, sizeof(b), __builtin_object_size(buf, 0)); // expected-warning {{size argument in '__builtin___strlcat_chk' call appears to be size of the source; expected the size of the destination}} \
+                                                                                    // expected-note {{change size argument to be the size of the destination}} \
+                                                                                  // expected-warning {{'__builtin___strlcat_chk' will always overflow destination buffer}}
++                                                                   */
+ }
+ // rdar://11076881
+Index: llvm-toolchain-7_7~+rc1/clang/test/Sema/warn-strlcpycat-size.c
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/test/Sema/warn-strlcpycat-size.c
++++ /dev/null
+@@ -1,55 +0,0 @@
+-// RUN: %clang_cc1 -Wstrlcpy-strlcat-size -verify -fsyntax-only %s
+-
+-typedef __SIZE_TYPE__ size_t;
+-size_t strlcpy (char * restrict dst, const char * restrict src, size_t size);
+-size_t strlcat (char * restrict dst, const char * restrict src, size_t size);
+-size_t strlen (const char *s);
+-
+-char s1[100];
+-char s2[200];
+-char * s3;
+-
+-struct {
+-  char f1[100];
+-  char f2[100][3];
+-} s4, **s5;
+-
+-int x;
+-
+-void f(void)
+-{
+-  strlcpy(s1, s2, sizeof(s1)); // no warning
+-  strlcpy(s1, s2, sizeof(s2)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
+-  strlcpy(s1, s3, strlen(s3)+1); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
+-  strlcat(s2, s3, sizeof(s3)); // expected-warning {{size argument in 'strlcat' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
+-  strlcpy(s4.f1, s2, sizeof(s2)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
+-  strlcpy((*s5)->f2[x], s2, sizeof(s2)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
+-  strlcpy(s1+3, s2, sizeof(s2)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}}
+-}
+-
+-// Don't issue FIXIT for flexible arrays.
+-struct S {
+-  int y; 
+-  char x[];
+-};
+-
+-void flexible_arrays(struct S *s) {
+-  char str[] = "hi";
+-  strlcpy(s->x, str, sizeof(str));  // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}}
+-}
+-
+-// Don't issue FIXIT for destinations of size 1.
+-void size_1() {
+-  char z[1];
+-  char str[] = "hi";
+-
+-  strlcpy(z, str, sizeof(str));  // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}}
+-}
+-
+-// Support VLAs.
+-void vlas(int size) {
+-  char z[size];
+-  char str[] = "hi";
+-
+-  strlcpy(z, str, sizeof(str)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
+-}
diff --git a/patches/26-set-correct-float-abi.diff b/patches/26-set-correct-float-abi.diff
new file mode 100644 (file)
index 0000000..c7fe931
--- /dev/null
@@ -0,0 +1,33 @@
+Description: set correct float abi settings for armel and armhf
+ debian armel supports systems that don't have a fpu so should use a "float abi"
+ setting of soft by default.
+ Debian armhf needs a float abi setting of "hard"
+Author: Peter Michael Green <plugwash@debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+Index: llvm-toolchain-snapshot_5.0~svn297449/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn297449.orig/clang/lib/Driver/ToolChains/Arch/ARM.cpp
++++ llvm-toolchain-snapshot_5.0~svn297449/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+@@ -206,7 +206,7 @@ arm::FloatABI arm::getARMFloatABI(const
+       case llvm::Triple::MuslEABI:
+       case llvm::Triple::EABI:
+         // EABI is always AAPCS, and if it was not marked 'hard', it's softfp
+-        ABI = FloatABI::SoftFP;
++        ABI = FloatABI::Soft;
+         break;
+       case llvm::Triple::Android:
+         ABI = (SubArch == 7) ? FloatABI::SoftFP : FloatABI::Soft;
diff --git a/patches/27-fix_clang_stdint.diff b/patches/27-fix_clang_stdint.diff
new file mode 100644 (file)
index 0000000..f1c751f
--- /dev/null
@@ -0,0 +1,29 @@
+Index: llvm-toolchain-snapshot_5.0~svn301630/clang/lib/Headers/stdint.h
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn301630.orig/clang/lib/Headers/stdint.h
++++ llvm-toolchain-snapshot_5.0~svn301630/clang/lib/Headers/stdint.h
+@@ -22,8 +22,6 @@
+  *
+ \*===----------------------------------------------------------------------===*/
+-#ifndef __CLANG_STDINT_H
+-#define __CLANG_STDINT_H
+ /* If we're hosted, fall back to the system's stdint.h, which might have
+  * additional definitions.
+@@ -72,6 +70,8 @@
+ # endif
+ #else
++#ifndef __CLANG_STDINT_H
++#define __CLANG_STDINT_H
+ /* C99 7.18.1.1 Exact-width integer types.
+  * C99 7.18.1.2 Minimum-width integer types.
+@@ -700,5 +700,5 @@ typedef __UINTMAX_TYPE__ uintmax_t;
+ #define  INTMAX_C(v) __int_c(v,  __INTMAX_C_SUFFIX__)
+ #define UINTMAX_C(v) __int_c(v, __UINTMAX_C_SUFFIX__)
+-#endif /* __STDC_HOSTED__ */
+ #endif /* __CLANG_STDINT_H */
++#endif /* __STDC_HOSTED__ */
diff --git a/patches/7.1.0/revert-change-soname-2.diff b/patches/7.1.0/revert-change-soname-2.diff
new file mode 100644 (file)
index 0000000..527e57d
--- /dev/null
@@ -0,0 +1,19 @@
+Index: llvm-toolchain-7_7.1.0~svn353565/cmake/modules/AddLLVM.cmake
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/cmake/modules/AddLLVM.cmake
++++ llvm-toolchain-7_7.1.0~svn353565/cmake/modules/AddLLVM.cmake
+@@ -498,11 +498,9 @@ function(llvm_add_library name)
+     if(UNIX AND NOT APPLE AND NOT ARG_SONAME)
+       set_target_properties(${name}
+         PROPERTIES
+-              # Concatenate the version numbers since ldconfig expects exactly
+-              # one component indicating the ABI version, while LLVM uses
+-              # major+minor for that.
+-        SOVERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}
+-        VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
++        # Since 4.0.0, the ABI version is indicated by the major version
++        SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}
++        VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
+     endif()
+   endif()
diff --git a/patches/7.1.0/revert-change-soname.diff b/patches/7.1.0/revert-change-soname.diff
new file mode 100644 (file)
index 0000000..d991279
--- /dev/null
@@ -0,0 +1,56 @@
+Index: llvm-toolchain-7_7.1.0~svn353565/docs/ReleaseNotes.rst
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/docs/ReleaseNotes.rst
++++ llvm-toolchain-7_7.1.0~svn353565/docs/ReleaseNotes.rst
+@@ -30,6 +30,9 @@ Non-comprehensive list of changes in thi
+   is available on the Visual Studio Marketplace. The new integration
+   supports Visual Studio 2017.
++* Libraries have been renamed from 7.0 to 7. This change also impacts
++  downstream libraries like lldb.
++
+ * The LoopInstSimplify pass (``-loop-instsimplify``) has been removed.
+ * Symbols starting with ``?`` are no longer mangled by LLVM when using the
+Index: llvm-toolchain-7_7.1.0~svn353565/tools/llvm-config/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/tools/llvm-config/CMakeLists.txt
++++ llvm-toolchain-7_7.1.0~svn353565/tools/llvm-config/CMakeLists.txt
+@@ -37,7 +37,7 @@ set(LLVM_CFLAGS "${LLVM_DEFINITIONS}")
+ set(LLVM_CXXFLAGS "${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+ set(LLVM_BUILD_SYSTEM cmake)
+ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+-set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}")
++set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}")
+ set(LLVM_HAS_GLOBAL_ISEL "ON")
+ # Use the C++ link flags, since they should be a superset of C link flags.
+Index: llvm-toolchain-7_7.1.0~svn353565/tools/llvm-shlib/simple_version_script.map.in
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/tools/llvm-shlib/simple_version_script.map.in
++++ llvm-toolchain-7_7.1.0~svn353565/tools/llvm-shlib/simple_version_script.map.in
+@@ -1 +1 @@
+-LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; };
++LLVM_@LLVM_VERSION_MAJOR@ { global: *; };
+Index: llvm-toolchain-7_7.1.0~svn353565/cmake/modules/AddLLVM.cmake
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/cmake/modules/AddLLVM.cmake
++++ llvm-toolchain-7_7.1.0~svn353565/cmake/modules/AddLLVM.cmake
+@@ -83,7 +83,7 @@ function(add_llvm_symbol_exports target_
+     # FIXME: Don't write the "local:" line on OpenBSD.
+     # in the export file, also add a linker script to version LLVM symbols (form: LLVM_N.M)
+     add_custom_command(OUTPUT ${native_export_file}
+-      COMMAND echo "LLVM_${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR} {" > ${native_export_file}
++      COMMAND echo "LLVM_${LLVM_VERSION_MAJOR} {" > ${native_export_file}
+       COMMAND grep -q "[[:alnum:]]" ${export_file} && echo "  global:" >> ${native_export_file} || :
+       COMMAND sed -e "s/$/;/" -e "s/^/    /" < ${export_file} >> ${native_export_file}
+       COMMAND echo "  local: *;" >> ${native_export_file}
+@@ -522,7 +522,7 @@ function(llvm_add_library name)
+       if(${output_name} STREQUAL "output_name-NOTFOUND")
+         set(output_name ${name})
+       endif()
+-      set(library_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX})
++      set(library_name ${output_name}-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
+       set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
+       set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name})
+       llvm_install_library_symlink(${api_name} ${library_name} SHARED
diff --git a/patches/AtomicExpand-Fix-a-crash-bug-when-lowering-unordered-loads.patch b/patches/AtomicExpand-Fix-a-crash-bug-when-lowering-unordered-loads.patch
new file mode 100644 (file)
index 0000000..0586cc1
--- /dev/null
@@ -0,0 +1,28 @@
+From 2153c4b8281c1e5f25887ef9183947198c50a9d2 Mon Sep 17 00:00:00 2001
+From: Philip Reames <listmail@philipreames.com>
+Date: Tue, 19 Mar 2019 17:20:49 +0000
+Subject: [PATCH] [AtomicExpand] Fix a crash bug when lowering unordered loads
+ to cmpxchg
+
+Add tests for wider atomic loads and stores.  In the process, fix a crasher where we appearently handled unorder stores, but not loads, when lowering to cmpxchg idioms.
+
+llvm-svn: 356482
+---
+ llvm/lib/CodeGen/AtomicExpandPass.cpp     |   3 +
+ llvm/test/CodeGen/X86/atomic-unordered.ll | 234 +++++++++++++++++++---
+ 2 files changed, 213 insertions(+), 24 deletions(-)
+
+diff --git a/lib/CodeGen/AtomicExpandPass.cpp b/lib/CodeGen/AtomicExpandPass.cpp
+index 10dd21d1ef9d..7a8013abccfb 100644
+--- a/lib/CodeGen/AtomicExpandPass.cpp
++++ b/lib/CodeGen/AtomicExpandPass.cpp
+@@ -430,6 +430,9 @@ bool AtomicExpand::expandAtomicLoadToLL(LoadInst *LI) {
+ bool AtomicExpand::expandAtomicLoadToCmpXchg(LoadInst *LI) {
+   IRBuilder<> Builder(LI);
+   AtomicOrdering Order = LI->getOrdering();
++  if (Order == AtomicOrdering::Unordered)
++    Order = AtomicOrdering::Monotonic;
++
+   Value *Addr = LI->getPointerOperand();
+   Type *Ty = cast<PointerType>(Addr->getType())->getElementType();
+   Constant *DummyVal = Constant::getNullValue(Ty);
diff --git a/patches/D51108-rust-powerpc.diff b/patches/D51108-rust-powerpc.diff
new file mode 100644 (file)
index 0000000..bb321ed
--- /dev/null
@@ -0,0 +1,65 @@
+Index: llvm-toolchain-7-7~+rc2/lib/Target/PowerPC/PPCISelLowering.cpp
+===================================================================
+--- llvm-toolchain-7-7~+rc2.orig/lib/Target/PowerPC/PPCISelLowering.cpp
++++ llvm-toolchain-7-7~+rc2/lib/Target/PowerPC/PPCISelLowering.cpp
+@@ -3480,9 +3480,14 @@ SDValue PPCTargetLowering::LowerFormalAr
+       // Argument stored in memory.
+       assert(VA.isMemLoc());
++      // Get the extended size of the argument type in stack
+       unsigned ArgSize = VA.getLocVT().getStoreSize();
+-      int FI = MFI.CreateFixedObject(ArgSize, VA.getLocMemOffset(),
+-                                     isImmutable);
++      // Get the actual size of the argument type
++      unsigned ObjSize = VA.getValVT().getStoreSize();
++      unsigned ArgOffset = VA.getLocMemOffset();
++      // Stack objects in PPC32 are right justified.
++      ArgOffset += ArgSize - ObjSize;
++      int FI = MFI.CreateFixedObject(ArgSize, ArgOffset, isImmutable);
+       // Create load nodes to retrieve arguments from the stack.
+       SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
+@@ -5437,10 +5442,11 @@ SDValue PPCTargetLowering::LowerCall_32S
+       Arg = PtrOff;
+     }
+-    if (VA.isRegLoc()) {
+-      if (Arg.getValueType() == MVT::i1)
+-        Arg = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i32, Arg);
++    // Ensure callee will get either 0x00000001 or 0x00000000.
++    if (Arg.getValueType() == MVT::i1)
++      Arg = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i32, Arg);
++    if (VA.isRegLoc()) {
+       seenFloatArg |= VA.getLocVT().isFloatingPoint();
+       // Put argument in a physical register.
+       RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
+Index: llvm-toolchain-7-7~+rc2/test/CodeGen/PowerPC/ppc32-i1-stack-arguments-abi-bug.ll
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7-7~+rc2/test/CodeGen/PowerPC/ppc32-i1-stack-arguments-abi-bug.ll
+@@ -0,0 +1,24 @@
++; RUN: llc -verify-machineinstrs < %s -mcpu=ppc32 -mattr=+crbits | FileCheck %s
++target triple = "powerpc-unknown-linux-gnu"
++
++define zeroext i1 @check_callee(
++  i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
++  i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
++  i1 zeroext %s1
++) {
++  call void @check_caller(
++    i1 zeroext true, i1 zeroext true, i1 zeroext true, i1 zeroext true,
++    i1 zeroext true, i1 zeroext true, i1 zeroext true, i1 zeroext true,
++    i1 zeroext %s1)
++  ret i1 true
++}
++
++; CHECK-LABEL: @check_callee
++; CHECK: lbz {{[0-9]+}}, 27(1)
++; CHECK: stw {{[0-9]+}}, 8(1)
++
++declare void @check_caller(
++  i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
++  i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext,
++  i1 zeroext
++)
diff --git a/patches/D52340-rustc-debuginfo.diff b/patches/D52340-rustc-debuginfo.diff
new file mode 100644 (file)
index 0000000..9a24aca
--- /dev/null
@@ -0,0 +1,32 @@
+Index: llvm-toolchain-7_7.0.1~svn352582/lib/Bitcode/Reader/MetadataLoader.cpp
+===================================================================
+--- llvm-toolchain-7_7.0.1~svn352582.orig/lib/Bitcode/Reader/MetadataLoader.cpp
++++ llvm-toolchain-7_7.0.1~svn352582/lib/Bitcode/Reader/MetadataLoader.cpp
+@@ -1308,7 +1308,7 @@ Error MetadataLoader::MetadataLoaderImpl
+                            (Context, Tag, Name, File, Line, Scope, BaseType,
+                             SizeInBits, AlignInBits, OffsetInBits, Flags,
+                             Elements, RuntimeLang, VTableHolder, TemplateParams,
+-                            Identifier));
++                            Identifier, Discriminator));
+     if (!IsNotUsedInTypeRef && Identifier)
+       MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
+Index: llvm-toolchain-7_7.0.1~svn352582/test/Assembler/debug-variant-discriminator.ll
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7_7.0.1~svn352582/test/Assembler/debug-variant-discriminator.ll
+@@ -0,0 +1,14 @@
++; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
++; RUN: verify-uselistorder %s
++
++; CHECK: !named = !{!0, !1, !2}
++!named = !{!0, !1, !2}
++
++; CHECK: !0 = !DICompositeType(tag: DW_TAG_structure_type, name: "Outer", size: 64, align: 64, identifier: "Outer")
++; CHECK-NEXT: !1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
++; CHECK-NEXT: !2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
++; CHECK-NEXT: !3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
++!0 = !DICompositeType(tag: DW_TAG_structure_type, name: "Outer", size: 64, align: 64, identifier: "Outer")
++!1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
++!2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
++!3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
diff --git a/patches/D71028-mips-atomics-rust-test.diff b/patches/D71028-mips-atomics-rust-test.diff
new file mode 100644 (file)
index 0000000..4ce402a
--- /dev/null
@@ -0,0 +1,5487 @@
+Index: llvm/lib/Target/Mips/Mips64InstrInfo.td
+===================================================================
+--- llvm/lib/Target/Mips/Mips64InstrInfo.td
++++ llvm/lib/Target/Mips/Mips64InstrInfo.td
+@@ -83,6 +83,10 @@
+   def ATOMIC_LOAD_NAND_I64 : Atomic2Ops<atomic_load_nand_64, GPR64>;
+   def ATOMIC_SWAP_I64      : Atomic2Ops<atomic_swap_64, GPR64>;
+   def ATOMIC_CMP_SWAP_I64  : AtomicCmpSwap<atomic_cmp_swap_64, GPR64>;
++  def ATOMIC_LOAD_MIN_I64  : Atomic2Ops<atomic_load_min_64, GPR64>;
++  def ATOMIC_LOAD_MAX_I64  : Atomic2Ops<atomic_load_max_64, GPR64>;
++  def ATOMIC_LOAD_UMIN_I64 : Atomic2Ops<atomic_load_umin_64, GPR64>;
++  def ATOMIC_LOAD_UMAX_I64 : Atomic2Ops<atomic_load_umax_64, GPR64>;
+ }
+ def ATOMIC_LOAD_ADD_I64_POSTRA  : Atomic2OpsPostRA<GPR64>;
+@@ -96,6 +100,11 @@
+ def ATOMIC_CMP_SWAP_I64_POSTRA  : AtomicCmpSwapPostRA<GPR64>;
++def ATOMIC_LOAD_MIN_I64_POSTRA  : Atomic2OpsPostRA<GPR64>;
++def ATOMIC_LOAD_MAX_I64_POSTRA  : Atomic2OpsPostRA<GPR64>;
++def ATOMIC_LOAD_UMIN_I64_POSTRA : Atomic2OpsPostRA<GPR64>;
++def ATOMIC_LOAD_UMAX_I64_POSTRA : Atomic2OpsPostRA<GPR64>;
++
+ /// Pseudo instructions for loading and storing accumulator registers.
+ let isPseudo = 1, isCodeGenOnly = 1, hasNoSchedulingInfo = 1 in {
+   def LOAD_ACC128  : Load<"", ACC128>;
+Index: llvm/lib/Target/Mips/MipsExpandPseudo.cpp
+===================================================================
+--- llvm/lib/Target/Mips/MipsExpandPseudo.cpp
++++ llvm/lib/Target/Mips/MipsExpandPseudo.cpp
+@@ -68,7 +68,7 @@
+                   MachineBasicBlock::iterator &NMBB);
+     bool expandMBB(MachineBasicBlock &MBB);
+    };
+-  char MipsExpandPseudo::ID = 0;
++   char MipsExpandPseudo::ID = 0;
+ }
+ bool MipsExpandPseudo::expandAtomicCmpSwapSubword(
+@@ -308,7 +308,7 @@
+   const bool ArePtrs64bit = STI->getABI().ArePtrs64bit();
+   DebugLoc DL = I->getDebugLoc();
+-  unsigned LL, SC;
++  unsigned LL, SC, SLT, SLTu, OR, MOVN, MOVZ, SELNEZ, SELEQZ;
+   unsigned BEQ = Mips::BEQ;
+   unsigned SEOp = Mips::SEH;
+@@ -316,15 +316,32 @@
+       LL = STI->hasMips32r6() ? Mips::LL_MMR6 : Mips::LL_MM;
+       SC = STI->hasMips32r6() ? Mips::SC_MMR6 : Mips::SC_MM;
+       BEQ = STI->hasMips32r6() ? Mips::BEQC_MMR6 : Mips::BEQ_MM;
++      SLT = Mips::SLT_MM;
++      SLTu = Mips::SLTu_MM;
++      OR = STI->hasMips32r6() ? Mips::OR_MMR6 : Mips::OR_MM;
++      MOVN = Mips::MOVN_I_MM;
++      MOVZ = Mips::MOVZ_I_MM;
++      SELNEZ = STI->hasMips32r6() ? Mips::SELNEZ_MMR6 : Mips::SELNEZ;
++      SELEQZ = STI->hasMips32r6() ? Mips::SELEQZ_MMR6 : Mips::SELEQZ;
+   } else {
+     LL = STI->hasMips32r6() ? (ArePtrs64bit ? Mips::LL64_R6 : Mips::LL_R6)
+                             : (ArePtrs64bit ? Mips::LL64 : Mips::LL);
+     SC = STI->hasMips32r6() ? (ArePtrs64bit ? Mips::SC64_R6 : Mips::SC_R6)
+                             : (ArePtrs64bit ? Mips::SC64 : Mips::SC);
++    SLT = Mips::SLT;
++    SLTu = Mips::SLTu;
++    OR = Mips::OR;
++    MOVN = Mips::MOVN_I_I;
++    MOVZ = Mips::MOVZ_I_I;
++    SELNEZ = Mips::SELNEZ;
++    SELEQZ = Mips::SELEQZ;
+   }
+   bool IsSwap = false;
+   bool IsNand = false;
++  bool IsMin = false;
++  bool IsMax = false;
++  bool IsUnsigned = false;
+   unsigned Opcode = 0;
+   switch (I->getOpcode()) {
+@@ -370,6 +387,22 @@
+   case Mips::ATOMIC_LOAD_XOR_I16_POSTRA:
+     Opcode = Mips::XOR;
+     break;
++  case Mips::ATOMIC_LOAD_UMIN_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_UMIN_I16_POSTRA:
++    IsUnsigned = true;
++    LLVM_FALLTHROUGH;
++  case Mips::ATOMIC_LOAD_MIN_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_MIN_I16_POSTRA:
++    IsMin = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMAX_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_UMAX_I16_POSTRA:
++    IsUnsigned = true;
++    LLVM_FALLTHROUGH;
++  case Mips::ATOMIC_LOAD_MAX_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_MAX_I16_POSTRA:
++    IsMax = true;
++    break;
+   default:
+     llvm_unreachable("Unknown subword atomic pseudo for expansion!");
+   }
+@@ -415,6 +448,68 @@
+     BuildMI(loopMBB, DL, TII->get(Mips::AND), BinOpRes)
+         .addReg(BinOpRes)
+         .addReg(Mask);
++  } else if (IsMin || IsMax) {
++
++    assert(I->getNumOperands() == 10 &&
++           "Atomics min|max|umin|umax use an additional register");
++    unsigned Scratch4 = I->getOperand(9).getReg();
++
++    unsigned SLTScratch4 = IsUnsigned ? SLTu : SLT;
++    unsigned SELIncr = IsMax ? SELNEZ : SELEQZ;
++    unsigned SELOldVal = IsMax ? SELEQZ : SELNEZ;
++    unsigned MOVIncr = IsMax ? MOVN : MOVZ;
++
++    // For little endian we need to clear uninterested bits.
++    if (STI->isLittle()) {
++      // and OldVal, OldVal, Mask
++      // and Incr, Incr, Mask
++      BuildMI(loopMBB, DL, TII->get(Mips::AND), OldVal)
++          .addReg(OldVal)
++          .addReg(Mask);
++      BuildMI(loopMBB, DL, TII->get(Mips::AND), Incr).addReg(Incr).addReg(Mask);
++    }
++
++    // unsigned: sltu Scratch4, oldVal, Incr
++    // signed:   slt Scratch4, oldVal, Incr
++    BuildMI(loopMBB, DL, TII->get(SLTScratch4), Scratch4)
++        .addReg(OldVal)
++        .addReg(Incr);
++
++    if (STI->hasMips64r6() || STI->hasMips32r6()) {
++      // max: seleqz BinOpRes, OldVal, Scratch4
++      //      selnez Scratch4, Incr, Scratch4
++      //      or BinOpRes, BinOpRes, Scratch4
++      // min: selnqz BinOpRes, OldVal, Scratch4
++      //      seleqz Scratch4, Incr, Scratch4
++      //      or BinOpRes, BinOpRes, Scratch4
++      BuildMI(loopMBB, DL, TII->get(SELOldVal), BinOpRes)
++          .addReg(OldVal)
++          .addReg(Scratch4);
++      BuildMI(loopMBB, DL, TII->get(SELIncr), Scratch4)
++          .addReg(Incr)
++          .addReg(Scratch4);
++      BuildMI(loopMBB, DL, TII->get(OR), BinOpRes)
++          .addReg(BinOpRes)
++          .addReg(Scratch4);
++    } else {
++      // max: move BinOpRes, OldVal
++      //      movn BinOpRes, Incr, Scratch4, BinOpRes
++      // min: move BinOpRes, OldVal
++      //      movz BinOpRes, Incr, Scratch4, BinOpRes
++      BuildMI(loopMBB, DL, TII->get(OR), BinOpRes)
++          .addReg(OldVal)
++          .addReg(Mips::ZERO);
++      BuildMI(loopMBB, DL, TII->get(MOVIncr), BinOpRes)
++          .addReg(Incr)
++          .addReg(Scratch4)
++          .addReg(BinOpRes);
++    }
++
++    //  and BinOpRes, BinOpRes, Mask
++    BuildMI(loopMBB, DL, TII->get(Mips::AND), BinOpRes)
++        .addReg(BinOpRes)
++        .addReg(Mask);
++
+   } else if (!IsSwap) {
+     //  <binop> binopres, oldval, incr2
+     //  and newval, binopres, mask
+@@ -488,13 +583,20 @@
+   const bool ArePtrs64bit = STI->getABI().ArePtrs64bit();
+   DebugLoc DL = I->getDebugLoc();
+-  unsigned LL, SC, ZERO, BEQ;
++  unsigned LL, SC, ZERO, BEQ, SLT, SLTu, OR, MOVN, MOVZ, SELNEZ, SELEQZ;
+   if (Size == 4) {
+     if (STI->inMicroMipsMode()) {
+       LL = STI->hasMips32r6() ? Mips::LL_MMR6 : Mips::LL_MM;
+       SC = STI->hasMips32r6() ? Mips::SC_MMR6 : Mips::SC_MM;
+       BEQ = STI->hasMips32r6() ? Mips::BEQC_MMR6 : Mips::BEQ_MM;
++      SLT = Mips::SLT_MM;
++      SLTu = Mips::SLTu_MM;
++      OR = STI->hasMips32r6() ? Mips::OR_MMR6 : Mips::OR_MM;
++      MOVN = Mips::MOVN_I_MM;
++      MOVZ = Mips::MOVZ_I_MM;
++      SELNEZ = STI->hasMips32r6() ? Mips::SELNEZ_MMR6 : Mips::SELNEZ;
++      SELEQZ = STI->hasMips32r6() ? Mips::SELEQZ_MMR6 : Mips::SELEQZ;
+     } else {
+       LL = STI->hasMips32r6()
+                ? (ArePtrs64bit ? Mips::LL64_R6 : Mips::LL_R6)
+@@ -503,6 +605,13 @@
+                ? (ArePtrs64bit ? Mips::SC64_R6 : Mips::SC_R6)
+                : (ArePtrs64bit ? Mips::SC64 : Mips::SC);
+       BEQ = Mips::BEQ;
++      SLT = Mips::SLT;
++      SLTu = Mips::SLTu;
++      OR = Mips::OR;
++      MOVN = Mips::MOVN_I_I;
++      MOVZ = Mips::MOVZ_I_I;
++      SELNEZ = Mips::SELNEZ;
++      SELEQZ = Mips::SELEQZ;
+     }
+     ZERO = Mips::ZERO;
+@@ -511,6 +620,13 @@
+     SC = STI->hasMips64r6() ? Mips::SCD_R6 : Mips::SCD;
+     ZERO = Mips::ZERO_64;
+     BEQ = Mips::BEQ64;
++    SLT = Mips::SLT64;
++    SLTu = Mips::SLTu64;
++    OR = Mips::OR64;
++    MOVN = Mips::MOVN_I64_I64;
++    MOVZ = Mips::MOVZ_I64_I64;
++    SELNEZ = Mips::SELNEZ64;
++    SELEQZ = Mips::SELEQZ64;
+   }
+   unsigned OldVal = I->getOperand(0).getReg();
+@@ -519,10 +635,15 @@
+   unsigned Scratch = I->getOperand(3).getReg();
+   unsigned Opcode = 0;
+-  unsigned OR = 0;
+   unsigned AND = 0;
+   unsigned NOR = 0;
++
++  bool IsOr = false;
+   bool IsNand = false;
++  bool IsMin = false;
++  bool IsMax = false;
++  bool IsUnsigned = false;
++
+   switch (I->getOpcode()) {
+   case Mips::ATOMIC_LOAD_ADD_I32_POSTRA:
+     Opcode = Mips::ADDu;
+@@ -545,7 +666,7 @@
+     NOR = Mips::NOR;
+     break;
+   case Mips::ATOMIC_SWAP_I32_POSTRA:
+-    OR = Mips::OR;
++    IsOr = true;
+     break;
+   case Mips::ATOMIC_LOAD_ADD_I64_POSTRA:
+     Opcode = Mips::DADDu;
+@@ -568,7 +689,23 @@
+     NOR = Mips::NOR64;
+     break;
+   case Mips::ATOMIC_SWAP_I64_POSTRA:
+-    OR = Mips::OR64;
++    IsOr = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMIN_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_UMIN_I64_POSTRA:
++    IsUnsigned = true;
++    LLVM_FALLTHROUGH;
++  case Mips::ATOMIC_LOAD_MIN_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_MIN_I64_POSTRA:
++    IsMin = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMAX_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_UMAX_I64_POSTRA:
++    IsUnsigned = true;
++    LLVM_FALLTHROUGH;
++  case Mips::ATOMIC_LOAD_MAX_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_MAX_I64_POSTRA:
++    IsMax = true;
+     break;
+   default:
+     llvm_unreachable("Unknown pseudo atomic!");
+@@ -592,7 +729,59 @@
+   BuildMI(loopMBB, DL, TII->get(LL), OldVal).addReg(Ptr).addImm(0);
+   assert((OldVal != Ptr) && "Clobbered the wrong ptr reg!");
+   assert((OldVal != Incr) && "Clobbered the wrong reg!");
+-  if (Opcode) {
++  if (IsMin || IsMax) {
++
++    assert(I->getNumOperands() == 5 &&
++           "Atomics min|max|umin|umax use an additional register");
++    unsigned Scratch2 = I->getOperand(4).getReg();
++
++    // On Mips64 result of slt is GPR32.
++    unsigned Scratch2_32 =
++        (Size == 8) ? STI->getRegisterInfo()->getSubReg(Scratch2, Mips::sub_32)
++                    : Scratch2;
++
++    unsigned SLTScratch2 = IsUnsigned ? SLTu : SLT;
++    unsigned SELIncr = IsMax ? SELNEZ : SELEQZ;
++    unsigned SELOldVal = IsMax ? SELEQZ : SELNEZ;
++    unsigned MOVIncr = IsMax ? MOVN : MOVZ;
++
++    // unsigned: sltu Scratch2, oldVal, Incr
++    // signed:   slt Scratch2, oldVal, Incr
++    BuildMI(loopMBB, DL, TII->get(SLTScratch2), Scratch2_32)
++        .addReg(OldVal)
++        .addReg(Incr);
++
++    if (STI->hasMips64r6() || STI->hasMips32r6()) {
++      // max: seleqz Scratch, OldVal, Scratch2
++      //      selnez Scratch2, Incr, Scratch2
++      //      or Scratch, Scratch, Scratch2
++      // min: selnez Scratch, OldVal, Scratch2
++      //      seleqz Scratch2, Incr, Scratch2
++      //      or Scratch, Scratch, Scratch2
++      BuildMI(loopMBB, DL, TII->get(SELOldVal), Scratch)
++          .addReg(OldVal)
++          .addReg(Scratch2);
++      BuildMI(loopMBB, DL, TII->get(SELIncr), Scratch2)
++          .addReg(Incr)
++          .addReg(Scratch2);
++      BuildMI(loopMBB, DL, TII->get(OR), Scratch)
++          .addReg(Scratch)
++          .addReg(Scratch2);
++    } else {
++      // max: move Scratch, OldVal
++      //      movn Scratch, Incr, Scratch2, Scratch
++      // min: move Scratch, OldVal
++      //      movz Scratch, Incr, Scratch2, Scratch
++      BuildMI(loopMBB, DL, TII->get(OR), Scratch)
++          .addReg(OldVal)
++          .addReg(ZERO);
++      BuildMI(loopMBB, DL, TII->get(MOVIncr), Scratch)
++          .addReg(Incr)
++          .addReg(Scratch2)
++          .addReg(Scratch);
++    }
++
++  } else if (Opcode) {
+     BuildMI(loopMBB, DL, TII->get(Opcode), Scratch).addReg(OldVal).addReg(Incr);
+   } else if (IsNand) {
+     assert(AND && NOR &&
+@@ -600,7 +789,7 @@
+     BuildMI(loopMBB, DL, TII->get(AND), Scratch).addReg(OldVal).addReg(Incr);
+     BuildMI(loopMBB, DL, TII->get(NOR), Scratch).addReg(ZERO).addReg(Scratch);
+   } else {
+-    assert(OR && "Unknown instruction for atomic pseudo expansion!");
++    assert(IsOr && OR && "Unknown instruction for atomic pseudo expansion!");
+     BuildMI(loopMBB, DL, TII->get(OR), Scratch).addReg(Incr).addReg(ZERO);
+   }
+@@ -650,6 +839,14 @@
+   case Mips::ATOMIC_LOAD_OR_I16_POSTRA:
+   case Mips::ATOMIC_LOAD_XOR_I8_POSTRA:
+   case Mips::ATOMIC_LOAD_XOR_I16_POSTRA:
++  case Mips::ATOMIC_LOAD_MIN_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_MIN_I16_POSTRA:
++  case Mips::ATOMIC_LOAD_MAX_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_MAX_I16_POSTRA:
++  case Mips::ATOMIC_LOAD_UMIN_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_UMIN_I16_POSTRA:
++  case Mips::ATOMIC_LOAD_UMAX_I8_POSTRA:
++  case Mips::ATOMIC_LOAD_UMAX_I16_POSTRA:
+     return expandAtomicBinOpSubword(MBB, MBBI, NMBB);
+   case Mips::ATOMIC_LOAD_ADD_I32_POSTRA:
+   case Mips::ATOMIC_LOAD_SUB_I32_POSTRA:
+@@ -658,6 +855,10 @@
+   case Mips::ATOMIC_LOAD_XOR_I32_POSTRA:
+   case Mips::ATOMIC_LOAD_NAND_I32_POSTRA:
+   case Mips::ATOMIC_SWAP_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_MIN_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_MAX_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_UMIN_I32_POSTRA:
++  case Mips::ATOMIC_LOAD_UMAX_I32_POSTRA:
+     return expandAtomicBinOp(MBB, MBBI, NMBB, 4);
+   case Mips::ATOMIC_LOAD_ADD_I64_POSTRA:
+   case Mips::ATOMIC_LOAD_SUB_I64_POSTRA:
+@@ -666,6 +867,10 @@
+   case Mips::ATOMIC_LOAD_XOR_I64_POSTRA:
+   case Mips::ATOMIC_LOAD_NAND_I64_POSTRA:
+   case Mips::ATOMIC_SWAP_I64_POSTRA:
++  case Mips::ATOMIC_LOAD_MIN_I64_POSTRA:
++  case Mips::ATOMIC_LOAD_MAX_I64_POSTRA:
++  case Mips::ATOMIC_LOAD_UMIN_I64_POSTRA:
++  case Mips::ATOMIC_LOAD_UMAX_I64_POSTRA:
+     return expandAtomicBinOp(MBB, MBBI, NMBB, 8);
+   default:
+     return Modified;
+Index: llvm/lib/Target/Mips/MipsISelLowering.cpp
+===================================================================
+--- llvm/lib/Target/Mips/MipsISelLowering.cpp
++++ llvm/lib/Target/Mips/MipsISelLowering.cpp
+@@ -1366,6 +1366,43 @@
+     return emitAtomicCmpSwap(MI, BB);
+   case Mips::ATOMIC_CMP_SWAP_I64:
+     return emitAtomicCmpSwap(MI, BB);
++
++  case Mips::ATOMIC_LOAD_MIN_I8:
++    return emitAtomicBinaryPartword(MI, BB, 1);
++  case Mips::ATOMIC_LOAD_MIN_I16:
++    return emitAtomicBinaryPartword(MI, BB, 2);
++  case Mips::ATOMIC_LOAD_MIN_I32:
++    return emitAtomicBinary(MI, BB);
++  case Mips::ATOMIC_LOAD_MIN_I64:
++    return emitAtomicBinary(MI, BB);
++
++  case Mips::ATOMIC_LOAD_MAX_I8:
++    return emitAtomicBinaryPartword(MI, BB, 1);
++  case Mips::ATOMIC_LOAD_MAX_I16:
++    return emitAtomicBinaryPartword(MI, BB, 2);
++  case Mips::ATOMIC_LOAD_MAX_I32:
++    return emitAtomicBinary(MI, BB);
++  case Mips::ATOMIC_LOAD_MAX_I64:
++    return emitAtomicBinary(MI, BB);
++
++  case Mips::ATOMIC_LOAD_UMIN_I8:
++    return emitAtomicBinaryPartword(MI, BB, 1);
++  case Mips::ATOMIC_LOAD_UMIN_I16:
++    return emitAtomicBinaryPartword(MI, BB, 2);
++  case Mips::ATOMIC_LOAD_UMIN_I32:
++    return emitAtomicBinary(MI, BB);
++  case Mips::ATOMIC_LOAD_UMIN_I64:
++    return emitAtomicBinary(MI, BB);
++
++  case Mips::ATOMIC_LOAD_UMAX_I8:
++    return emitAtomicBinaryPartword(MI, BB, 1);
++  case Mips::ATOMIC_LOAD_UMAX_I16:
++    return emitAtomicBinaryPartword(MI, BB, 2);
++  case Mips::ATOMIC_LOAD_UMAX_I32:
++    return emitAtomicBinary(MI, BB);
++  case Mips::ATOMIC_LOAD_UMAX_I64:
++    return emitAtomicBinary(MI, BB);
++
+   case Mips::PseudoSDIV:
+   case Mips::PseudoUDIV:
+   case Mips::DIV:
+@@ -1427,6 +1464,7 @@
+   DebugLoc DL = MI.getDebugLoc();
+   unsigned AtomicOp;
++  bool NeedsAdditionalReg = false;
+   switch (MI.getOpcode()) {
+   case Mips::ATOMIC_LOAD_ADD_I32:
+     AtomicOp = Mips::ATOMIC_LOAD_ADD_I32_POSTRA;
+@@ -1470,6 +1508,38 @@
+   case Mips::ATOMIC_SWAP_I64:
+     AtomicOp = Mips::ATOMIC_SWAP_I64_POSTRA;
+     break;
++  case Mips::ATOMIC_LOAD_MIN_I32:
++    AtomicOp = Mips::ATOMIC_LOAD_MIN_I32_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_MAX_I32:
++    AtomicOp = Mips::ATOMIC_LOAD_MAX_I32_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMIN_I32:
++    AtomicOp = Mips::ATOMIC_LOAD_UMIN_I32_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMAX_I32:
++    AtomicOp = Mips::ATOMIC_LOAD_UMAX_I32_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_MIN_I64:
++    AtomicOp = Mips::ATOMIC_LOAD_MIN_I64_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_MAX_I64:
++    AtomicOp = Mips::ATOMIC_LOAD_MAX_I64_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMIN_I64:
++    AtomicOp = Mips::ATOMIC_LOAD_UMIN_I64_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMAX_I64:
++    AtomicOp = Mips::ATOMIC_LOAD_UMAX_I64_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
+   default:
+     llvm_unreachable("Unknown pseudo atomic for replacement!");
+   }
+@@ -1522,12 +1592,19 @@
+   BuildMI(*BB, II, DL, TII->get(Mips::COPY), IncrCopy).addReg(Incr);
+   BuildMI(*BB, II, DL, TII->get(Mips::COPY), PtrCopy).addReg(Ptr);
+-  BuildMI(*BB, II, DL, TII->get(AtomicOp))
+-      .addReg(OldVal, RegState::Define | RegState::EarlyClobber)
+-      .addReg(PtrCopy)
+-      .addReg(IncrCopy)
+-      .addReg(Scratch, RegState::Define | RegState::EarlyClobber |
+-                           RegState::Implicit | RegState::Dead);
++  MachineInstrBuilder MIB =
++      BuildMI(*BB, II, DL, TII->get(AtomicOp))
++          .addReg(OldVal, RegState::Define | RegState::EarlyClobber)
++          .addReg(PtrCopy)
++          .addReg(IncrCopy)
++          .addReg(Scratch, RegState::Define | RegState::EarlyClobber |
++                               RegState::Implicit | RegState::Dead);
++  if (NeedsAdditionalReg) {
++    unsigned Scratch2 =
++        RegInfo.createVirtualRegister(RegInfo.getRegClass(OldVal));
++    MIB.addReg(Scratch2, RegState::Define | RegState::EarlyClobber |
++                             RegState::Implicit | RegState::Dead);
++  }
+   MI.eraseFromParent();
+@@ -1595,6 +1672,7 @@
+   unsigned Scratch3 = RegInfo.createVirtualRegister(RC);
+   unsigned AtomicOp = 0;
++  bool NeedsAdditionalReg = false;
+   switch (MI.getOpcode()) {
+   case Mips::ATOMIC_LOAD_NAND_I8:
+     AtomicOp = Mips::ATOMIC_LOAD_NAND_I8_POSTRA;
+@@ -1638,6 +1716,38 @@
+   case Mips::ATOMIC_LOAD_XOR_I16:
+     AtomicOp = Mips::ATOMIC_LOAD_XOR_I16_POSTRA;
+     break;
++  case Mips::ATOMIC_LOAD_MIN_I8:
++    AtomicOp = Mips::ATOMIC_LOAD_MIN_I8_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_MIN_I16:
++    AtomicOp = Mips::ATOMIC_LOAD_MIN_I16_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_MAX_I8:
++    AtomicOp = Mips::ATOMIC_LOAD_MAX_I8_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_MAX_I16:
++    AtomicOp = Mips::ATOMIC_LOAD_MAX_I16_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMIN_I8:
++    AtomicOp = Mips::ATOMIC_LOAD_UMIN_I8_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMIN_I16:
++    AtomicOp = Mips::ATOMIC_LOAD_UMIN_I16_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMAX_I8:
++    AtomicOp = Mips::ATOMIC_LOAD_UMAX_I8_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
++  case Mips::ATOMIC_LOAD_UMAX_I16:
++    AtomicOp = Mips::ATOMIC_LOAD_UMAX_I16_POSTRA;
++    NeedsAdditionalReg = true;
++    break;
+   default:
+     llvm_unreachable("Unknown subword atomic pseudo for expansion!");
+   }
+@@ -1692,19 +1802,25 @@
+   // emitAtomicBinary. In summary, we need a scratch register which is going to
+   // be undef, that is unique among registers chosen for the instruction.
+-  BuildMI(BB, DL, TII->get(AtomicOp))
+-      .addReg(Dest, RegState::Define | RegState::EarlyClobber)
+-      .addReg(AlignedAddr)
+-      .addReg(Incr2)
+-      .addReg(Mask)
+-      .addReg(Mask2)
+-      .addReg(ShiftAmt)
+-      .addReg(Scratch, RegState::EarlyClobber | RegState::Define |
+-                           RegState::Dead | RegState::Implicit)
+-      .addReg(Scratch2, RegState::EarlyClobber | RegState::Define |
+-                            RegState::Dead | RegState::Implicit)
+-      .addReg(Scratch3, RegState::EarlyClobber | RegState::Define |
+-                            RegState::Dead | RegState::Implicit);
++  MachineInstrBuilder MIB =
++      BuildMI(BB, DL, TII->get(AtomicOp))
++          .addReg(Dest, RegState::Define | RegState::EarlyClobber)
++          .addReg(AlignedAddr)
++          .addReg(Incr2)
++          .addReg(Mask)
++          .addReg(Mask2)
++          .addReg(ShiftAmt)
++          .addReg(Scratch, RegState::EarlyClobber | RegState::Define |
++                               RegState::Dead | RegState::Implicit)
++          .addReg(Scratch2, RegState::EarlyClobber | RegState::Define |
++                                RegState::Dead | RegState::Implicit)
++          .addReg(Scratch3, RegState::EarlyClobber | RegState::Define |
++                                RegState::Dead | RegState::Implicit);
++  if (NeedsAdditionalReg) {
++    unsigned Scratch4 = RegInfo.createVirtualRegister(RC);
++    MIB.addReg(Scratch4, RegState::EarlyClobber | RegState::Define |
++                             RegState::Dead | RegState::Implicit);
++  }
+   MI.eraseFromParent(); // The instruction is gone now.
+Index: llvm/lib/Target/Mips/MipsInstrInfo.td
+===================================================================
+--- llvm/lib/Target/Mips/MipsInstrInfo.td
++++ llvm/lib/Target/Mips/MipsInstrInfo.td
+@@ -1925,6 +1925,18 @@
+   def ATOMIC_CMP_SWAP_I16  : AtomicCmpSwap<atomic_cmp_swap_16, GPR32>;
+   def ATOMIC_CMP_SWAP_I32  : AtomicCmpSwap<atomic_cmp_swap_32, GPR32>;
++  def ATOMIC_LOAD_MIN_I8   : Atomic2Ops<atomic_load_min_8, GPR32>;
++  def ATOMIC_LOAD_MIN_I16  : Atomic2Ops<atomic_load_min_16, GPR32>;
++  def ATOMIC_LOAD_MIN_I32  : Atomic2Ops<atomic_load_min_32, GPR32>;
++  def ATOMIC_LOAD_MAX_I8   : Atomic2Ops<atomic_load_max_8, GPR32>;
++  def ATOMIC_LOAD_MAX_I16  : Atomic2Ops<atomic_load_max_16, GPR32>;
++  def ATOMIC_LOAD_MAX_I32  : Atomic2Ops<atomic_load_max_32, GPR32>;
++  def ATOMIC_LOAD_UMIN_I8  : Atomic2Ops<atomic_load_umin_8, GPR32>;
++  def ATOMIC_LOAD_UMIN_I16 : Atomic2Ops<atomic_load_umin_16, GPR32>;
++  def ATOMIC_LOAD_UMIN_I32 : Atomic2Ops<atomic_load_umin_32, GPR32>;
++  def ATOMIC_LOAD_UMAX_I8  : Atomic2Ops<atomic_load_umax_8, GPR32>;
++  def ATOMIC_LOAD_UMAX_I16 : Atomic2Ops<atomic_load_umax_16, GPR32>;
++  def ATOMIC_LOAD_UMAX_I32 : Atomic2Ops<atomic_load_umax_32, GPR32>;
+ }
+ def ATOMIC_LOAD_ADD_I8_POSTRA   : Atomic2OpsSubwordPostRA<GPR32>;
+@@ -1954,6 +1966,19 @@
+ def ATOMIC_CMP_SWAP_I16_POSTRA : AtomicCmpSwapSubwordPostRA<GPR32>;
+ def ATOMIC_CMP_SWAP_I32_POSTRA : AtomicCmpSwapPostRA<GPR32>;
++def ATOMIC_LOAD_MIN_I8_POSTRA   : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_MIN_I16_POSTRA  : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_MIN_I32_POSTRA  : Atomic2OpsPostRA<GPR32>;
++def ATOMIC_LOAD_MAX_I8_POSTRA   : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_MAX_I16_POSTRA  : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_MAX_I32_POSTRA  : Atomic2OpsPostRA<GPR32>;
++def ATOMIC_LOAD_UMIN_I8_POSTRA  : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_UMIN_I16_POSTRA : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_UMIN_I32_POSTRA : Atomic2OpsPostRA<GPR32>;
++def ATOMIC_LOAD_UMAX_I8_POSTRA  : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_UMAX_I16_POSTRA : Atomic2OpsSubwordPostRA<GPR32>;
++def ATOMIC_LOAD_UMAX_I32_POSTRA : Atomic2OpsPostRA<GPR32>;
++
+ /// Pseudo instructions for loading and storing accumulator registers.
+ let isPseudo = 1, isCodeGenOnly = 1, hasNoSchedulingInfo = 1 in {
+   def LOAD_ACC64  : Load<"", ACC64>;
+Index: llvm/test/CodeGen/Mips/atomic-min-max-64.ll
+===================================================================
+--- /dev/null
++++ llvm/test/CodeGen/Mips/atomic-min-max-64.ll
+@@ -0,0 +1,158 @@
++; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
++; RUN: llc -march=mips64 -O0 -mcpu=mips64r2 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS
++; RUN: llc -march=mips64el -O0 -mcpu=mips64r2 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS
++; RUN: llc -march=mips64 -O0 -mcpu=mips64r6 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPSR6
++; RUN: llc -march=mips64el -O0 -mcpu=mips64r6 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPSR6
++
++define i64 @test_max(i64* nocapture %ptr, i64 signext %val) {
++; MIPS-LABEL: test_max:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  .LBB0_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    lld $2, 0($4)
++; MIPS-NEXT:    slt $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movn $1, $5, $3
++; MIPS-NEXT:    scd $1, 0($4)
++; MIPS-NEXT:    beqz $1, .LBB0_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_max:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  .LBB0_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    lld $2, 0($4)
++; MIPSR6-NEXT:    slt $3, $2, $5
++; MIPSR6-NEXT:    seleqz $1, $2, $3
++; MIPSR6-NEXT:    selnez $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    scd $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, .LBB0_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw max i64* %ptr, i64 %val seq_cst
++  ret i64 %0
++}
++
++define i64 @test_min(i64* nocapture %ptr, i64 signext %val) {
++; MIPS-LABEL: test_min:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  .LBB1_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    lld $2, 0($4)
++; MIPS-NEXT:    slt $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movz $1, $5, $3
++; MIPS-NEXT:    scd $1, 0($4)
++; MIPS-NEXT:    beqz $1, .LBB1_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_min:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  .LBB1_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    lld $2, 0($4)
++; MIPSR6-NEXT:    slt $3, $2, $5
++; MIPSR6-NEXT:    selnez $1, $2, $3
++; MIPSR6-NEXT:    seleqz $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    scd $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, .LBB1_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw min i64* %ptr, i64 %val seq_cst
++  ret i64 %0
++}
++
++define i64 @test_umax(i64* nocapture %ptr, i64 zeroext %val) {
++; MIPS-LABEL: test_umax:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  .LBB2_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    lld $2, 0($4)
++; MIPS-NEXT:    sltu $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movn $1, $5, $3
++; MIPS-NEXT:    scd $1, 0($4)
++; MIPS-NEXT:    beqz $1, .LBB2_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umax:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  .LBB2_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    lld $2, 0($4)
++; MIPSR6-NEXT:    sltu $3, $2, $5
++; MIPSR6-NEXT:    seleqz $1, $2, $3
++; MIPSR6-NEXT:    selnez $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    scd $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, .LBB2_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umax i64* %ptr, i64 %val seq_cst
++  ret i64 %0
++}
++
++define i64 @test_umin(i64* nocapture %ptr, i64 zeroext %val) {
++; MIPS-LABEL: test_umin:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  .LBB3_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    lld $2, 0($4)
++; MIPS-NEXT:    sltu $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movz $1, $5, $3
++; MIPS-NEXT:    scd $1, 0($4)
++; MIPS-NEXT:    beqz $1, .LBB3_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umin:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  .LBB3_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    lld $2, 0($4)
++; MIPSR6-NEXT:    sltu $3, $2, $5
++; MIPSR6-NEXT:    selnez $1, $2, $3
++; MIPSR6-NEXT:    seleqz $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    scd $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, .LBB3_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umin i64* %ptr, i64 %val seq_cst
++  ret i64 %0
++}
++
+Index: llvm/test/CodeGen/Mips/atomic-min-max.ll
+===================================================================
+--- /dev/null
++++ llvm/test/CodeGen/Mips/atomic-min-max.ll
+@@ -0,0 +1,4674 @@
++; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
++; RUN: llc -march=mips -O0 -mcpu=mips32r2 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS
++; RUN: llc -march=mips -O0 -mcpu=mips32r6 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPSR6
++; RUN: llc -march=mips -O0 -mcpu=mips32r2 -mattr=+micromips -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MM
++; RUN: llc -march=mips -O0 -mcpu=mips32r6 -mattr=+micromips -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MMR6
++; RUN: llc -march=mipsel -O0 -mcpu=mips32r2 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPSEL
++; RUN: llc -march=mipsel -O0 -mcpu=mips32r6 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPSELR6
++; RUN: llc -march=mipsel -O0 -mcpu=mips32r2 -mattr=+micromips -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MMEL
++; RUN: llc -march=mipsel -O0 -mcpu=mips32r6 -mattr=+micromips -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MMELR6
++; RUN: llc -march=mips64 -O0 -mcpu=mips64r2 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS64
++; RUN: llc -march=mips64 -O0 -mcpu=mips64r6 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS64R6
++; RUN: llc -march=mips64el -O0 -mcpu=mips64r2 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS64EL
++; RUN: llc -march=mips64el -O0 -mcpu=mips64r6 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=MIPS64ELR6
++
++define i32 @test_max_32(i32* nocapture %ptr, i32 signext %val) {
++; MIPS-LABEL: test_max_32:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  $BB0_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $2, 0($4)
++; MIPS-NEXT:    slt $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movn $1, $5, $3
++; MIPS-NEXT:    sc $1, 0($4)
++; MIPS-NEXT:    beqz $1, $BB0_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_max_32:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  $BB0_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $2, 0($4)
++; MIPSR6-NEXT:    slt $3, $2, $5
++; MIPSR6-NEXT:    seleqz $1, $2, $3
++; MIPSR6-NEXT:    selnez $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    sc $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, $BB0_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_max_32:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:  $BB0_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $2, 0($4)
++; MM-NEXT:    slt $3, $2, $5
++; MM-NEXT:    or $1, $2, $zero
++; MM-NEXT:    movn $1, $5, $3
++; MM-NEXT:    sc $1, 0($4)
++; MM-NEXT:    beqzc $1, $BB0_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_max_32:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:  $BB0_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $2, 0($4)
++; MMR6-NEXT:    slt $3, $2, $5
++; MMR6-NEXT:    seleqz $1, $2, $3
++; MMR6-NEXT:    selnez $3, $5, $3
++; MMR6-NEXT:    or $1, $1, $3
++; MMR6-NEXT:    sc $1, 0($4)
++; MMR6-NEXT:    beqc $1, $zero, $BB0_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_max_32:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:  $BB0_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $2, 0($4)
++; MIPSEL-NEXT:    slt $3, $2, $5
++; MIPSEL-NEXT:    move $1, $2
++; MIPSEL-NEXT:    movn $1, $5, $3
++; MIPSEL-NEXT:    sc $1, 0($4)
++; MIPSEL-NEXT:    beqz $1, $BB0_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_max_32:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:  $BB0_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $2, 0($4)
++; MIPSELR6-NEXT:    slt $3, $2, $5
++; MIPSELR6-NEXT:    seleqz $1, $2, $3
++; MIPSELR6-NEXT:    selnez $3, $5, $3
++; MIPSELR6-NEXT:    or $1, $1, $3
++; MIPSELR6-NEXT:    sc $1, 0($4)
++; MIPSELR6-NEXT:    beqzc $1, $BB0_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_max_32:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:  $BB0_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $2, 0($4)
++; MMEL-NEXT:    slt $3, $2, $5
++; MMEL-NEXT:    or $1, $2, $zero
++; MMEL-NEXT:    movn $1, $5, $3
++; MMEL-NEXT:    sc $1, 0($4)
++; MMEL-NEXT:    beqzc $1, $BB0_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_max_32:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:  $BB0_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $2, 0($4)
++; MMELR6-NEXT:    slt $3, $2, $5
++; MMELR6-NEXT:    seleqz $1, $2, $3
++; MMELR6-NEXT:    selnez $3, $5, $3
++; MMELR6-NEXT:    or $1, $1, $3
++; MMELR6-NEXT:    sc $1, 0($4)
++; MMELR6-NEXT:    beqc $1, $zero, $BB0_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_max_32:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:  .LBB0_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $2, 0($4)
++; MIPS64-NEXT:    slt $3, $2, $5
++; MIPS64-NEXT:    move $1, $2
++; MIPS64-NEXT:    movn $1, $5, $3
++; MIPS64-NEXT:    sc $1, 0($4)
++; MIPS64-NEXT:    beqz $1, .LBB0_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_max_32:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:  .LBB0_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $2, 0($4)
++; MIPS64R6-NEXT:    slt $3, $2, $5
++; MIPS64R6-NEXT:    seleqz $1, $2, $3
++; MIPS64R6-NEXT:    selnez $3, $5, $3
++; MIPS64R6-NEXT:    or $1, $1, $3
++; MIPS64R6-NEXT:    sc $1, 0($4)
++; MIPS64R6-NEXT:    beqzc $1, .LBB0_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_max_32:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:  .LBB0_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $2, 0($4)
++; MIPS64EL-NEXT:    slt $3, $2, $5
++; MIPS64EL-NEXT:    move $1, $2
++; MIPS64EL-NEXT:    movn $1, $5, $3
++; MIPS64EL-NEXT:    sc $1, 0($4)
++; MIPS64EL-NEXT:    beqz $1, .LBB0_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_max_32:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:  .LBB0_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $2, 0($4)
++; MIPS64ELR6-NEXT:    slt $3, $2, $5
++; MIPS64ELR6-NEXT:    seleqz $1, $2, $3
++; MIPS64ELR6-NEXT:    selnez $3, $5, $3
++; MIPS64ELR6-NEXT:    or $1, $1, $3
++; MIPS64ELR6-NEXT:    sc $1, 0($4)
++; MIPS64ELR6-NEXT:    beqzc $1, .LBB0_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw max i32* %ptr, i32 %val seq_cst
++  ret i32 %0
++}
++
++define i32 @test_min_32(i32* nocapture %ptr, i32 signext %val) {
++; MIPS-LABEL: test_min_32:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  $BB1_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $2, 0($4)
++; MIPS-NEXT:    slt $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movz $1, $5, $3
++; MIPS-NEXT:    sc $1, 0($4)
++; MIPS-NEXT:    beqz $1, $BB1_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_min_32:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  $BB1_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $2, 0($4)
++; MIPSR6-NEXT:    slt $3, $2, $5
++; MIPSR6-NEXT:    selnez $1, $2, $3
++; MIPSR6-NEXT:    seleqz $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    sc $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, $BB1_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_min_32:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:  $BB1_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $2, 0($4)
++; MM-NEXT:    slt $3, $2, $5
++; MM-NEXT:    or $1, $2, $zero
++; MM-NEXT:    movz $1, $5, $3
++; MM-NEXT:    sc $1, 0($4)
++; MM-NEXT:    beqzc $1, $BB1_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_min_32:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:  $BB1_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $2, 0($4)
++; MMR6-NEXT:    slt $3, $2, $5
++; MMR6-NEXT:    selnez $1, $2, $3
++; MMR6-NEXT:    seleqz $3, $5, $3
++; MMR6-NEXT:    or $1, $1, $3
++; MMR6-NEXT:    sc $1, 0($4)
++; MMR6-NEXT:    beqc $1, $zero, $BB1_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_min_32:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:  $BB1_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $2, 0($4)
++; MIPSEL-NEXT:    slt $3, $2, $5
++; MIPSEL-NEXT:    move $1, $2
++; MIPSEL-NEXT:    movz $1, $5, $3
++; MIPSEL-NEXT:    sc $1, 0($4)
++; MIPSEL-NEXT:    beqz $1, $BB1_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_min_32:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:  $BB1_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $2, 0($4)
++; MIPSELR6-NEXT:    slt $3, $2, $5
++; MIPSELR6-NEXT:    selnez $1, $2, $3
++; MIPSELR6-NEXT:    seleqz $3, $5, $3
++; MIPSELR6-NEXT:    or $1, $1, $3
++; MIPSELR6-NEXT:    sc $1, 0($4)
++; MIPSELR6-NEXT:    beqzc $1, $BB1_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_min_32:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:  $BB1_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $2, 0($4)
++; MMEL-NEXT:    slt $3, $2, $5
++; MMEL-NEXT:    or $1, $2, $zero
++; MMEL-NEXT:    movz $1, $5, $3
++; MMEL-NEXT:    sc $1, 0($4)
++; MMEL-NEXT:    beqzc $1, $BB1_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_min_32:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:  $BB1_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $2, 0($4)
++; MMELR6-NEXT:    slt $3, $2, $5
++; MMELR6-NEXT:    selnez $1, $2, $3
++; MMELR6-NEXT:    seleqz $3, $5, $3
++; MMELR6-NEXT:    or $1, $1, $3
++; MMELR6-NEXT:    sc $1, 0($4)
++; MMELR6-NEXT:    beqc $1, $zero, $BB1_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_min_32:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:  .LBB1_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $2, 0($4)
++; MIPS64-NEXT:    slt $3, $2, $5
++; MIPS64-NEXT:    move $1, $2
++; MIPS64-NEXT:    movz $1, $5, $3
++; MIPS64-NEXT:    sc $1, 0($4)
++; MIPS64-NEXT:    beqz $1, .LBB1_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_min_32:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:  .LBB1_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $2, 0($4)
++; MIPS64R6-NEXT:    slt $3, $2, $5
++; MIPS64R6-NEXT:    selnez $1, $2, $3
++; MIPS64R6-NEXT:    seleqz $3, $5, $3
++; MIPS64R6-NEXT:    or $1, $1, $3
++; MIPS64R6-NEXT:    sc $1, 0($4)
++; MIPS64R6-NEXT:    beqzc $1, .LBB1_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_min_32:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:  .LBB1_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $2, 0($4)
++; MIPS64EL-NEXT:    slt $3, $2, $5
++; MIPS64EL-NEXT:    move $1, $2
++; MIPS64EL-NEXT:    movz $1, $5, $3
++; MIPS64EL-NEXT:    sc $1, 0($4)
++; MIPS64EL-NEXT:    beqz $1, .LBB1_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_min_32:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:  .LBB1_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $2, 0($4)
++; MIPS64ELR6-NEXT:    slt $3, $2, $5
++; MIPS64ELR6-NEXT:    selnez $1, $2, $3
++; MIPS64ELR6-NEXT:    seleqz $3, $5, $3
++; MIPS64ELR6-NEXT:    or $1, $1, $3
++; MIPS64ELR6-NEXT:    sc $1, 0($4)
++; MIPS64ELR6-NEXT:    beqzc $1, .LBB1_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw min i32* %ptr, i32 %val seq_cst
++  ret i32 %0
++}
++
++define i32 @test_umax_32(i32* nocapture %ptr, i32 signext %val) {
++; MIPS-LABEL: test_umax_32:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  $BB2_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $2, 0($4)
++; MIPS-NEXT:    sltu $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movn $1, $5, $3
++; MIPS-NEXT:    sc $1, 0($4)
++; MIPS-NEXT:    beqz $1, $BB2_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umax_32:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  $BB2_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $2, 0($4)
++; MIPSR6-NEXT:    sltu $3, $2, $5
++; MIPSR6-NEXT:    seleqz $1, $2, $3
++; MIPSR6-NEXT:    selnez $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    sc $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, $BB2_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_umax_32:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:  $BB2_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $2, 0($4)
++; MM-NEXT:    sltu $3, $2, $5
++; MM-NEXT:    or $1, $2, $zero
++; MM-NEXT:    movn $1, $5, $3
++; MM-NEXT:    sc $1, 0($4)
++; MM-NEXT:    beqzc $1, $BB2_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_umax_32:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:  $BB2_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $2, 0($4)
++; MMR6-NEXT:    sltu $3, $2, $5
++; MMR6-NEXT:    seleqz $1, $2, $3
++; MMR6-NEXT:    selnez $3, $5, $3
++; MMR6-NEXT:    or $1, $1, $3
++; MMR6-NEXT:    sc $1, 0($4)
++; MMR6-NEXT:    beqc $1, $zero, $BB2_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_umax_32:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:  $BB2_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $2, 0($4)
++; MIPSEL-NEXT:    sltu $3, $2, $5
++; MIPSEL-NEXT:    move $1, $2
++; MIPSEL-NEXT:    movn $1, $5, $3
++; MIPSEL-NEXT:    sc $1, 0($4)
++; MIPSEL-NEXT:    beqz $1, $BB2_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_umax_32:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:  $BB2_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $2, 0($4)
++; MIPSELR6-NEXT:    sltu $3, $2, $5
++; MIPSELR6-NEXT:    seleqz $1, $2, $3
++; MIPSELR6-NEXT:    selnez $3, $5, $3
++; MIPSELR6-NEXT:    or $1, $1, $3
++; MIPSELR6-NEXT:    sc $1, 0($4)
++; MIPSELR6-NEXT:    beqzc $1, $BB2_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_umax_32:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:  $BB2_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $2, 0($4)
++; MMEL-NEXT:    sltu $3, $2, $5
++; MMEL-NEXT:    or $1, $2, $zero
++; MMEL-NEXT:    movn $1, $5, $3
++; MMEL-NEXT:    sc $1, 0($4)
++; MMEL-NEXT:    beqzc $1, $BB2_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_umax_32:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:  $BB2_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $2, 0($4)
++; MMELR6-NEXT:    sltu $3, $2, $5
++; MMELR6-NEXT:    seleqz $1, $2, $3
++; MMELR6-NEXT:    selnez $3, $5, $3
++; MMELR6-NEXT:    or $1, $1, $3
++; MMELR6-NEXT:    sc $1, 0($4)
++; MMELR6-NEXT:    beqc $1, $zero, $BB2_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_umax_32:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:  .LBB2_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $2, 0($4)
++; MIPS64-NEXT:    sltu $3, $2, $5
++; MIPS64-NEXT:    move $1, $2
++; MIPS64-NEXT:    movn $1, $5, $3
++; MIPS64-NEXT:    sc $1, 0($4)
++; MIPS64-NEXT:    beqz $1, .LBB2_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_umax_32:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:  .LBB2_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $2, 0($4)
++; MIPS64R6-NEXT:    sltu $3, $2, $5
++; MIPS64R6-NEXT:    seleqz $1, $2, $3
++; MIPS64R6-NEXT:    selnez $3, $5, $3
++; MIPS64R6-NEXT:    or $1, $1, $3
++; MIPS64R6-NEXT:    sc $1, 0($4)
++; MIPS64R6-NEXT:    beqzc $1, .LBB2_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_umax_32:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:  .LBB2_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $2, 0($4)
++; MIPS64EL-NEXT:    sltu $3, $2, $5
++; MIPS64EL-NEXT:    move $1, $2
++; MIPS64EL-NEXT:    movn $1, $5, $3
++; MIPS64EL-NEXT:    sc $1, 0($4)
++; MIPS64EL-NEXT:    beqz $1, .LBB2_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_umax_32:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:  .LBB2_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $2, 0($4)
++; MIPS64ELR6-NEXT:    sltu $3, $2, $5
++; MIPS64ELR6-NEXT:    seleqz $1, $2, $3
++; MIPS64ELR6-NEXT:    selnez $3, $5, $3
++; MIPS64ELR6-NEXT:    or $1, $1, $3
++; MIPS64ELR6-NEXT:    sc $1, 0($4)
++; MIPS64ELR6-NEXT:    beqzc $1, .LBB2_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umax i32* %ptr, i32 %val seq_cst
++  ret i32 %0
++}
++
++define i32 @test_umin_32(i32* nocapture %ptr, i32 signext %val) {
++; MIPS-LABEL: test_umin_32:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:  $BB3_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $2, 0($4)
++; MIPS-NEXT:    sltu $3, $2, $5
++; MIPS-NEXT:    move $1, $2
++; MIPS-NEXT:    movz $1, $5, $3
++; MIPS-NEXT:    sc $1, 0($4)
++; MIPS-NEXT:    beqz $1, $BB3_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umin_32:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:  $BB3_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $2, 0($4)
++; MIPSR6-NEXT:    sltu $3, $2, $5
++; MIPSR6-NEXT:    selnez $1, $2, $3
++; MIPSR6-NEXT:    seleqz $3, $5, $3
++; MIPSR6-NEXT:    or $1, $1, $3
++; MIPSR6-NEXT:    sc $1, 0($4)
++; MIPSR6-NEXT:    beqzc $1, $BB3_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_umin_32:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:  $BB3_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $2, 0($4)
++; MM-NEXT:    sltu $3, $2, $5
++; MM-NEXT:    or $1, $2, $zero
++; MM-NEXT:    movz $1, $5, $3
++; MM-NEXT:    sc $1, 0($4)
++; MM-NEXT:    beqzc $1, $BB3_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_umin_32:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:  $BB3_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $2, 0($4)
++; MMR6-NEXT:    sltu $3, $2, $5
++; MMR6-NEXT:    selnez $1, $2, $3
++; MMR6-NEXT:    seleqz $3, $5, $3
++; MMR6-NEXT:    or $1, $1, $3
++; MMR6-NEXT:    sc $1, 0($4)
++; MMR6-NEXT:    beqc $1, $zero, $BB3_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_umin_32:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:  $BB3_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $2, 0($4)
++; MIPSEL-NEXT:    sltu $3, $2, $5
++; MIPSEL-NEXT:    move $1, $2
++; MIPSEL-NEXT:    movz $1, $5, $3
++; MIPSEL-NEXT:    sc $1, 0($4)
++; MIPSEL-NEXT:    beqz $1, $BB3_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_umin_32:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:  $BB3_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $2, 0($4)
++; MIPSELR6-NEXT:    sltu $3, $2, $5
++; MIPSELR6-NEXT:    selnez $1, $2, $3
++; MIPSELR6-NEXT:    seleqz $3, $5, $3
++; MIPSELR6-NEXT:    or $1, $1, $3
++; MIPSELR6-NEXT:    sc $1, 0($4)
++; MIPSELR6-NEXT:    beqzc $1, $BB3_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_umin_32:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:  $BB3_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $2, 0($4)
++; MMEL-NEXT:    sltu $3, $2, $5
++; MMEL-NEXT:    or $1, $2, $zero
++; MMEL-NEXT:    movz $1, $5, $3
++; MMEL-NEXT:    sc $1, 0($4)
++; MMEL-NEXT:    beqzc $1, $BB3_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_umin_32:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:  $BB3_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $2, 0($4)
++; MMELR6-NEXT:    sltu $3, $2, $5
++; MMELR6-NEXT:    selnez $1, $2, $3
++; MMELR6-NEXT:    seleqz $3, $5, $3
++; MMELR6-NEXT:    or $1, $1, $3
++; MMELR6-NEXT:    sc $1, 0($4)
++; MMELR6-NEXT:    beqc $1, $zero, $BB3_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_umin_32:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:  .LBB3_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $2, 0($4)
++; MIPS64-NEXT:    sltu $3, $2, $5
++; MIPS64-NEXT:    move $1, $2
++; MIPS64-NEXT:    movz $1, $5, $3
++; MIPS64-NEXT:    sc $1, 0($4)
++; MIPS64-NEXT:    beqz $1, .LBB3_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_umin_32:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:  .LBB3_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $2, 0($4)
++; MIPS64R6-NEXT:    sltu $3, $2, $5
++; MIPS64R6-NEXT:    selnez $1, $2, $3
++; MIPS64R6-NEXT:    seleqz $3, $5, $3
++; MIPS64R6-NEXT:    or $1, $1, $3
++; MIPS64R6-NEXT:    sc $1, 0($4)
++; MIPS64R6-NEXT:    beqzc $1, .LBB3_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_umin_32:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:  .LBB3_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $2, 0($4)
++; MIPS64EL-NEXT:    sltu $3, $2, $5
++; MIPS64EL-NEXT:    move $1, $2
++; MIPS64EL-NEXT:    movz $1, $5, $3
++; MIPS64EL-NEXT:    sc $1, 0($4)
++; MIPS64EL-NEXT:    beqz $1, .LBB3_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_umin_32:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:  .LBB3_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $2, 0($4)
++; MIPS64ELR6-NEXT:    sltu $3, $2, $5
++; MIPS64ELR6-NEXT:    selnez $1, $2, $3
++; MIPS64ELR6-NEXT:    seleqz $3, $5, $3
++; MIPS64ELR6-NEXT:    or $1, $1, $3
++; MIPS64ELR6-NEXT:    sc $1, 0($4)
++; MIPS64ELR6-NEXT:    beqzc $1, .LBB3_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umin i32* %ptr, i32 %val seq_cst
++  ret i32 %0
++}
++
++define i16 @test_max_16(i16* nocapture %ptr, i16 signext %val) {
++; MIPS-LABEL: test_max_16:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 2
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 65535
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB4_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    slt $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movn $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB4_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_max_16:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 2
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 65535
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB4_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    slt $11, $8, $5
++; MIPSR6-NEXT:    seleqz $9, $8, $11
++; MIPSR6-NEXT:    selnez $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB4_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_max_16:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 2
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 65535
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB4_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    slt $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movn $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB4_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_max_16:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 2
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 65535
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB4_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    slt $11, $8, $5
++; MMR6-NEXT:    seleqz $9, $8, $11
++; MMR6-NEXT:    selnez $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB4_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_max_16:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 65535
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB4_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    slt $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movn $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB4_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_max_16:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 65535
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB4_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    slt $11, $8, $5
++; MIPSELR6-NEXT:    seleqz $9, $8, $11
++; MIPSELR6-NEXT:    selnez $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB4_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_max_16:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 65535
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB4_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    slt $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movn $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB4_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_max_16:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 65535
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB4_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    slt $11, $8, $5
++; MMELR6-NEXT:    seleqz $9, $8, $11
++; MMELR6-NEXT:    selnez $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB4_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_max_16:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 2
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 65535
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB4_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    slt $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movn $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB4_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_max_16:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 2
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 65535
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB4_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    slt $11, $8, $5
++; MIPS64R6-NEXT:    seleqz $9, $8, $11
++; MIPS64R6-NEXT:    selnez $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB4_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_max_16:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 65535
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB4_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    slt $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movn $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB4_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_max_16:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 65535
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB4_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    slt $11, $8, $5
++; MIPS64ELR6-NEXT:    seleqz $9, $8, $11
++; MIPS64ELR6-NEXT:    selnez $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB4_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw max i16* %ptr, i16 %val seq_cst
++  ret i16 %0
++}
++
++define i16 @test_min_16(i16* nocapture %ptr, i16 signext %val) {
++; MIPS-LABEL: test_min_16:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 2
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 65535
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB5_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    slt $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movz $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB5_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_min_16:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 2
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 65535
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB5_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    slt $11, $8, $5
++; MIPSR6-NEXT:    selnez $9, $8, $11
++; MIPSR6-NEXT:    seleqz $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB5_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_min_16:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 2
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 65535
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB5_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    slt $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movz $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB5_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_min_16:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 2
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 65535
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB5_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    slt $11, $8, $5
++; MMR6-NEXT:    selnez $9, $8, $11
++; MMR6-NEXT:    seleqz $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB5_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_min_16:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 65535
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB5_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    slt $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movz $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB5_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_min_16:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 65535
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB5_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    slt $11, $8, $5
++; MIPSELR6-NEXT:    selnez $9, $8, $11
++; MIPSELR6-NEXT:    seleqz $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB5_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_min_16:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 65535
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB5_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    slt $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movz $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB5_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_min_16:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 65535
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB5_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    slt $11, $8, $5
++; MMELR6-NEXT:    selnez $9, $8, $11
++; MMELR6-NEXT:    seleqz $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB5_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_min_16:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 2
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 65535
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB5_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    slt $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movz $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB5_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_min_16:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 2
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 65535
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB5_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    slt $11, $8, $5
++; MIPS64R6-NEXT:    selnez $9, $8, $11
++; MIPS64R6-NEXT:    seleqz $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB5_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_min_16:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 65535
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB5_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    slt $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movz $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB5_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_min_16:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 65535
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB5_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    slt $11, $8, $5
++; MIPS64ELR6-NEXT:    selnez $9, $8, $11
++; MIPS64ELR6-NEXT:    seleqz $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB5_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw min i16* %ptr, i16 %val seq_cst
++  ret i16 %0
++}
++
++define i16 @test_umax_16(i16* nocapture %ptr, i16 signext %val) {
++; MIPS-LABEL: test_umax_16:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 2
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 65535
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB6_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    sltu $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movn $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB6_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umax_16:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 2
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 65535
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB6_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    sltu $11, $8, $5
++; MIPSR6-NEXT:    seleqz $9, $8, $11
++; MIPSR6-NEXT:    selnez $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB6_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_umax_16:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 2
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 65535
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB6_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    sltu $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movn $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB6_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_umax_16:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 2
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 65535
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB6_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    sltu $11, $8, $5
++; MMR6-NEXT:    seleqz $9, $8, $11
++; MMR6-NEXT:    selnez $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB6_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_umax_16:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 65535
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB6_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    sltu $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movn $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB6_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_umax_16:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 65535
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB6_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    sltu $11, $8, $5
++; MIPSELR6-NEXT:    seleqz $9, $8, $11
++; MIPSELR6-NEXT:    selnez $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB6_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_umax_16:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 65535
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB6_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    sltu $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movn $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB6_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_umax_16:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 65535
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB6_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    sltu $11, $8, $5
++; MMELR6-NEXT:    seleqz $9, $8, $11
++; MMELR6-NEXT:    selnez $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB6_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_umax_16:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 2
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 65535
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB6_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    sltu $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movn $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB6_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_umax_16:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 2
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 65535
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB6_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    sltu $11, $8, $5
++; MIPS64R6-NEXT:    seleqz $9, $8, $11
++; MIPS64R6-NEXT:    selnez $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB6_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_umax_16:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 65535
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB6_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    sltu $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movn $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB6_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_umax_16:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 65535
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB6_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    sltu $11, $8, $5
++; MIPS64ELR6-NEXT:    seleqz $9, $8, $11
++; MIPS64ELR6-NEXT:    selnez $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB6_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umax i16* %ptr, i16 %val seq_cst
++  ret i16 %0
++}
++
++define i16 @test_umin_16(i16* nocapture %ptr, i16 signext %val) {
++; MIPS-LABEL: test_umin_16:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 2
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 65535
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB7_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    sltu $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movz $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB7_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umin_16:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 2
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 65535
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB7_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    sltu $11, $8, $5
++; MIPSR6-NEXT:    selnez $9, $8, $11
++; MIPSR6-NEXT:    seleqz $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB7_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_umin_16:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 2
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 65535
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB7_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    sltu $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movz $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB7_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_umin_16:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 2
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 65535
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB7_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    sltu $11, $8, $5
++; MMR6-NEXT:    selnez $9, $8, $11
++; MMR6-NEXT:    seleqz $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB7_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_umin_16:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 65535
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB7_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    sltu $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movz $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB7_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_umin_16:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 65535
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB7_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    sltu $11, $8, $5
++; MIPSELR6-NEXT:    selnez $9, $8, $11
++; MIPSELR6-NEXT:    seleqz $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB7_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_umin_16:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 65535
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB7_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    sltu $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movz $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB7_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_umin_16:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 65535
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB7_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    sltu $11, $8, $5
++; MMELR6-NEXT:    selnez $9, $8, $11
++; MMELR6-NEXT:    seleqz $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB7_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_umin_16:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 2
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 65535
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB7_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    sltu $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movz $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB7_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_umin_16:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 2
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 65535
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB7_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    sltu $11, $8, $5
++; MIPS64R6-NEXT:    selnez $9, $8, $11
++; MIPS64R6-NEXT:    seleqz $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB7_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_umin_16:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 65535
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB7_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    sltu $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movz $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB7_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_umin_16:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 65535
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB7_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    sltu $11, $8, $5
++; MIPS64ELR6-NEXT:    selnez $9, $8, $11
++; MIPS64ELR6-NEXT:    seleqz $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB7_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umin i16* %ptr, i16 %val seq_cst
++  ret i16 %0
++}
++
++
++define i8 @test_max_8(i8* nocapture %ptr, i8 signext %val) {
++; MIPS-LABEL: test_max_8:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 3
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 255
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB8_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    slt $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movn $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB8_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_max_8:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 3
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 255
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB8_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    slt $11, $8, $5
++; MIPSR6-NEXT:    seleqz $9, $8, $11
++; MIPSR6-NEXT:    selnez $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB8_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_max_8:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 3
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 255
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB8_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    slt $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movn $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB8_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_max_8:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 3
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 255
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB8_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    slt $11, $8, $5
++; MMR6-NEXT:    seleqz $9, $8, $11
++; MMR6-NEXT:    selnez $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB8_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_max_8:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 255
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB8_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    slt $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movn $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB8_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_max_8:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 255
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB8_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    slt $11, $8, $5
++; MIPSELR6-NEXT:    seleqz $9, $8, $11
++; MIPSELR6-NEXT:    selnez $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB8_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_max_8:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 255
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB8_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    slt $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movn $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB8_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_max_8:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 255
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB8_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    slt $11, $8, $5
++; MMELR6-NEXT:    seleqz $9, $8, $11
++; MMELR6-NEXT:    selnez $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB8_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_max_8:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 3
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 255
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB8_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    slt $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movn $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB8_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_max_8:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 3
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 255
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB8_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    slt $11, $8, $5
++; MIPS64R6-NEXT:    seleqz $9, $8, $11
++; MIPS64R6-NEXT:    selnez $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB8_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_max_8:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 255
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB8_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    slt $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movn $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB8_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_max_8:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 255
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB8_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    slt $11, $8, $5
++; MIPS64ELR6-NEXT:    seleqz $9, $8, $11
++; MIPS64ELR6-NEXT:    selnez $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB8_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw max i8* %ptr, i8 %val seq_cst
++  ret i8 %0
++}
++
++define i8 @test_min_8(i8* nocapture %ptr, i8 signext %val) {
++; MIPS-LABEL: test_min_8:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 3
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 255
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB9_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    slt $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movz $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB9_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_min_8:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 3
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 255
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB9_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    slt $11, $8, $5
++; MIPSR6-NEXT:    selnez $9, $8, $11
++; MIPSR6-NEXT:    seleqz $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB9_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_min_8:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 3
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 255
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB9_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    slt $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movz $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB9_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_min_8:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 3
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 255
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB9_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    slt $11, $8, $5
++; MMR6-NEXT:    selnez $9, $8, $11
++; MMR6-NEXT:    seleqz $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB9_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_min_8:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 255
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB9_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    slt $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movz $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB9_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_min_8:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 255
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB9_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    slt $11, $8, $5
++; MIPSELR6-NEXT:    selnez $9, $8, $11
++; MIPSELR6-NEXT:    seleqz $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB9_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_min_8:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 255
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB9_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    slt $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movz $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB9_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_min_8:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 255
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB9_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    slt $11, $8, $5
++; MMELR6-NEXT:    selnez $9, $8, $11
++; MMELR6-NEXT:    seleqz $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB9_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_min_8:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 3
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 255
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB9_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    slt $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movz $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB9_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_min_8:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 3
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 255
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB9_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    slt $11, $8, $5
++; MIPS64R6-NEXT:    selnez $9, $8, $11
++; MIPS64R6-NEXT:    seleqz $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB9_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_min_8:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 255
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB9_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    slt $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movz $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB9_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_min_8:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 255
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB9_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    slt $11, $8, $5
++; MIPS64ELR6-NEXT:    selnez $9, $8, $11
++; MIPS64ELR6-NEXT:    seleqz $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB9_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw min i8* %ptr, i8 %val seq_cst
++  ret i8 %0
++}
++
++define i8 @test_umax_8(i8* nocapture %ptr, i8 signext %val) {
++; MIPS-LABEL: test_umax_8:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 3
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 255
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB10_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    sltu $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movn $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB10_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umax_8:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 3
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 255
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB10_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    sltu $11, $8, $5
++; MIPSR6-NEXT:    seleqz $9, $8, $11
++; MIPSR6-NEXT:    selnez $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB10_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_umax_8:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 3
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 255
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB10_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    sltu $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movn $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB10_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_umax_8:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 3
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 255
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB10_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    sltu $11, $8, $5
++; MMR6-NEXT:    seleqz $9, $8, $11
++; MMR6-NEXT:    selnez $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB10_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_umax_8:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 255
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB10_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    sltu $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movn $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB10_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_umax_8:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 255
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB10_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    sltu $11, $8, $5
++; MIPSELR6-NEXT:    seleqz $9, $8, $11
++; MIPSELR6-NEXT:    selnez $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB10_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_umax_8:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 255
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB10_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    sltu $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movn $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB10_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_umax_8:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 255
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB10_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    sltu $11, $8, $5
++; MMELR6-NEXT:    seleqz $9, $8, $11
++; MMELR6-NEXT:    selnez $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB10_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_umax_8:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 3
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 255
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB10_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    sltu $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movn $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB10_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_umax_8:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 3
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 255
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB10_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    sltu $11, $8, $5
++; MIPS64R6-NEXT:    seleqz $9, $8, $11
++; MIPS64R6-NEXT:    selnez $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB10_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_umax_8:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 255
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB10_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    sltu $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movn $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB10_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_umax_8:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 255
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB10_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    sltu $11, $8, $5
++; MIPS64ELR6-NEXT:    seleqz $9, $8, $11
++; MIPS64ELR6-NEXT:    selnez $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB10_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umax i8* %ptr, i8 %val seq_cst
++  ret i8 %0
++}
++
++define i8 @test_umin_8(i8* nocapture %ptr, i8 signext %val) {
++; MIPS-LABEL: test_umin_8:
++; MIPS:       # %bb.0: # %entry
++; MIPS-NEXT:    addiu $sp, $sp, -8
++; MIPS-NEXT:    .cfi_def_cfa_offset 8
++; MIPS-NEXT:    move $1, $5
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    addiu $2, $zero, -4
++; MIPS-NEXT:    and $2, $4, $2
++; MIPS-NEXT:    andi $3, $4, 3
++; MIPS-NEXT:    xori $3, $3, 3
++; MIPS-NEXT:    sll $3, $3, 3
++; MIPS-NEXT:    ori $4, $zero, 255
++; MIPS-NEXT:    sllv $4, $4, $3
++; MIPS-NEXT:    nor $6, $zero, $4
++; MIPS-NEXT:    sllv $5, $5, $3
++; MIPS-NEXT:  $BB11_1: # %entry
++; MIPS-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS-NEXT:    ll $8, 0($2)
++; MIPS-NEXT:    sltu $11, $8, $5
++; MIPS-NEXT:    move $9, $8
++; MIPS-NEXT:    movz $9, $5, $11
++; MIPS-NEXT:    and $9, $9, $4
++; MIPS-NEXT:    and $10, $8, $6
++; MIPS-NEXT:    or $10, $10, $9
++; MIPS-NEXT:    sc $10, 0($2)
++; MIPS-NEXT:    beqz $10, $BB11_1
++; MIPS-NEXT:    nop
++; MIPS-NEXT:  # %bb.2: # %entry
++; MIPS-NEXT:    and $7, $8, $4
++; MIPS-NEXT:    srlv $7, $7, $3
++; MIPS-NEXT:    seh $7, $7
++; MIPS-NEXT:  # %bb.3: # %entry
++; MIPS-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPS-NEXT:  # %bb.4: # %entry
++; MIPS-NEXT:    sync
++; MIPS-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPS-NEXT:    addiu $sp, $sp, 8
++; MIPS-NEXT:    jr $ra
++; MIPS-NEXT:    nop
++;
++; MIPSR6-LABEL: test_umin_8:
++; MIPSR6:       # %bb.0: # %entry
++; MIPSR6-NEXT:    addiu $sp, $sp, -8
++; MIPSR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSR6-NEXT:    move $1, $5
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    addiu $2, $zero, -4
++; MIPSR6-NEXT:    and $2, $4, $2
++; MIPSR6-NEXT:    andi $3, $4, 3
++; MIPSR6-NEXT:    xori $3, $3, 3
++; MIPSR6-NEXT:    sll $3, $3, 3
++; MIPSR6-NEXT:    ori $4, $zero, 255
++; MIPSR6-NEXT:    sllv $4, $4, $3
++; MIPSR6-NEXT:    nor $6, $zero, $4
++; MIPSR6-NEXT:    sllv $5, $5, $3
++; MIPSR6-NEXT:  $BB11_1: # %entry
++; MIPSR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSR6-NEXT:    ll $8, 0($2)
++; MIPSR6-NEXT:    sltu $11, $8, $5
++; MIPSR6-NEXT:    selnez $9, $8, $11
++; MIPSR6-NEXT:    seleqz $11, $5, $11
++; MIPSR6-NEXT:    or $9, $9, $11
++; MIPSR6-NEXT:    and $9, $9, $4
++; MIPSR6-NEXT:    and $10, $8, $6
++; MIPSR6-NEXT:    or $10, $10, $9
++; MIPSR6-NEXT:    sc $10, 0($2)
++; MIPSR6-NEXT:    beqzc $10, $BB11_1
++; MIPSR6-NEXT:  # %bb.2: # %entry
++; MIPSR6-NEXT:    and $7, $8, $4
++; MIPSR6-NEXT:    srlv $7, $7, $3
++; MIPSR6-NEXT:    seh $7, $7
++; MIPSR6-NEXT:  # %bb.3: # %entry
++; MIPSR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSR6-NEXT:  # %bb.4: # %entry
++; MIPSR6-NEXT:    sync
++; MIPSR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSR6-NEXT:    addiu $sp, $sp, 8
++; MIPSR6-NEXT:    jrc $ra
++;
++; MM-LABEL: test_umin_8:
++; MM:       # %bb.0: # %entry
++; MM-NEXT:    addiu $sp, $sp, -8
++; MM-NEXT:    .cfi_def_cfa_offset 8
++; MM-NEXT:    move $1, $5
++; MM-NEXT:    sync
++; MM-NEXT:    addiu $2, $zero, -4
++; MM-NEXT:    and $2, $4, $2
++; MM-NEXT:    andi $3, $4, 3
++; MM-NEXT:    xori $3, $3, 3
++; MM-NEXT:    sll $3, $3, 3
++; MM-NEXT:    ori $4, $zero, 255
++; MM-NEXT:    sllv $4, $4, $3
++; MM-NEXT:    nor $6, $zero, $4
++; MM-NEXT:    sllv $5, $5, $3
++; MM-NEXT:  $BB11_1: # %entry
++; MM-NEXT:    # =>This Inner Loop Header: Depth=1
++; MM-NEXT:    ll $8, 0($2)
++; MM-NEXT:    sltu $11, $8, $5
++; MM-NEXT:    or $9, $8, $zero
++; MM-NEXT:    movz $9, $5, $11
++; MM-NEXT:    and $9, $9, $4
++; MM-NEXT:    and $10, $8, $6
++; MM-NEXT:    or $10, $10, $9
++; MM-NEXT:    sc $10, 0($2)
++; MM-NEXT:    beqzc $10, $BB11_1
++; MM-NEXT:  # %bb.2: # %entry
++; MM-NEXT:    and $7, $8, $4
++; MM-NEXT:    srlv $7, $7, $3
++; MM-NEXT:    seh $7, $7
++; MM-NEXT:  # %bb.3: # %entry
++; MM-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MM-NEXT:  # %bb.4: # %entry
++; MM-NEXT:    sync
++; MM-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MM-NEXT:    addiusp 8
++; MM-NEXT:    jrc $ra
++;
++; MMR6-LABEL: test_umin_8:
++; MMR6:       # %bb.0: # %entry
++; MMR6-NEXT:    addiu $sp, $sp, -8
++; MMR6-NEXT:    .cfi_def_cfa_offset 8
++; MMR6-NEXT:    move $1, $5
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    addiu $2, $zero, -4
++; MMR6-NEXT:    and $2, $4, $2
++; MMR6-NEXT:    andi $3, $4, 3
++; MMR6-NEXT:    xori $3, $3, 3
++; MMR6-NEXT:    sll $3, $3, 3
++; MMR6-NEXT:    ori $4, $zero, 255
++; MMR6-NEXT:    sllv $4, $4, $3
++; MMR6-NEXT:    nor $6, $zero, $4
++; MMR6-NEXT:    sllv $5, $5, $3
++; MMR6-NEXT:  $BB11_1: # %entry
++; MMR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMR6-NEXT:    ll $8, 0($2)
++; MMR6-NEXT:    sltu $11, $8, $5
++; MMR6-NEXT:    selnez $9, $8, $11
++; MMR6-NEXT:    seleqz $11, $5, $11
++; MMR6-NEXT:    or $9, $9, $11
++; MMR6-NEXT:    and $9, $9, $4
++; MMR6-NEXT:    and $10, $8, $6
++; MMR6-NEXT:    or $10, $10, $9
++; MMR6-NEXT:    sc $10, 0($2)
++; MMR6-NEXT:    beqc $10, $zero, $BB11_1
++; MMR6-NEXT:  # %bb.2: # %entry
++; MMR6-NEXT:    and $7, $8, $4
++; MMR6-NEXT:    srlv $7, $7, $3
++; MMR6-NEXT:    seh $7, $7
++; MMR6-NEXT:  # %bb.3: # %entry
++; MMR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMR6-NEXT:  # %bb.4: # %entry
++; MMR6-NEXT:    sync
++; MMR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMR6-NEXT:    addiu $sp, $sp, 8
++; MMR6-NEXT:    jrc $ra
++;
++; MIPSEL-LABEL: test_umin_8:
++; MIPSEL:       # %bb.0: # %entry
++; MIPSEL-NEXT:    addiu $sp, $sp, -8
++; MIPSEL-NEXT:    .cfi_def_cfa_offset 8
++; MIPSEL-NEXT:    move $1, $5
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    addiu $2, $zero, -4
++; MIPSEL-NEXT:    and $2, $4, $2
++; MIPSEL-NEXT:    andi $3, $4, 3
++; MIPSEL-NEXT:    sll $3, $3, 3
++; MIPSEL-NEXT:    ori $4, $zero, 255
++; MIPSEL-NEXT:    sllv $4, $4, $3
++; MIPSEL-NEXT:    nor $6, $zero, $4
++; MIPSEL-NEXT:    sllv $5, $5, $3
++; MIPSEL-NEXT:  $BB11_1: # %entry
++; MIPSEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSEL-NEXT:    ll $8, 0($2)
++; MIPSEL-NEXT:    and $8, $8, $4
++; MIPSEL-NEXT:    and $5, $5, $4
++; MIPSEL-NEXT:    sltu $11, $8, $5
++; MIPSEL-NEXT:    move $9, $8
++; MIPSEL-NEXT:    movz $9, $5, $11
++; MIPSEL-NEXT:    and $9, $9, $4
++; MIPSEL-NEXT:    and $10, $8, $6
++; MIPSEL-NEXT:    or $10, $10, $9
++; MIPSEL-NEXT:    sc $10, 0($2)
++; MIPSEL-NEXT:    beqz $10, $BB11_1
++; MIPSEL-NEXT:    nop
++; MIPSEL-NEXT:  # %bb.2: # %entry
++; MIPSEL-NEXT:    and $7, $8, $4
++; MIPSEL-NEXT:    srlv $7, $7, $3
++; MIPSEL-NEXT:    seh $7, $7
++; MIPSEL-NEXT:  # %bb.3: # %entry
++; MIPSEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSEL-NEXT:  # %bb.4: # %entry
++; MIPSEL-NEXT:    sync
++; MIPSEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSEL-NEXT:    addiu $sp, $sp, 8
++; MIPSEL-NEXT:    jr $ra
++; MIPSEL-NEXT:    nop
++;
++; MIPSELR6-LABEL: test_umin_8:
++; MIPSELR6:       # %bb.0: # %entry
++; MIPSELR6-NEXT:    addiu $sp, $sp, -8
++; MIPSELR6-NEXT:    .cfi_def_cfa_offset 8
++; MIPSELR6-NEXT:    move $1, $5
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    addiu $2, $zero, -4
++; MIPSELR6-NEXT:    and $2, $4, $2
++; MIPSELR6-NEXT:    andi $3, $4, 3
++; MIPSELR6-NEXT:    sll $3, $3, 3
++; MIPSELR6-NEXT:    ori $4, $zero, 255
++; MIPSELR6-NEXT:    sllv $4, $4, $3
++; MIPSELR6-NEXT:    nor $6, $zero, $4
++; MIPSELR6-NEXT:    sllv $5, $5, $3
++; MIPSELR6-NEXT:  $BB11_1: # %entry
++; MIPSELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPSELR6-NEXT:    ll $8, 0($2)
++; MIPSELR6-NEXT:    and $8, $8, $4
++; MIPSELR6-NEXT:    and $5, $5, $4
++; MIPSELR6-NEXT:    sltu $11, $8, $5
++; MIPSELR6-NEXT:    selnez $9, $8, $11
++; MIPSELR6-NEXT:    seleqz $11, $5, $11
++; MIPSELR6-NEXT:    or $9, $9, $11
++; MIPSELR6-NEXT:    and $9, $9, $4
++; MIPSELR6-NEXT:    and $10, $8, $6
++; MIPSELR6-NEXT:    or $10, $10, $9
++; MIPSELR6-NEXT:    sc $10, 0($2)
++; MIPSELR6-NEXT:    beqzc $10, $BB11_1
++; MIPSELR6-NEXT:  # %bb.2: # %entry
++; MIPSELR6-NEXT:    and $7, $8, $4
++; MIPSELR6-NEXT:    srlv $7, $7, $3
++; MIPSELR6-NEXT:    seh $7, $7
++; MIPSELR6-NEXT:  # %bb.3: # %entry
++; MIPSELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MIPSELR6-NEXT:  # %bb.4: # %entry
++; MIPSELR6-NEXT:    sync
++; MIPSELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MIPSELR6-NEXT:    addiu $sp, $sp, 8
++; MIPSELR6-NEXT:    jrc $ra
++;
++; MMEL-LABEL: test_umin_8:
++; MMEL:       # %bb.0: # %entry
++; MMEL-NEXT:    addiu $sp, $sp, -8
++; MMEL-NEXT:    .cfi_def_cfa_offset 8
++; MMEL-NEXT:    move $1, $5
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    addiu $2, $zero, -4
++; MMEL-NEXT:    and $2, $4, $2
++; MMEL-NEXT:    andi $3, $4, 3
++; MMEL-NEXT:    sll $3, $3, 3
++; MMEL-NEXT:    ori $4, $zero, 255
++; MMEL-NEXT:    sllv $4, $4, $3
++; MMEL-NEXT:    nor $6, $zero, $4
++; MMEL-NEXT:    sllv $5, $5, $3
++; MMEL-NEXT:  $BB11_1: # %entry
++; MMEL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMEL-NEXT:    ll $8, 0($2)
++; MMEL-NEXT:    and $8, $8, $4
++; MMEL-NEXT:    and $5, $5, $4
++; MMEL-NEXT:    sltu $11, $8, $5
++; MMEL-NEXT:    or $9, $8, $zero
++; MMEL-NEXT:    movz $9, $5, $11
++; MMEL-NEXT:    and $9, $9, $4
++; MMEL-NEXT:    and $10, $8, $6
++; MMEL-NEXT:    or $10, $10, $9
++; MMEL-NEXT:    sc $10, 0($2)
++; MMEL-NEXT:    beqzc $10, $BB11_1
++; MMEL-NEXT:  # %bb.2: # %entry
++; MMEL-NEXT:    and $7, $8, $4
++; MMEL-NEXT:    srlv $7, $7, $3
++; MMEL-NEXT:    seh $7, $7
++; MMEL-NEXT:  # %bb.3: # %entry
++; MMEL-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMEL-NEXT:  # %bb.4: # %entry
++; MMEL-NEXT:    sync
++; MMEL-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMEL-NEXT:    addiusp 8
++; MMEL-NEXT:    jrc $ra
++;
++; MMELR6-LABEL: test_umin_8:
++; MMELR6:       # %bb.0: # %entry
++; MMELR6-NEXT:    addiu $sp, $sp, -8
++; MMELR6-NEXT:    .cfi_def_cfa_offset 8
++; MMELR6-NEXT:    move $1, $5
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    addiu $2, $zero, -4
++; MMELR6-NEXT:    and $2, $4, $2
++; MMELR6-NEXT:    andi $3, $4, 3
++; MMELR6-NEXT:    sll $3, $3, 3
++; MMELR6-NEXT:    ori $4, $zero, 255
++; MMELR6-NEXT:    sllv $4, $4, $3
++; MMELR6-NEXT:    nor $6, $zero, $4
++; MMELR6-NEXT:    sllv $5, $5, $3
++; MMELR6-NEXT:  $BB11_1: # %entry
++; MMELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MMELR6-NEXT:    ll $8, 0($2)
++; MMELR6-NEXT:    and $8, $8, $4
++; MMELR6-NEXT:    and $5, $5, $4
++; MMELR6-NEXT:    sltu $11, $8, $5
++; MMELR6-NEXT:    selnez $9, $8, $11
++; MMELR6-NEXT:    seleqz $11, $5, $11
++; MMELR6-NEXT:    or $9, $9, $11
++; MMELR6-NEXT:    and $9, $9, $4
++; MMELR6-NEXT:    and $10, $8, $6
++; MMELR6-NEXT:    or $10, $10, $9
++; MMELR6-NEXT:    sc $10, 0($2)
++; MMELR6-NEXT:    beqc $10, $zero, $BB11_1
++; MMELR6-NEXT:  # %bb.2: # %entry
++; MMELR6-NEXT:    and $7, $8, $4
++; MMELR6-NEXT:    srlv $7, $7, $3
++; MMELR6-NEXT:    seh $7, $7
++; MMELR6-NEXT:  # %bb.3: # %entry
++; MMELR6-NEXT:    sw $7, 4($sp) # 4-byte Folded Spill
++; MMELR6-NEXT:  # %bb.4: # %entry
++; MMELR6-NEXT:    sync
++; MMELR6-NEXT:    lw $2, 4($sp) # 4-byte Folded Reload
++; MMELR6-NEXT:    addiu $sp, $sp, 8
++; MMELR6-NEXT:    jrc $ra
++;
++; MIPS64-LABEL: test_umin_8:
++; MIPS64:       # %bb.0: # %entry
++; MIPS64-NEXT:    daddiu $sp, $sp, -16
++; MIPS64-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    daddiu $1, $zero, -4
++; MIPS64-NEXT:    and $1, $4, $1
++; MIPS64-NEXT:    andi $2, $4, 3
++; MIPS64-NEXT:    xori $2, $2, 3
++; MIPS64-NEXT:    sll $2, $2, 3
++; MIPS64-NEXT:    ori $3, $zero, 255
++; MIPS64-NEXT:    sllv $3, $3, $2
++; MIPS64-NEXT:    nor $6, $zero, $3
++; MIPS64-NEXT:    sllv $5, $5, $2
++; MIPS64-NEXT:  .LBB11_1: # %entry
++; MIPS64-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64-NEXT:    ll $8, 0($1)
++; MIPS64-NEXT:    sltu $11, $8, $5
++; MIPS64-NEXT:    move $9, $8
++; MIPS64-NEXT:    movz $9, $5, $11
++; MIPS64-NEXT:    and $9, $9, $3
++; MIPS64-NEXT:    and $10, $8, $6
++; MIPS64-NEXT:    or $10, $10, $9
++; MIPS64-NEXT:    sc $10, 0($1)
++; MIPS64-NEXT:    beqz $10, .LBB11_1
++; MIPS64-NEXT:    nop
++; MIPS64-NEXT:  # %bb.2: # %entry
++; MIPS64-NEXT:    and $7, $8, $3
++; MIPS64-NEXT:    srlv $7, $7, $2
++; MIPS64-NEXT:    seh $7, $7
++; MIPS64-NEXT:  # %bb.3: # %entry
++; MIPS64-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64-NEXT:  # %bb.4: # %entry
++; MIPS64-NEXT:    sync
++; MIPS64-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64-NEXT:    daddiu $sp, $sp, 16
++; MIPS64-NEXT:    jr $ra
++; MIPS64-NEXT:    nop
++;
++; MIPS64R6-LABEL: test_umin_8:
++; MIPS64R6:       # %bb.0: # %entry
++; MIPS64R6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64R6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64R6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    daddiu $1, $zero, -4
++; MIPS64R6-NEXT:    and $1, $4, $1
++; MIPS64R6-NEXT:    andi $2, $4, 3
++; MIPS64R6-NEXT:    xori $2, $2, 3
++; MIPS64R6-NEXT:    sll $2, $2, 3
++; MIPS64R6-NEXT:    ori $3, $zero, 255
++; MIPS64R6-NEXT:    sllv $3, $3, $2
++; MIPS64R6-NEXT:    nor $6, $zero, $3
++; MIPS64R6-NEXT:    sllv $5, $5, $2
++; MIPS64R6-NEXT:  .LBB11_1: # %entry
++; MIPS64R6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64R6-NEXT:    ll $8, 0($1)
++; MIPS64R6-NEXT:    sltu $11, $8, $5
++; MIPS64R6-NEXT:    selnez $9, $8, $11
++; MIPS64R6-NEXT:    seleqz $11, $5, $11
++; MIPS64R6-NEXT:    or $9, $9, $11
++; MIPS64R6-NEXT:    and $9, $9, $3
++; MIPS64R6-NEXT:    and $10, $8, $6
++; MIPS64R6-NEXT:    or $10, $10, $9
++; MIPS64R6-NEXT:    sc $10, 0($1)
++; MIPS64R6-NEXT:    beqzc $10, .LBB11_1
++; MIPS64R6-NEXT:  # %bb.2: # %entry
++; MIPS64R6-NEXT:    and $7, $8, $3
++; MIPS64R6-NEXT:    srlv $7, $7, $2
++; MIPS64R6-NEXT:    seh $7, $7
++; MIPS64R6-NEXT:  # %bb.3: # %entry
++; MIPS64R6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64R6-NEXT:  # %bb.4: # %entry
++; MIPS64R6-NEXT:    sync
++; MIPS64R6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64R6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64R6-NEXT:    jrc $ra
++;
++; MIPS64EL-LABEL: test_umin_8:
++; MIPS64EL:       # %bb.0: # %entry
++; MIPS64EL-NEXT:    daddiu $sp, $sp, -16
++; MIPS64EL-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64EL-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    daddiu $1, $zero, -4
++; MIPS64EL-NEXT:    and $1, $4, $1
++; MIPS64EL-NEXT:    andi $2, $4, 3
++; MIPS64EL-NEXT:    sll $2, $2, 3
++; MIPS64EL-NEXT:    ori $3, $zero, 255
++; MIPS64EL-NEXT:    sllv $3, $3, $2
++; MIPS64EL-NEXT:    nor $6, $zero, $3
++; MIPS64EL-NEXT:    sllv $5, $5, $2
++; MIPS64EL-NEXT:  .LBB11_1: # %entry
++; MIPS64EL-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64EL-NEXT:    ll $8, 0($1)
++; MIPS64EL-NEXT:    and $8, $8, $3
++; MIPS64EL-NEXT:    and $5, $5, $3
++; MIPS64EL-NEXT:    sltu $11, $8, $5
++; MIPS64EL-NEXT:    move $9, $8
++; MIPS64EL-NEXT:    movz $9, $5, $11
++; MIPS64EL-NEXT:    and $9, $9, $3
++; MIPS64EL-NEXT:    and $10, $8, $6
++; MIPS64EL-NEXT:    or $10, $10, $9
++; MIPS64EL-NEXT:    sc $10, 0($1)
++; MIPS64EL-NEXT:    beqz $10, .LBB11_1
++; MIPS64EL-NEXT:    nop
++; MIPS64EL-NEXT:  # %bb.2: # %entry
++; MIPS64EL-NEXT:    and $7, $8, $3
++; MIPS64EL-NEXT:    srlv $7, $7, $2
++; MIPS64EL-NEXT:    seh $7, $7
++; MIPS64EL-NEXT:  # %bb.3: # %entry
++; MIPS64EL-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64EL-NEXT:  # %bb.4: # %entry
++; MIPS64EL-NEXT:    sync
++; MIPS64EL-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64EL-NEXT:    daddiu $sp, $sp, 16
++; MIPS64EL-NEXT:    jr $ra
++; MIPS64EL-NEXT:    nop
++;
++; MIPS64ELR6-LABEL: test_umin_8:
++; MIPS64ELR6:       # %bb.0: # %entry
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, -16
++; MIPS64ELR6-NEXT:    .cfi_def_cfa_offset 16
++; MIPS64ELR6-NEXT:    # kill: def $a1 killed $a1 killed $a1_64
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    daddiu $1, $zero, -4
++; MIPS64ELR6-NEXT:    and $1, $4, $1
++; MIPS64ELR6-NEXT:    andi $2, $4, 3
++; MIPS64ELR6-NEXT:    sll $2, $2, 3
++; MIPS64ELR6-NEXT:    ori $3, $zero, 255
++; MIPS64ELR6-NEXT:    sllv $3, $3, $2
++; MIPS64ELR6-NEXT:    nor $6, $zero, $3
++; MIPS64ELR6-NEXT:    sllv $5, $5, $2
++; MIPS64ELR6-NEXT:  .LBB11_1: # %entry
++; MIPS64ELR6-NEXT:    # =>This Inner Loop Header: Depth=1
++; MIPS64ELR6-NEXT:    ll $8, 0($1)
++; MIPS64ELR6-NEXT:    and $8, $8, $3
++; MIPS64ELR6-NEXT:    and $5, $5, $3
++; MIPS64ELR6-NEXT:    sltu $11, $8, $5
++; MIPS64ELR6-NEXT:    selnez $9, $8, $11
++; MIPS64ELR6-NEXT:    seleqz $11, $5, $11
++; MIPS64ELR6-NEXT:    or $9, $9, $11
++; MIPS64ELR6-NEXT:    and $9, $9, $3
++; MIPS64ELR6-NEXT:    and $10, $8, $6
++; MIPS64ELR6-NEXT:    or $10, $10, $9
++; MIPS64ELR6-NEXT:    sc $10, 0($1)
++; MIPS64ELR6-NEXT:    beqzc $10, .LBB11_1
++; MIPS64ELR6-NEXT:  # %bb.2: # %entry
++; MIPS64ELR6-NEXT:    and $7, $8, $3
++; MIPS64ELR6-NEXT:    srlv $7, $7, $2
++; MIPS64ELR6-NEXT:    seh $7, $7
++; MIPS64ELR6-NEXT:  # %bb.3: # %entry
++; MIPS64ELR6-NEXT:    sw $7, 12($sp) # 4-byte Folded Spill
++; MIPS64ELR6-NEXT:  # %bb.4: # %entry
++; MIPS64ELR6-NEXT:    sync
++; MIPS64ELR6-NEXT:    lw $2, 12($sp) # 4-byte Folded Reload
++; MIPS64ELR6-NEXT:    daddiu $sp, $sp, 16
++; MIPS64ELR6-NEXT:    jrc $ra
++entry:
++  %0 = atomicrmw umin i8* %ptr, i8 %val seq_cst
++  ret i8 %0
++}
+Index: llvm/test/CodeGen/Mips/atomic.ll
+===================================================================
+--- llvm/test/CodeGen/Mips/atomic.ll
++++ llvm/test/CodeGen/Mips/atomic.ll
+@@ -1790,7 +1790,7 @@
+ ; MM32-NEXT:  $BB6_1: # %entry
+ ; MM32-NEXT:    # =>This Inner Loop Header: Depth=1
+ ; MM32-NEXT:    ll $2, 0($1)
+-; MM32-NEXT:    move $3, $4
++; MM32-NEXT:    or $3, $4, $zero
+ ; MM32-NEXT:    sc $3, 0($1)
+ ; MM32-NEXT:    beqzc $3, $BB6_1
+ ; MM32-NEXT:  # %bb.2: # %entry
diff --git a/patches/atomic_library_1.diff b/patches/atomic_library_1.diff
new file mode 100644 (file)
index 0000000..fb253e7
--- /dev/null
@@ -0,0 +1,25 @@
+---
+ clang/lib/Basic/Targets.cpp           |   14 ++++++++++++++
+ clang/test/CodeGen/linux-arm-atomic.c |   10 ++++++++++
+ 2 files changed, 24 insertions(+)
+
+Index: llvm-toolchain-snapshot_6.0~svn309319/clang/test/CodeGen/linux-arm-atomic.c
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn309319.orig/clang/test/CodeGen/linux-arm-atomic.c
++++ llvm-toolchain-snapshot_6.0~svn309319/clang/test/CodeGen/linux-arm-atomic.c
+@@ -1,5 +1,15 @@
+ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-linux | FileCheck %s
+ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-linux | FileCheck %s
++
++typedef int _Atomic_word;
++_Atomic_word exchange_and_add(volatile _Atomic_word *__mem, int __val) {
++  return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL);
++}
++
++// CHECK: define {{.*}} @exchange_and_add
++// CHECK: atomicrmw {{.*}} add
++// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-linux | FileCheck %s
++// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-linux | FileCheck %s
+ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-unknown-linux | FileCheck %s
+ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-freebsd | FileCheck %s
diff --git a/patches/bootstrap-fix-include-next.diff b/patches/bootstrap-fix-include-next.diff
new file mode 100644 (file)
index 0000000..87514b5
--- /dev/null
@@ -0,0 +1,41 @@
+When doing a bootstrap, we use a newly built clang.
+When this one is used, if already installed on the system,
+we have clang header in two places:
+llvm-toolchain-7-7/build-llvm/lib/clang/7.0.0/include/inttypes.h
+and
+/usr/include/clang/7.0.0/include/inttypes.h
+
+Because clang expects only one of his headers to be available, it uses
+include_next to get the glibc (libc6-dev package) header.
+
+However, in the previous example, because we have inttypes.h twice in the
+include search path, clang's header will call itself without any effect.
+Therefore, it will do include_next until the define from the libc is existing (ex: _INTTYPES_H)
+
+
+Index: llvm-toolchain-7-7/clang/lib/Headers/inttypes.h
+===================================================================
+--- llvm-toolchain-7-7.orig/clang/lib/Headers/inttypes.h
++++ llvm-toolchain-7-7/clang/lib/Headers/inttypes.h
+@@ -20,7 +20,7 @@
+  *
+ \*===----------------------------------------------------------------------===*/
+-#ifndef __CLANG_INTTYPES_H
++#if !defined(__CLANG_INTTYPES_H) || !defined(_INTTYPES_H)
+ #define __CLANG_INTTYPES_H
+ #if defined(_MSC_VER) && _MSC_VER < 1800
+Index: llvm-toolchain-7-7/clang/lib/Headers/limits.h
+===================================================================
+--- llvm-toolchain-7-7.orig/clang/lib/Headers/limits.h
++++ llvm-toolchain-7-7/clang/lib/Headers/limits.h
+@@ -22,7 +22,7 @@
+  *
+ \*===----------------------------------------------------------------------===*/
+-#ifndef __CLANG_LIMITS_H
++#if !defined(__CLANG_LIMITS_H) || !defined(_LIBC_LIMITS_H_)
+ #define __CLANG_LIMITS_H
+ /* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
diff --git a/patches/clang-analyzer-force-version.diff b/patches/clang-analyzer-force-version.diff
new file mode 100644 (file)
index 0000000..b08e029
--- /dev/null
@@ -0,0 +1,25 @@
+# Force the version of clang in the analyzer
+# This was causing the static analyzer to fail silently if the clang & clang++ are
+# not installed
+Index: llvm-toolchain-snapshot_7.0~svn257.06/clang/tools/scan-build/libexec/ccc-analyzer
+===================================================================
+--- llvm-toolchain-snapshot_7.0~svn257.06.orig/clang/tools/scan-build/libexec/ccc-analyzer
++++ llvm-toolchain-snapshot_7.0~svn257.06/clang/tools/scan-build/libexec/ccc-analyzer
+@@ -91,7 +91,7 @@ if ($FindBin::Script =~ /c\+\+-analyzer/
+   if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCXXCompiler; }
+   $Clang = $ENV{'CLANG_CXX'};
+-  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++'; }
++  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++-7'; }
+   $IsCXX = 1
+ }
+@@ -100,7 +100,7 @@ else {
+   if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCCompiler; }
+   $Clang = $ENV{'CLANG'};
+-  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang'; }
++  if (!defined $Clang || ! -x $Clang) { $Clang = 'clang-7'; }
+   $IsCXX = 0
+ }
diff --git a/patches/clang-arm-default-vfp3-on-armv7a.patch b/patches/clang-arm-default-vfp3-on-armv7a.patch
new file mode 100644 (file)
index 0000000..62d787f
--- /dev/null
@@ -0,0 +1,27 @@
+Index: llvm-toolchain-7-7/include/llvm/Support/ARMTargetParser.def
+===================================================================
+--- llvm-toolchain-7-7.orig/include/llvm/Support/ARMTargetParser.def
++++ llvm-toolchain-7-7/include/llvm/Support/ARMTargetParser.def
+@@ -75,7 +75,7 @@ ARM_ARCH("armv6kz", ARMV6KZ, "6KZ", "v6k
+ ARM_ARCH("armv6-m", ARMV6M, "6-M", "v6m", ARMBuildAttrs::CPUArch::v6_M,
+           FK_NONE, ARM::AEK_NONE)
+ ARM_ARCH("armv7-a", ARMV7A, "7-A", "v7", ARMBuildAttrs::CPUArch::v7,
+-          FK_NEON, ARM::AEK_DSP)
++          FK_VFPV3_D16 /* Hard float */, ARM::AEK_DSP)
+ ARM_ARCH("armv7ve", ARMV7VE, "7VE", "v7ve", ARMBuildAttrs::CPUArch::v7,
+           FK_NEON, (ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+           ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP))
+Index: llvm-toolchain-7-7/lib/Target/ARM/ARM.td
+===================================================================
+--- llvm-toolchain-7-7.orig/lib/Target/ARM/ARM.td
++++ llvm-toolchain-7-7/lib/Target/ARM/ARM.td
+@@ -558,7 +558,8 @@ def ARMv6sm   : Architecture<"armv6s-m",
+                                                        FeatureStrictAlign]>;
+ def ARMv7a    : Architecture<"armv7-a",   "ARMv7a",   [HasV7Ops,
+-                                                       FeatureNEON,
++                                                       FeatureVFP3,
++                                                       FeatureD16,
+                                                        FeatureDB,
+                                                        FeatureDSP,
+                                                        FeatureAClass]>;
diff --git a/patches/clang-baseline-fix-i386.patch b/patches/clang-baseline-fix-i386.patch
new file mode 100644 (file)
index 0000000..4c7a492
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
++++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
+@@ -105,8 +105,8 @@ const char *x86::getX86TargetCPU(const ArgList &Args,
+   case llvm::Triple::Haiku:
+     return "i586";
+   default:
+-    // Fallback to p4.
+-    return "pentium4";
++    // Fallback to i686.
++    return "i686";
+   }
+ }
+
diff --git a/patches/clang-format-version.diff b/patches/clang-format-version.diff
new file mode 100644 (file)
index 0000000..ea767e1
--- /dev/null
@@ -0,0 +1,39 @@
+---
+ clang/tools/clang-format/clang-format-diff.py |    2 +-
+ clang/tools/clang-format/clang-format.el      |    2 +-
+ clang/tools/clang-format/clang-format.py      |    2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/clang/tools/clang-format/clang-format-diff.py
++++ b/clang/tools/clang-format/clang-format-diff.py
+@@ -55,7 +55,7 @@ def main():
+   parser.add_argument('-style',
+                       help='formatting style to apply (LLVM, Google, Chromium, '
+                       'Mozilla, WebKit)')
+-  parser.add_argument('-binary', default='clang-format',
++  parser.add_argument('-binary', default='clang-format-7',
+                       help='location of binary to use for clang-format')
+   args = parser.parse_args()
+--- a/clang/tools/clang-format/clang-format.el
++++ b/clang/tools/clang-format/clang-format.el
+@@ -36,7 +36,7 @@
+   :group 'tools)
+ (defcustom clang-format-executable
+-  (or (executable-find "clang-format")
++  (or (executable-find "clang-format-7")
+       "clang-format")
+   "Location of the clang-format executable.
+--- a/clang/tools/clang-format/clang-format.py
++++ b/clang/tools/clang-format/clang-format.py
+@@ -35,7 +35,7 @@ import vim
+ # set g:clang_format_path to the path to clang-format if it is not on the path
+ # Change this to the full path if clang-format is not on the path.
+-binary = 'clang-format'
++binary = 'clang-format-7'
+ if vim.eval('exists("g:clang_format_path")') == "1":
+   binary = vim.eval('g:clang_format_path')
diff --git a/patches/clang-tidy-run-bin.diff b/patches/clang-tidy-run-bin.diff
new file mode 100644 (file)
index 0000000..65756a9
--- /dev/null
@@ -0,0 +1,17 @@
+Index: llvm-toolchain-snapshot_7.0~svn309541/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+===================================================================
+--- llvm-toolchain-snapshot_7.0~svn309541.orig/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
++++ llvm-toolchain-snapshot_7.0~svn309541/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+@@ -157,10 +157,10 @@ def main():
+                                    'clang-tidy and clang-apply-replacements in '
+                                    '$PATH.')
+   parser.add_argument('-clang-tidy-binary', metavar='PATH',
+-                      default='clang-tidy',
++                      default='clang-tidy-7',
+                       help='path to clang-tidy binary')
+   parser.add_argument('-clang-apply-replacements-binary', metavar='PATH',
+-                      default='clang-apply-replacements',
++                      default='clang-apply-replacements-7',
+                       help='path to clang-apply-replacements binary')
+   parser.add_argument('-checks', default=None,
+                       help='checks filter, when not specified, use clang-tidy '
diff --git a/patches/clangd-atomic-cmake.patch b/patches/clangd-atomic-cmake.patch
new file mode 100644 (file)
index 0000000..9d57934
--- /dev/null
@@ -0,0 +1,16 @@
+Index: llvm-toolchain-7-7/clang-tools-extra/clangd/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.orig/clang-tools-extra/clangd/CMakeLists.txt
++++ llvm-toolchain-7-7/clang-tools-extra/clangd/CMakeLists.txt
+@@ -7,6 +7,11 @@ if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+   list(APPEND CLANGD_ATOMIC_LIB "atomic")
+ endif()
++if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i386" OR
++   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686")
++  list(APPEND CLANGD_ATOMIC_LIB "atomic")
++endif()
++
+ add_clang_library(clangDaemon
+   AST.cpp
+   ClangdLSPServer.cpp
diff --git a/patches/debug-jit-path.diff b/patches/debug-jit-path.diff
new file mode 100644 (file)
index 0000000..78dc89a
--- /dev/null
@@ -0,0 +1,15 @@
+Index: llvm-toolchain-7_7.0.1~+rc3/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
+===================================================================
+--- llvm-toolchain-7_7.0.1~+rc3.orig/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
++++ llvm-toolchain-7_7.0.1~+rc3/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
+@@ -294,8 +294,8 @@ bool PerfJITEventListener::InitDebugging
+   // search for location to dump data to
+   if (const char *BaseDir = getenv("JITDUMPDIR"))
+     Path.append(BaseDir);
+-  else if (!sys::path::home_directory(Path))
+-    Path = ".";
++  else
++    sys::path::system_temp_directory(/*ErasedOnReboot*/ true, Path);
+   // create debug directory
+   Path += "/.debug/jit/";
diff --git a/patches/declare_clear_cache.diff b/patches/declare_clear_cache.diff
new file mode 100644 (file)
index 0000000..9c559b0
--- /dev/null
@@ -0,0 +1,15 @@
+---
+ lib/Support/Unix/Memory.inc |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/Support/Unix/Memory.inc
++++ b/lib/Support/Unix/Memory.inc
+@@ -319,7 +319,7 @@ void Memory::InvalidateInstructionCache(
+   // FIXME: Can we safely always call this for __GNUC__ everywhere?
+   const char *Start = static_cast<const char *>(Addr);
+   const char *End = Start + Len;
+-  __clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
++  __builtin___clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
+ #  endif
+ #endif  // end apple
diff --git a/patches/disable-display-PASS-UNSUPPORTED-XFAIL.diff b/patches/disable-display-PASS-UNSUPPORTED-XFAIL.diff
new file mode 100644 (file)
index 0000000..cde5326
--- /dev/null
@@ -0,0 +1,17 @@
+Index: llvm-toolchain-snapshot_4.0~svn280802/lldb/third_party/Python/module/unittest2/unittest2/runner.py
+===================================================================
+--- llvm-toolchain-snapshot_4.0~svn280802.orig/lldb/third_party/Python/module/unittest2/unittest2/runner.py
++++ llvm-toolchain-snapshot_4.0~svn280802/lldb/third_party/Python/module/unittest2/unittest2/runner.py
+@@ -174,9 +174,9 @@ class TextTestRunner(unittest.TextTestRu
+         if hasattr(result, 'separator2'):
+             self.stream.writeln(result.separator2)
+         run = result.testsRun
+-        self.stream.writeln("Ran %d test%s in %.3fs" %
+-                            (run, run != 1 and "s" or "", timeTaken))
+-        self.stream.writeln()
++#        self.stream.writeln("Ran %d test%s in %.3fs" %
++#                            (run, run != 1 and "s" or "", timeTaken))
++#        self.stream.writeln()
+         expectedFails = unexpectedSuccesses = skipped = passed = failed = errored = 0
+         try:
diff --git a/patches/disable-error-xray.diff b/patches/disable-error-xray.diff
new file mode 100644 (file)
index 0000000..2b77cf8
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_5.0~svn300419/compiler-rt/lib/xray/xray_tsc.h
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn300419.orig/compiler-rt/lib/xray/xray_tsc.h
++++ llvm-toolchain-snapshot_5.0~svn300419/compiler-rt/lib/xray/xray_tsc.h
+@@ -61,8 +61,6 @@ inline uint64_t getTSCFrequency() XRAY_N
+ } // namespace __xray
+-#else
+-#error Target architecture is not supported.
+ #endif // CPU architecture
+ #endif // XRAY_EMULATE_TSC_H
diff --git a/patches/disable-llvm-symbolizer-test.diff b/patches/disable-llvm-symbolizer-test.diff
new file mode 100644 (file)
index 0000000..988bb59
--- /dev/null
@@ -0,0 +1,25 @@
+Description: Silent a test failing on yakkety amd64
+ /tmp/buildd/llvm-toolchain-snapshot-4.0~svn279801/test/tools/llvm-symbolizer/print_context.c:16:11: error: expected string not found in input
+ // CHECK: inc
+          ^
+ <stdin>:1:1: note: scanning from here
+ _fini
+ ^
+ <stdin>:1:3: note: possible intended match here
+ _fini
+  ^
+Author: Sylvestre <sylvestre@debian.org>
+Last-Update: 2016-08-26
+
+Index: llvm-toolchain-snapshot_6.0~svn311429/test/tools/llvm-symbolizer/print_context.c
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn311429.orig/test/tools/llvm-symbolizer/print_context.c
++++ llvm-toolchain-snapshot_6.0~svn311429/test/tools/llvm-symbolizer/print_context.c
+@@ -14,6 +14,7 @@ int main() {
+ // RUN: cp %p/Inputs/print_context.o %t
+ // RUN: cd %t
+ // RUN: echo "%t/print_context.o 0x0" | llvm-symbolizer -print-source-context-lines=5 | FileCheck %s
++// XFAIL: *
+ // Inputs/print_context.o built with plain -g -c from this source file
+ // Specifying -Xclang -fdebug-compilation-dir -Xclang . to make the debug info
diff --git a/patches/disable-path-test-failing.diff b/patches/disable-path-test-failing.diff
new file mode 100644 (file)
index 0000000..2ca2355
--- /dev/null
@@ -0,0 +1,29 @@
+Index: llvm-toolchain-snapshot_7~svn334230/unittests/Support/Path.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn334230.orig/unittests/Support/Path.cpp
++++ llvm-toolchain-snapshot_7~svn334230/unittests/Support/Path.cpp
+@@ -465,7 +465,7 @@ protected:
+     sys::path::append(NonExistantFile, "1B28B495C16344CB9822E588CD4C3EF0");
+   }
+-  void TearDown() override { ASSERT_NO_ERROR(fs::remove(TestDirectory.str())); }
++//  void TearDown() override { ASSERT_NO_ERROR(fs::remove(TestDirectory.str())); }
+ };
+ TEST_F(FileSystemTest, Unique) {
+@@ -545,13 +545,13 @@ TEST_F(FileSystemTest, RealPath) {
+   SmallString<64> HomeDir;
+   bool Result = llvm::sys::path::home_directory(HomeDir);
+-  if (Result) {
++/*  if (Result) {
+     ASSERT_NO_ERROR(fs::real_path(HomeDir, Expected));
+     ASSERT_NO_ERROR(fs::real_path("~", Actual, true));
+     EXPECT_EQ(Expected, Actual);
+     ASSERT_NO_ERROR(fs::real_path("~/", Actual, true));
+     EXPECT_EQ(Expected, Actual);
+-  }
++    }*/
+   ASSERT_NO_ERROR(fs::remove_directories(Twine(TestDirectory) + "/test1"));
+ }
diff --git a/patches/disable-source-interleave.diff b/patches/disable-source-interleave.diff
new file mode 100644 (file)
index 0000000..929098e
--- /dev/null
@@ -0,0 +1,12 @@
+Index: llvm-toolchain-snapshot_4.0~svn290969/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll
+===================================================================
+--- llvm-toolchain-snapshot_4.0~svn290969.orig/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll
++++ llvm-toolchain-snapshot_4.0~svn290969/test/tools/llvm-objdump/X86/source-interleave-x86_64.ll
+@@ -4,6 +4,7 @@
+ ;  RUN: llvm-objdump -d -l %t.o | FileCheck --check-prefix="LINES" %t.ll
+ ;  RUN: llvm-objdump -d -S %t.o | FileCheck --check-prefix="SOURCE" %t.ll
+ ; ModuleID = 'source-interleave-x86_64.bc'
++; XFAIL: *
+ source_filename = "source-interleave-x86_64.c"
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
diff --git a/patches/disable-sse2-old-x86.diff b/patches/disable-sse2-old-x86.diff
new file mode 100644 (file)
index 0000000..caadc5d
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-7-7~+rc3/clang/include/clang/Basic/X86Target.def
+===================================================================
+--- llvm-toolchain-7-7~+rc3.orig/clang/include/clang/Basic/X86Target.def
++++ llvm-toolchain-7-7~+rc3/clang/include/clang/Basic/X86Target.def
+@@ -293,7 +293,7 @@ CPU_SPECIFIC("pentium_mmx", 'D', "+mmx")
+ CPU_SPECIFIC("pentium_ii", 'E', "+cmov,+mmx")
+ CPU_SPECIFIC("pentium_iii", 'H', "+cmov,+mmx,+sse")
+ CPU_SPECIFIC("pentium_iii_no_xmm_regs", 'H',"+cmov,+sse")
+-CPU_SPECIFIC("pentium_4", 'J', "+cmov,+mmx,+sse,+sse2")
++CPU_SPECIFIC("pentium_4", 'J', "+cmov,+mmx,+sse")
+ CPU_SPECIFIC("pentium_m", 'K', "+cmov,+mmx,+sse,+sse2")
+ CPU_SPECIFIC("pentium_4_sse3", 'L', "+cmov,+mmx,+sse,+sse2,+sse3")
+ CPU_SPECIFIC("core_2_duo_ssse3", 'M', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3")
diff --git a/patches/do-not-fail-on-unexpected-pass.diff b/patches/do-not-fail-on-unexpected-pass.diff
new file mode 100644 (file)
index 0000000..f9b8fab
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_3.9~svn268880/utils/lit/lit/Test.py
+===================================================================
+--- llvm-toolchain-snapshot_3.9~svn268880.orig/utils/lit/lit/Test.py
++++ llvm-toolchain-snapshot_3.9~svn268880/utils/lit/lit/Test.py
+@@ -30,7 +30,7 @@ PASS        = ResultCode('PASS', False)
+ FLAKYPASS   = ResultCode('FLAKYPASS', False)
+ XFAIL       = ResultCode('XFAIL', False)
+ FAIL        = ResultCode('FAIL', True)
+-XPASS       = ResultCode('XPASS', True)
++XPASS       = ResultCode('XPASS', False)
+ UNRESOLVED  = ResultCode('UNRESOLVED', True)
+ UNSUPPORTED = ResultCode('UNSUPPORTED', False)
+ TIMEOUT     = ResultCode('TIMEOUT', True)
diff --git a/patches/fix-clang-path-and-build.diff b/patches/fix-clang-path-and-build.diff
new file mode 100644 (file)
index 0000000..37d6afb
--- /dev/null
@@ -0,0 +1,24 @@
+---
+ clang/lib/Driver/ToolChains.cpp |    2 ++
+ 1 file changed, 2 insertions(+)
+
+Index: llvm-toolchain-snapshot_7~svn329789/clang/lib/Driver/ToolChains/Gnu.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn329789.orig/clang/lib/Driver/ToolChains/Gnu.cpp
++++ llvm-toolchain-snapshot_7~svn329789/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -17,6 +17,7 @@
+ #include "CommonArgs.h"
+ #include "Linux.h"
+ #include "clang/Basic/VirtualFileSystem.h"
++#include "clang/Basic/Version.h"
+ #include "clang/Config/config.h" // for GCC_INSTALL_PREFIX
+ #include "clang/Driver/Compilation.h"
+ #include "clang/Driver/Driver.h"
+@@ -2399,6 +2400,7 @@ void Generic_GCC::AddClangCXXStdlibInclu
+     addLibStdCxxIncludePaths(DriverArgs, CC1Args);
+     break;
+   }
++  addSystemInclude(DriverArgs, CC1Args, "/usr/include/clang/" + std::string(CLANG_VERSION_STRING) + "/include/");
+ }
+ void
diff --git a/patches/fix-llvm-config-obj-src-root.patch b/patches/fix-llvm-config-obj-src-root.patch
new file mode 100644 (file)
index 0000000..31635d1
--- /dev/null
@@ -0,0 +1,20 @@
+---
+ tools/llvm-config/llvm-config.cpp |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: llvm-toolchain-7_7.1.0~svn353565/tools/llvm-config/llvm-config.cpp
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/tools/llvm-config/llvm-config.cpp
++++ llvm-toolchain-7_7.1.0~svn353565/tools/llvm-config/llvm-config.cpp
+@@ -558,9 +558,9 @@ int main(int argc, char **argv) {
+       } else if (Arg == "--shared-mode") {
+         PrintSharedMode = true;
+       } else if (Arg == "--obj-root") {
+-        OS << ActivePrefix << '\n';
++        OS << ActivePrefix << "/build/" << '\n';
+       } else if (Arg == "--src-root") {
+-        OS << LLVM_SRC_ROOT << '\n';
++        OS << ActivePrefix << "/build/" << '\n';
+       } else if (Arg == "--ignore-libllvm") {
+         LinkDyLib = false;
+         LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto;
diff --git a/patches/fix-llvm-config.diff b/patches/fix-llvm-config.diff
new file mode 100644 (file)
index 0000000..4f0fa18
--- /dev/null
@@ -0,0 +1,17 @@
+Index: llvm-toolchain-7-7.0.1/tools/llvm-config/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/tools/llvm-config/CMakeLists.txt
++++ llvm-toolchain-7-7.0.1/tools/llvm-config/CMakeLists.txt
+@@ -32,9 +32,9 @@ get_property(COMPILE_FLAGS TARGET llvm-c
+ # Use configure_file to create BuildVariables.inc.
+ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
+ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
+-set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
++set(LLVM_CPPFLAGS "${LLVM_DEFINITIONS}")
++set(LLVM_CFLAGS "${LLVM_DEFINITIONS}")
++set(LLVM_CXXFLAGS "${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+ set(LLVM_BUILD_SYSTEM cmake)
+ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+ set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}")
diff --git a/patches/fix-scan-view-path.diff b/patches/fix-scan-view-path.diff
new file mode 100644 (file)
index 0000000..012ea57
--- /dev/null
@@ -0,0 +1,21 @@
+Index: llvm-toolchain-3.9-3.9/clang/tools/scan-view/bin/scan-view
+===================================================================
+--- llvm-toolchain-3.9-3.9.orig/clang/tools/scan-view/bin/scan-view
++++ llvm-toolchain-3.9-3.9/clang/tools/scan-view/bin/scan-view
+@@ -23,6 +23,7 @@ kDefaultPort = 8181
+ kMaxPortsToTry = 100
+ ###
++BASE_DIR = '/usr/share/clang/scan-view-7'
+ def url_is_up(url):
+@@ -61,7 +62,7 @@ def start_browser(port, options):
+ def run(port, options, root):
+     # Prefer to look relative to the installed binary
+-    share = os.path.dirname(__file__) + "/../share/"
++    share = os.path.join(BASE_DIR, 'share')
+     if not os.path.isdir(share):
+         # Otherwise look relative to the source
+         share = os.path.dirname(__file__) + "/../../scan-view/share"
diff --git a/patches/force-gcc-header-obj.diff b/patches/force-gcc-header-obj.diff
new file mode 100644 (file)
index 0000000..e47d28c
--- /dev/null
@@ -0,0 +1,16 @@
+Index: llvm-toolchain-5.0-5.0.2~+rc1/clang/lib/Driver/ToolChains/Linux.cpp
+===================================================================
+--- llvm-toolchain-5.0-5.0.2~+rc1.orig/clang/lib/Driver/ToolChains/Linux.cpp
++++ llvm-toolchain-5.0-5.0.2~+rc1/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -571,6 +571,11 @@ void Linux::AddClangSystemIncludeArgs(co
+     return;
+   }
++  // Force the inclusion of the gcc headers (objc/objc.h)
++  addExternCSystemIncludeIfExists(
++     DriverArgs, CC1Args, GCCInstallation.getInstallPath() + "/include");
++//  std::cout << GCCInstallation.getInstallPath().str() << "/include" << std::endl;
++
+   // Lacking those, try to detect the correct set of system includes for the
+   // target triple.
diff --git a/patches/hurd/D53557-hurd-self-exe-realpath.diff b/patches/hurd/D53557-hurd-self-exe-realpath.diff
new file mode 100644 (file)
index 0000000..216b6ba
--- /dev/null
@@ -0,0 +1,74 @@
+r345104 | rnk | 2018-10-24 01:35:43 +0200 (mer. 24 oct. 2018) | 25 lignes
+
+[hurd] Make getMainExecutable get the real binary path
+
+On GNU/Hurd, llvm-config is returning bogus value, such as:
+
+$ llvm-config-6.0 --includedir
+/usr/include
+
+while it should be:
+$ llvm-config-6.0 --includedir
+/usr/lib/llvm-6.0/include
+
+This is because getMainExecutable does not get the actual installation
+path. On GNU/Hurd, /proc/self/exe is indeed a symlink to the path that
+was used to start the program, and not the eventual binary file. Llvm's
+getMainExecutable thus needs to run realpath over it to get the actual
+place where llvm was installed (/usr/lib/llvm-6.0/bin/llvm-config), and
+not /usr/bin/llvm-config-6.0. This will not change the result on Linux,
+where /proc/self/exe already points to the eventual file.
+
+Patch by Samuel Thibault!
+
+While making changes here, I reformatted this block a bit to reduce
+indentation and match 2 space indent style.
+
+Differential Revision: https://reviews.llvm.org/D53557
+
+Index: llvm-toolchain-6.0-6.0.1/lib/Support/Unix/Path.inc
+===================================================================
+--- llvm-toolchain-6.0-6.0.1.orig/lib/Support/Unix/Path.inc
++++ llvm-toolchain-6.0-6.0.1/lib/Support/Unix/Path.inc
+@@ -191,14 +191,34 @@ std::string getMainExecutable(const char
+   char exe_path[MAXPATHLEN];
+   StringRef aPath("/proc/self/exe");
+   if (sys::fs::exists(aPath)) {
+-      // /proc is not always mounted under Linux (chroot for example).
+-      ssize_t len = readlink(aPath.str().c_str(), exe_path, sizeof(exe_path));
+-      if (len >= 0)
+-          return std::string(exe_path, len);
++    // /proc is not always mounted under Linux (chroot for example).
++    ssize_t len = readlink(aPath.str().c_str(), exe_path, sizeof(exe_path));
++    if (len < 0)
++      return "";
++
++    // Null terminate the string for realpath. readlink never null
++    // terminates its output.
++    len = std::min(len, ssize_t(sizeof(exe_path) - 1));
++    exe_path[len] = '\0';
++
++    // At least on GNU/Hurd, /proc/self/exe is a symlink to the path that
++    // was used to start the program, and not the eventual binary file.
++    // We thus needs to run realpath over it to get the actual place
++    // where llvm was installed.
++#if _POSIX_VERSION >= 200112 || defined(__GLIBC__)
++    char *real_path = realpath(exe_path, NULL);
++    std::string ret = std::string(real_path);
++    free(real_path);
++    return ret;
++#else
++    char real_path[MAXPATHLEN];
++    realpath(exe_path, real_path);
++    return std::string(real_path);
++#endif
+   } else {
+-      // Fall back to the classical detection.
+-      if (getprogpath(exe_path, argv0))
+-        return exe_path;
++    // Fall back to the classical detection.
++    if (getprogpath(exe_path, argv0))
++      return exe_path;
+   }
+ #elif defined(HAVE_DLFCN_H) && defined(HAVE_DLADDR)
+   // Use dladdr to get executable path if available.
diff --git a/patches/hurd/D54079-hurd-openmp.diff b/patches/hurd/D54079-hurd-openmp.diff
new file mode 100644 (file)
index 0000000..aa1a16d
--- /dev/null
@@ -0,0 +1,150 @@
+r346310 | achurbanov | 2018-11-07 13:27:38 +0100 (Wed, 07 Nov 2018) | 6 lines
+
+Add Hurd support.
+
+Patch by samuel.thibault@ens-lyon.org
+
+Differential Revision: https://reviews.llvm.org/D54079
+
+Index: llvm/openmp/runtime/src/kmp.h
+===================================================================
+--- llvm/openmp/runtime/src/kmp.h.orig
++++ llvm/openmp/runtime/src/kmp.h
+@@ -1048,6 +1048,10 @@ extern kmp_uint64 __kmp_now_nsec();
+ /* TODO: tune for KMP_OS_NETBSD */
+ #define KMP_INIT_WAIT 1024U /* initial number of spin-tests   */
+ #define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
++#elif KMP_OS_HURD
++/* TODO: tune for KMP_OS_HURD */
++#define KMP_INIT_WAIT 1024U /* initial number of spin-tests   */
++#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
+ #endif
+ #if KMP_ARCH_X86 || KMP_ARCH_X86_64
+Index: llvm/openmp/runtime/src/kmp_ftn_entry.h
+===================================================================
+--- llvm/openmp/runtime/src/kmp_ftn_entry.h.orig
++++ llvm/openmp/runtime/src/kmp_ftn_entry.h
+@@ -369,7 +369,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_
+ #else
+   int gtid;
+-#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD
++#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+   gtid = __kmp_entry_gtid();
+ #elif KMP_OS_WINDOWS
+   if (!__kmp_init_parallel ||
+Index: llvm/openmp/runtime/src/kmp_platform.h
+===================================================================
+--- llvm/openmp/runtime/src/kmp_platform.h.orig
++++ llvm/openmp/runtime/src/kmp_platform.h
+@@ -22,6 +22,7 @@
+ #define KMP_OS_DARWIN 0
+ #define KMP_OS_WINDOWS 0
+ #define KMP_OS_CNK 0
++#define KMP_OS_HURD 0
+ #define KMP_OS_UNIX 0 /* disjunction of KMP_OS_LINUX, KMP_OS_DARWIN etc. */
+ #ifdef _WIN32
+@@ -59,13 +60,18 @@
+ #define KMP_OS_CNK 1
+ #endif
++#if (defined __GNU__)
++#undef KMP_OS_HURD
++#define KMP_OS_HURD 1
++#endif
++
+ #if (1 !=                                                                      \
+      KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_NETBSD + KMP_OS_DARWIN +           \
+-         KMP_OS_WINDOWS)
++         KMP_OS_WINDOWS + KMP_OS_HURD)
+ #error Unknown OS
+ #endif
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN || KMP_OS_HURD
+ #undef KMP_OS_UNIX
+ #define KMP_OS_UNIX 1
+ #endif
+Index: llvm/openmp/runtime/src/kmp_runtime.cpp
+===================================================================
+--- llvm/openmp/runtime/src/kmp_runtime.cpp.orig
++++ llvm/openmp/runtime/src/kmp_runtime.cpp
+@@ -7643,7 +7643,7 @@ __kmp_determine_reduction_method(
+ #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64
+ #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS ||       \
+-    KMP_OS_DARWIN
++    KMP_OS_DARWIN || KMP_OS_HURD
+     int teamsize_cutoff = 4;
+@@ -7670,7 +7670,7 @@ __kmp_determine_reduction_method(
+ #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
+-#if KMP_OS_LINUX || KMP_OS_WINDOWS
++#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD
+     // basic tuning
+Index: llvm/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
+===================================================================
+--- llvm/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c.orig
++++ llvm/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
+@@ -70,6 +70,10 @@ static const char* ittnotify_lib_name =
+ #define ANDROID_ITTNOTIFY_DEFAULT_PATH  "/data/data/com.intel.vtune/intel/libittnotify.so"
+ #endif
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ #ifndef LIB_VAR_NAME
+ #if ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_MIPS
+Index: llvm/openmp/runtime/src/z_Linux_util.cpp
+===================================================================
+--- llvm/openmp/runtime/src/z_Linux_util.cpp.orig
++++ llvm/openmp/runtime/src/z_Linux_util.cpp
+@@ -444,8 +444,7 @@ void __kmp_terminate_thread(int gtid) {
+    determined exactly, FALSE if incremental refinement is necessary. */
+ static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
+   int stack_data;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD
+-  /* Linux* OS only -- no pthread_getattr_np support on OS X* */
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+   pthread_attr_t attr;
+   int status;
+   size_t size = 0;
+@@ -497,7 +496,7 @@ static void *__kmp_launch_worker(void *t
+   sigset_t new_set, old_set;
+ #endif /* KMP_BLOCK_SIGNALS */
+   void *exit_val;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+   void *volatile padding = 0;
+ #endif
+   int gtid;
+@@ -1765,7 +1764,7 @@ static int __kmp_get_xproc(void) {
+   int r = 0;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+   r = sysconf(_SC_NPROCESSORS_ONLN);
+@@ -1953,9 +1952,9 @@ int __kmp_is_address_mapped(void *addr)
+   int found = 0;
+   int rc;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD
+-  /* On Linux* OS, read the /proc/<pid>/maps pseudo-file to get all the address
++  /* On GNUish OSes, read the /proc/<pid>/maps pseudo-file to get all the address
+      ranges mapped into the address space. */
+   char *name = __kmp_str_format("/proc/%d/maps", getpid());
diff --git a/patches/hurd/D54338-hurd-libcxx-threads-build.diff b/patches/hurd/D54338-hurd-libcxx-threads-build.diff
new file mode 100644 (file)
index 0000000..55e5472
--- /dev/null
@@ -0,0 +1,24 @@
+r346763 | ldionne | 2018-11-13 18:00:04 +0100 (Tue, 13 Nov 2018) | 5 lines
+
+[libcxx] GNU/Hurd uses BSD-based interfaces, but does not (and won't) provide <sys/sysctl.h>
+
+Reviewed as https://reviews.llvm.org/D54338.
+
+Thanks to sthibaul for the patch.
+
+Index: llvm-toolchain-7-7/libcxx/src/thread.cpp
+===================================================================
+--- llvm-toolchain-7-7.orig/libcxx/src/thread.cpp
++++ llvm-toolchain-7-7/libcxx/src/thread.cpp
+@@ -19,9 +19,9 @@
+ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+ # include <sys/param.h>
+-# if defined(BSD)
++# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+ #   include <sys/sysctl.h>
+-# endif // defined(BSD)
++# endif
+ #endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__CloudABI__) || defined(__Fuchsia__)
diff --git a/patches/hurd/D54339-hurd-libcxx-threads-detection.diff b/patches/hurd/D54339-hurd-libcxx-threads-detection.diff
new file mode 100644 (file)
index 0000000..d09518b
--- /dev/null
@@ -0,0 +1,21 @@
+r347347 | ldionne | 2018-11-20 22:14:05 +0100 (mar. 20 nov. 2018) | 6 lignes
+
+[libcxx] Fix threads detection on GNU/Hurd
+
+GNU/Hurd provides standard Posix threads
+
+Reviewed as https://reviews.llvm.org/D54339.
+Thanks to Samuel Thibault for the patch.
+
+Index: llvm-toolchain-7-7/libcxx/include/__config
+===================================================================
+--- llvm-toolchain-7-7.orig/libcxx/include/__config
++++ llvm-toolchain-7-7/libcxx/include/__config
+@@ -1110,6 +1110,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
+       defined(__Fuchsia__) || \
+       defined(__NetBSD__) || \
+       defined(__linux__) || \
++      defined(__GNU__) || \
+       defined(__APPLE__) || \
+       defined(__CloudABI__) || \
+       defined(__sun__) || \
diff --git a/patches/hurd/D54378-hurd-triple.diff b/patches/hurd/D54378-hurd-triple.diff
new file mode 100644 (file)
index 0000000..2f57a2a
--- /dev/null
@@ -0,0 +1,74 @@
+Add Hurd triplet to LLVMSupport
+
+This introduces GNU Hurd as a new target OS.
+
+https://reviews.llvm.org/D54378
+
+Index: llvm-toolchain-7-7.0.1~+rc2/include/llvm/ADT/Triple.h
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/include/llvm/ADT/Triple.h
++++ llvm-toolchain-7-7.0.1~+rc2/include/llvm/ADT/Triple.h
+@@ -182,7 +182,8 @@ public:
+     Mesa3D,
+     Contiki,
+     AMDPAL,     // AMD PAL Runtime
+-    LastOSType = AMDPAL
++    Hurd,       // GNU/Hurd
++    LastOSType = Hurd
+   };
+   enum EnvironmentType {
+     UnknownEnvironment,
+@@ -578,9 +579,15 @@ public:
+     return getOS() == Triple::KFreeBSD;
+   }
++  /// Tests whether the OS is Hurd.
++  bool isOSHurd() const {
++    return getOS() == Triple::Hurd;
++  }
++
+   /// Tests whether the OS uses glibc.
+   bool isOSGlibc() const {
+-    return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD) &&
++    return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
++            getOS() == Triple::Hurd) &&
+            !isAndroid();
+   }
+Index: llvm-toolchain-7-7.0.1~+rc2/lib/Support/Triple.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/lib/Support/Triple.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/lib/Support/Triple.cpp
+@@ -209,6 +209,7 @@ StringRef Triple::getOSTypeName(OSType K
+   case Mesa3D: return "mesa3d";
+   case Contiki: return "contiki";
+   case AMDPAL: return "amdpal";
++  case Hurd: return "hurd";
+   }
+   llvm_unreachable("Invalid OSType");
+@@ -502,6 +503,7 @@ static Triple::OSType parseOS(StringRef
+     .StartsWith("mesa3d", Triple::Mesa3D)
+     .StartsWith("contiki", Triple::Contiki)
+     .StartsWith("amdpal", Triple::AMDPAL)
++    .StartsWith("hurd", Triple::Hurd)
+     .Default(Triple::UnknownOS);
+ }
+Index: llvm/unittests/ADT/TripleTest.cpp
+===================================================================
+--- llvm/unittests/ADT/TripleTest.cpp  (révision 346226)
++++ llvm/unittests/ADT/TripleTest.cpp  (copie de travail)
+@@ -93,6 +93,12 @@
+   EXPECT_EQ(Triple::Contiki, T.getOS());
+   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
++  T = Triple("i386-pc-hurd-gnu");
++  EXPECT_EQ(Triple::x86, T.getArch());
++  EXPECT_EQ(Triple::PC, T.getVendor());
++  EXPECT_EQ(Triple::Hurd, T.getOS());
++  EXPECT_EQ(Triple::GNU, T.getEnvironment());
++
+   T = Triple("x86_64-pc-linux-gnu");
+   EXPECT_EQ(Triple::x86_64, T.getArch());
+   EXPECT_EQ(Triple::PC, T.getVendor());
diff --git a/patches/hurd/D54379-hurd-triple-clang.diff b/patches/hurd/D54379-hurd-triple-clang.diff
new file mode 100644 (file)
index 0000000..c55fc54
--- /dev/null
@@ -0,0 +1,413 @@
+Add Hurd toolchain support to Clang
+
+https://reviews.llvm.org/D54379
+
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Basic/Targets/OSTargets.h
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Basic/Targets/OSTargets.h
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Basic/Targets/OSTargets.h
+@@ -270,6 +270,29 @@ public:
+   }
+ };
++// Hurd target
++template <typename Target>
++class LLVM_LIBRARY_VISIBILITY HurdTargetInfo : public OSTargetInfo<Target> {
++protected:
++  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
++                    MacroBuilder &Builder) const override {
++    // Linux defines; list based off of gcc output
++    DefineStd(Builder, "unix", Opts);
++    Builder.defineMacro("__GNU__");
++    Builder.defineMacro("__gnu_hurd__");
++    Builder.defineMacro("__MACH__");
++    Builder.defineMacro("__GLIBC__");
++    Builder.defineMacro("__ELF__");
++    if (Opts.POSIXThreads)
++      Builder.defineMacro("_REENTRANT");
++    if (Opts.CPlusPlus)
++      Builder.defineMacro("_GNU_SOURCE");
++  }
++public:
++  HurdTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
++      : OSTargetInfo<Target>(Triple, Opts) {}
++};
++
+ // Minix Target
+ template <typename Target>
+ class LLVM_LIBRARY_VISIBILITY MinixTargetInfo : public OSTargetInfo<Target> {
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Basic/Targets.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Basic/Targets.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Basic/Targets.cpp
+@@ -495,6 +495,8 @@ TargetInfo *AllocateTarget(const llvm::T
+       return new NaClTargetInfo<X86_32TargetInfo>(Triple, Opts);
+     case llvm::Triple::ELFIAMCU:
+       return new MCUX86_32TargetInfo(Triple, Opts);
++    case llvm::Triple::Hurd:
++      return new HurdTargetInfo<X86_32TargetInfo>(Triple, Opts);
+     default:
+       return new X86_32TargetInfo(Triple, Opts);
+     }
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Driver/CMakeLists.txt
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/CMakeLists.txt
+@@ -47,6 +47,7 @@ add_clang_library(clangDriver
+   ToolChains/Haiku.cpp
+   ToolChains/HIP.cpp
+   ToolChains/Hexagon.cpp
++  ToolChains/Hurd.cpp
+   ToolChains/Linux.cpp
+   ToolChains/MipsLinux.cpp
+   ToolChains/MinGW.cpp
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/Driver.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Driver/Driver.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/Driver.cpp
+@@ -26,6 +26,7 @@
+ #include "ToolChains/HIP.h"
+ #include "ToolChains/Haiku.h"
+ #include "ToolChains/Hexagon.h"
++#include "ToolChains/Hurd.h"
+ #include "ToolChains/Lanai.h"
+ #include "ToolChains/Linux.h"
+ #include "ToolChains/MSVC.h"
+@@ -399,6 +400,13 @@ static llvm::Triple computeTargetTriple(
+   llvm::Triple Target(llvm::Triple::normalize(TargetTriple));
++  // GNU/Hurd's triple should have been -hurd-gnu*, but was historically made
++  // -gnu* only, and we can not change this, so we have to detect that case as
++  // being the Hurd OS.
++  if (TargetTriple.find("-unknown-gnu") != StringRef::npos ||
++      TargetTriple.find("-pc-gnu") != StringRef::npos)
++    Target.setOSName("hurd");
++
+   // Handle Apple-specific options available here.
+   if (Target.isOSBinFormatMachO()) {
+     // If an explicit Darwin arch name is given, that trumps all.
+@@ -4374,6 +4382,9 @@ const ToolChain &Driver::getToolChain(co
+     case llvm::Triple::Contiki:
+       TC = llvm::make_unique<toolchains::Contiki>(*this, Target, Args);
+       break;
++    case llvm::Triple::Hurd:
++      TC = llvm::make_unique<toolchains::Hurd>(*this, Target, Args);
++      break;
+     default:
+       // Of these targets, Hexagon is the only one that might have
+       // an OS of Linux, in which case it got handled above already.
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Clang.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Driver/ToolChains/Clang.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -528,7 +528,7 @@ static bool useFramePointerForTargetByDe
+     return !areOptimizationsEnabled(Args);
+   }
+-  if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI) {
++  if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI || Triple.isOSHurd()) {
+     switch (Triple.getArch()) {
+     // Don't use a frame pointer on linux if optimizing for certain targets.
+     case llvm::Triple::mips64:
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Gnu.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Driver/ToolChains/Gnu.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -1846,7 +1846,9 @@ void Generic_GCC::GCCInstallationDetecto
+       "i686-linux-gnu",       "i686-pc-linux-gnu",     "i486-linux-gnu",
+       "i386-linux-gnu",       "i386-redhat-linux6E",   "i686-redhat-linux",
+       "i586-redhat-linux",    "i386-redhat-linux",     "i586-suse-linux",
+-      "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu"};
++      "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu",
++      "i386-gnu",             "i486-gnu",              "i586-gnu",
++      "i686-gnu"};
+   static const char *const MIPSLibDirs[] = {"/lib"};
+   static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux",
+@@ -2210,6 +2212,9 @@ void Generic_GCC::GCCInstallationDetecto
+       // triple.
+       {"i386-linux-gnu/gcc/" + CandidateTriple.str(), "../../..",
+        (TargetArch == llvm::Triple::x86 &&
++        TargetTriple.getOS() != llvm::Triple::Solaris)},
++      {"i386-gnu/gcc/" + CandidateTriple.str(), "../../..",
++       (TargetArch == llvm::Triple::x86 &&
+         TargetTriple.getOS() != llvm::Triple::Solaris)}};
+   for (auto &Suffix : Suffixes) {
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Hurd.cpp
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Hurd.cpp
+@@ -0,0 +1,191 @@
++//===--- Hurd.cpp - Hurd ToolChain Implementations --------*- C++ -*-===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#include "Hurd.h"
++#include "CommonArgs.h"
++#include "clang/Basic/VirtualFileSystem.h"
++#include "clang/Config/config.h"
++#include "clang/Driver/Driver.h"
++#include "clang/Driver/Options.h"
++#include "llvm/Support/Path.h"
++
++using namespace clang::driver;
++using namespace clang::driver::toolchains;
++using namespace clang;
++using namespace llvm::opt;
++
++using tools::addPathIfExists;
++
++/// Get our best guess at the multiarch triple for a target.
++///
++/// Debian-based systems are starting to use a multiarch setup where they use
++/// a target-triple directory in the library and header search paths.
++/// Unfortunately, this triple does not align with the vanilla target triple,
++/// so we provide a rough mapping here.
++static std::string getMultiarchTriple(const Driver &D,
++                                      const llvm::Triple &TargetTriple,
++                                      StringRef SysRoot) {
++  // For most architectures, just use whatever we have rather than trying to be
++  // clever.
++  switch (TargetTriple.getArch()) {
++  default:
++    break;
++
++  // We use the existence of '/lib/<triple>' as a directory to detect some
++  // common hurd triples that don't quite match the Clang triple for both
++  // 32-bit and 64-bit targets. Multiarch fixes its install triples to these
++  // regardless of what the actual target triple is.
++  case llvm::Triple::x86:
++    if (D.getVFS().exists(SysRoot + "/lib/i386-gnu"))
++      return "i386-gnu";
++    break;
++  }
++
++  return TargetTriple.str();
++}
++
++static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
++  // It happens that only x86 and PPC use the 'lib32' variant of oslibdir, and
++  // using that variant while targeting other architectures causes problems
++  // because the libraries are laid out in shared system roots that can't cope
++  // with a 'lib32' library search path being considered. So we only enable
++  // them when we know we may need it.
++  //
++  // FIXME: This is a bit of a hack. We should really unify this code for
++  // reasoning about oslibdir spellings with the lib dir spellings in the
++  // GCCInstallationDetector, but that is a more significant refactoring.
++
++  if (Triple.getArch() == llvm::Triple::x86)
++    return "lib32";
++
++  return Triple.isArch32Bit() ? "lib" : "lib64";
++}
++
++Hurd::Hurd(const Driver &D, const llvm::Triple &Triple,
++                 const ArgList &Args)
++    : Generic_ELF(D, Triple, Args) {
++  std::string SysRoot = computeSysRoot();
++  path_list &Paths = getFilePaths();
++
++  const std::string OSLibDir = getOSLibDir(Triple, Args);
++  const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);
++
++  // Similar to the logic for GCC above, if we currently running Clang inside
++  // of the requested system root, add its parent library paths to
++  // those searched.
++  // FIXME: It's not clear whether we should use the driver's installed
++  // directory ('Dir' below) or the ResourceDir.
++  if (StringRef(D.Dir).startswith(SysRoot)) {
++    addPathIfExists(D, D.Dir + "/../lib/" + MultiarchTriple, Paths);
++    addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths);
++  }
++
++  addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
++  addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
++
++  addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
++  addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths);
++
++  // If we are currently running Clang inside of the requested system root, add
++  // its parent library path to those searched.
++  // FIXME: It's not clear whether we should use the driver's installed
++  // directory ('Dir' below) or the ResourceDir.
++  if (StringRef(D.Dir).startswith(SysRoot))
++    addPathIfExists(D, D.Dir + "/../lib", Paths);
++
++  addPathIfExists(D, SysRoot + "/lib", Paths);
++  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++}
++
++bool Hurd::HasNativeLLVMSupport() const { return true; }
++
++Tool *Hurd::buildLinker() const { return new tools::gnutools::Linker(*this); }
++
++Tool *Hurd::buildAssembler() const {
++  return new tools::gnutools::Assembler(*this);
++}
++
++std::string Hurd::computeSysRoot() const {
++  if (!getDriver().SysRoot.empty())
++    return getDriver().SysRoot;
++
++  return std::string();
++}
++
++std::string Hurd::getDynamicLinker(const ArgList &Args) const {
++  const llvm::Triple::ArchType Arch = getArch();
++
++  if (Arch == llvm::Triple::x86)
++    return "/lib/ld.so";
++
++  llvm_unreachable("unsupported architecture");
++}
++
++void Hurd::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
++                                     ArgStringList &CC1Args) const {
++  const Driver &D = getDriver();
++  std::string SysRoot = computeSysRoot();
++
++  if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
++    return;
++
++  if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
++    addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include");
++
++  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
++    SmallString<128> P(D.ResourceDir);
++    llvm::sys::path::append(P, "include");
++    addSystemInclude(DriverArgs, CC1Args, P);
++  }
++
++  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
++    return;
++
++  // Check for configure-time C include directories.
++  StringRef CIncludeDirs(C_INCLUDE_DIRS);
++  if (CIncludeDirs != "") {
++    SmallVector<StringRef, 5> dirs;
++    CIncludeDirs.split(dirs, ":");
++    for (StringRef dir : dirs) {
++      StringRef Prefix =
++          llvm::sys::path::is_absolute(dir) ? StringRef(SysRoot) : "";
++      addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
++    }
++    return;
++  }
++
++  // Lacking those, try to detect the correct set of system includes for the
++  // target triple.
++
++  const StringRef X86MultiarchIncludeDirs[] = {
++      "/usr/include/i386-gnu"};
++
++  ArrayRef<StringRef> MultiarchIncludeDirs;
++  switch (getTriple().getArch()) {
++  case llvm::Triple::x86:
++    MultiarchIncludeDirs = X86MultiarchIncludeDirs;
++    break;
++  default:
++    break;
++  }
++
++  for (StringRef Dir : MultiarchIncludeDirs) {
++    if (D.getVFS().exists(SysRoot + Dir)) {
++      addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + Dir);
++      break;
++    }
++  }
++
++  // Add an include of '/include' directly. This isn't provided by default by
++  // system GCCs, but is often used with cross-compiling GCCs, and harmless to
++  // add even when Clang is acting as-if it were a system compiler.
++  addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include");
++
++  addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
++}
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Hurd.h
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Driver/ToolChains/Hurd.h
+@@ -0,0 +1,46 @@
++//===--- Hurd.h - Hurd ToolChain Implementations ----------*- C++ -*-===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_Hurd_H
++#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_Hurd_H
++
++#include "Gnu.h"
++#include "clang/Driver/ToolChain.h"
++
++namespace clang {
++namespace driver {
++namespace toolchains {
++
++class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_ELF {
++public:
++  Hurd(const Driver &D, const llvm::Triple &Triple,
++          const llvm::opt::ArgList &Args);
++
++  bool HasNativeLLVMSupport() const override;
++
++  void
++  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
++                            llvm::opt::ArgStringList &CC1Args) const override;
++
++  virtual std::string computeSysRoot() const;
++
++  virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const;
++
++  std::vector<std::string> ExtraOpts;
++
++protected:
++  Tool *buildAssembler() const override;
++  Tool *buildLinker() const override;
++};
++
++} // end namespace toolchains
++} // end namespace driver
++} // end namespace clang
++
++#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_Hurd_H
+Index: llvm-toolchain-7-7.0.1~+rc2/clang/lib/Frontend/InitHeaderSearch.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Frontend/InitHeaderSearch.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Frontend/InitHeaderSearch.cpp
+@@ -260,6 +260,7 @@ void InitHeaderSearch::AddDefaultCInclud
+   switch (os) {
+   case llvm::Triple::Linux:
++  case llvm::Triple::Hurd:
+   case llvm::Triple::Solaris:
+     llvm_unreachable("Include management is handled in the driver.");
+@@ -412,6 +413,7 @@
+
+   switch (os) {
+   case llvm::Triple::Linux:
++  case llvm::Triple::Hurd:
+   case llvm::Triple::Solaris:
+     llvm_unreachable("Include management is handled in the driver.");
+     break;
+@@ -460,6 +462,7 @@
+     break; // Everything else continues to use this routine's logic.
+
+   case llvm::Triple::Linux:
++  case llvm::Triple::Hurd:
+   case llvm::Triple::Solaris:
+     return;
+
diff --git a/patches/hurd/D54677-hurd-path_max.diff b/patches/hurd/D54677-hurd-path_max.diff
new file mode 100644 (file)
index 0000000..f0cafd1
--- /dev/null
@@ -0,0 +1,64 @@
+[hurd] Fix unconditional use of PATH_MAX
+
+The GNU/Hurd system does not define an arbitrary PATH_MAX limitation, the POSIX 2001 realpath extension can be used instead, and the size of symlinks can be determined.
+
+https://reviews.llvm.org/D54677
+
+Index: llvm-toolchain-7_7.0.1~svn347285/libcxx/src/filesystem/operations.cpp
+===================================================================
+--- llvm-toolchain-7_7.0.1~svn347285.orig/libcxx/src/filesystem/operations.cpp
++++ llvm-toolchain-7_7.0.1~svn347285/libcxx/src/filesystem/operations.cpp
+@@ -531,11 +531,20 @@ path __canonical(path const& orig_p, err
+   ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
+   path p = __do_absolute(orig_p, &cwd, ec);
++#if _POSIX_VERSION >= 200112 || defined(__GLIBC__)
++  char *buff;
++  if ((buff = ::realpath(p.c_str(), NULL)) == nullptr)
++    return err.report(capture_errno());
++  path ret = {buff};
++  free(buff);
++  return ret;
++#else
+   char buff[PATH_MAX + 1];
+   char* ret;
+   if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
+     return err.report(capture_errno());
+   return {ret};
++#endif
+ }
+ void __copy(const path& from, const path& to, copy_options options,
+@@ -1077,16 +1086,27 @@ void __permissions(const path& p, perms
+ path __read_symlink(const path& p, error_code* ec) {
+   ErrorHandler<path> err("read_symlink", ec, &p);
+-  char buff[PATH_MAX + 1];
+-  error_code m_ec;
++  struct stat sb;
++  if (lstat(p.c_str(), &sb) == -1) {
++    return err.report(capture_errno());
++  }
++  size_t size = sb.st_size + 1;
++  char *buff = (char*) malloc(size);
++  if (buff == NULL) {
++    return err.report(capture_errno());
++  }
++
+   ::ssize_t ret;
+-  if ((ret = ::readlink(p.c_str(), buff, PATH_MAX)) == -1) {
++  if ((ret = ::readlink(p.c_str(), buff, size)) == -1) {
++    free(buff);
+     return err.report(capture_errno());
+   }
+-  _LIBCPP_ASSERT(ret <= PATH_MAX, "TODO");
++  _LIBCPP_ASSERT(ret < size, "TODO");
+   _LIBCPP_ASSERT(ret > 0, "TODO");
+   buff[ret] = 0;
+-  return {buff};
++  path res = {buff};
++  free(buff);
++  return res;
+ }
+ bool __remove(const path& p, error_code* ec) {
diff --git a/patches/hurd/hurd-EIEIO-undef.diff b/patches/hurd/hurd-EIEIO-undef.diff
new file mode 100644 (file)
index 0000000..3b98ad9
--- /dev/null
@@ -0,0 +1,14 @@
+Index: llvm-toolchain-snapshot_3.9~svn268880/utils/TableGen/CodeEmitterGen.cpp
+===================================================================
+--- llvm-toolchain-snapshot_3.9~svn268880.orig/utils/TableGen/CodeEmitterGen.cpp
++++ llvm-toolchain-snapshot_3.9~svn268880/utils/TableGen/CodeEmitterGen.cpp
+@@ -229,6 +229,9 @@ void CodeEmitterGen::run(raw_ostream &o)
+   ArrayRef<const CodeGenInstruction*> NumberedInstructions =
+     Target.getInstructionsByEnumValue();
++  o << "// Undef for HURD\n";
++  o << "#ifdef EIEIO\n#undef EIEIO\n#endif\n";
++
+   // Emit function declaration
+   o << "uint64_t " << Target.getName();
+   o << "MCCodeEmitter::getBinaryCodeForInstr(const MCInst &MI,\n"
diff --git a/patches/hurd/hurd-cxx-paths.diff b/patches/hurd/hurd-cxx-paths.diff
new file mode 100644 (file)
index 0000000..a306884
--- /dev/null
@@ -0,0 +1,281 @@
+This should be factorized with Linux.cpp and the GNU/kFreeBSD case.
+
+Index: llvm-toolchain-7_7.0.1~svn347285/clang/lib/Driver/ToolChains/Hurd.cpp
+===================================================================
+--- llvm-toolchain-7_7.0.1~svn347285.orig/clang/lib/Driver/ToolChains/Hurd.cpp
++++ llvm-toolchain-7_7.0.1~svn347285/clang/lib/Driver/ToolChains/Hurd.cpp
+@@ -67,15 +67,102 @@ static StringRef getOSLibDir(const llvm:
+   return Triple.isArch32Bit() ? "lib" : "lib64";
+ }
++static void addMultilibsFilePaths(const Driver &D, const MultilibSet &Multilibs,
++                                  const Multilib &Multilib,
++                                  StringRef InstallPath,
++                                  ToolChain::path_list &Paths) {
++  if (const auto &PathsCallback = Multilibs.filePathsCallback())
++    for (const auto &Path : PathsCallback(Multilib))
++      addPathIfExists(D, InstallPath + Path, Paths);
++}
++
+ Hurd::Hurd(const Driver &D, const llvm::Triple &Triple,
+                  const ArgList &Args)
+     : Generic_ELF(D, Triple, Args) {
++  GCCInstallation.init(Triple, Args);
++  Multilibs = GCCInstallation.getMultilibs();
+   std::string SysRoot = computeSysRoot();
++
++  // Cross-compiling binutils and GCC installations (vanilla and openSUSE at
++  // least) put various tools in a triple-prefixed directory off of the parent
++  // of the GCC installation. We use the GCC triple here to ensure that we end
++  // up with tools that support the same amount of cross compiling as the
++  // detected GCC installation. For example, if we find a GCC installation
++  // targeting x86_64, but it is a bi-arch GCC installation, it can also be
++  // used to target i386.
++  // FIXME: This seems unlikely to be Linux- or Hurd-specific.
++  ToolChain::path_list &PPaths = getProgramPaths();
++  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
++                         GCCInstallation.getTriple().str() + "/bin")
++                       .str());
++
++#ifdef ENABLE_LINKER_BUILD_ID
++  ExtraOpts.push_back("--build-id");
++#endif
++
++  // The selection of paths to try here is designed to match the patterns which
++  // the GCC driver itself uses, as this is part of the GCC-compatible driver.
++  // This was determined by running GCC in a fake filesystem, creating all
++  // possible permutations of these directories, and seeing which ones it added
++  // to the link paths.
+   path_list &Paths = getFilePaths();
+   const std::string OSLibDir = getOSLibDir(Triple, Args);
+   const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);
++  // Add the multilib suffixed paths where they are available.
++  if (GCCInstallation.isValid()) {
++    const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
++    const std::string &LibPath = GCCInstallation.getParentLibPath();
++    const Multilib &Multilib = GCCInstallation.getMultilib();
++    const MultilibSet &Multilibs = GCCInstallation.getMultilibs();
++
++    // Add toolchain / multilib specific file paths.
++    addMultilibsFilePaths(D, Multilibs, Multilib,
++                          GCCInstallation.getInstallPath(), Paths);
++
++    // Sourcery CodeBench MIPS toolchain holds some libraries under
++    // a biarch-like suffix of the GCC installation.
++    addPathIfExists(D, GCCInstallation.getInstallPath() + Multilib.gccSuffix(),
++                    Paths);
++
++    // GCC cross compiling toolchains will install target libraries which ship
++    // as part of the toolchain under <prefix>/<triple>/<libdir> rather than as
++    // any part of the GCC installation in
++    // <prefix>/<libdir>/gcc/<triple>/<version>. This decision is somewhat
++    // debatable, but is the reality today. We need to search this tree even
++    // when we have a sysroot somewhere else. It is the responsibility of
++    // whomever is doing the cross build targeting a sysroot using a GCC
++    // installation that is *not* within the system root to ensure two things:
++    //
++    //  1) Any DSOs that are linked in from this tree or from the install path
++    //     above must be present on the system root and found via an
++    //     appropriate rpath.
++    //  2) There must not be libraries installed into
++    //     <prefix>/<triple>/<libdir> unless they should be preferred over
++    //     those within the system root.
++    //
++    // Note that this matches the GCC behavior. See the below comment for where
++    // Clang diverges from GCC's behavior.
++    addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib/../" +
++                           OSLibDir + Multilib.osSuffix(),
++                    Paths);
++
++    // If the GCC installation we found is inside of the sysroot, we want to
++    // prefer libraries installed in the parent prefix of the GCC installation.
++    // It is important to *not* use these paths when the GCC installation is
++    // outside of the system root as that can pick up unintended libraries.
++    // This usually happens when there is an external cross compiler on the
++    // host system, and a more minimal sysroot available that is the target of
++    // the cross. Note that GCC does include some of these directories in some
++    // configurations but this seems somewhere between questionable and simply
++    // a bug.
++    if (StringRef(LibPath).startswith(SysRoot)) {
++      addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
++      addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
++    }
++  }
++
+   // Similar to the logic for GCC above, if we currently running Clang inside
+   // of the requested system root, add its parent library paths to
+   // those searched.
+@@ -92,8 +179,40 @@ Hurd::Hurd(const Driver &D, const llvm::
+   addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
+   addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths);
+-  // If we are currently running Clang inside of the requested system root, add
+-  // its parent library path to those searched.
++  // Try walking via the GCC triple path in case of biarch or multiarch GCC
++  // installations with strange symlinks.
++  if (GCCInstallation.isValid()) {
++    addPathIfExists(D,
++                    SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
++                        "/../../" + OSLibDir,
++                    Paths);
++
++    // Add the 'other' biarch variant path
++    Multilib BiarchSibling;
++    if (GCCInstallation.getBiarchSibling(BiarchSibling)) {
++      addPathIfExists(D, GCCInstallation.getInstallPath() +
++                             BiarchSibling.gccSuffix(),
++                      Paths);
++    }
++
++    // See comments above on the multilib variant for details of why this is
++    // included even from outside the sysroot.
++    const std::string &LibPath = GCCInstallation.getParentLibPath();
++    const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
++    const Multilib &Multilib = GCCInstallation.getMultilib();
++    addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib" +
++                           Multilib.osSuffix(),
++                    Paths);
++
++    // See comments above on the multilib variant for details of why this is
++    // only included from within the sysroot.
++    if (StringRef(LibPath).startswith(SysRoot))
++      addPathIfExists(D, LibPath, Paths);
++  }
++
++  // Similar to the logic for GCC above, if we are currently running Clang
++  // inside of the requested system root, add its parent library path to those
++  // searched.
+   // FIXME: It's not clear whether we should use the driver's installed
+   // directory ('Dir' below) or the ResourceDir.
+   if (StringRef(D.Dir).startswith(SysRoot))
+@@ -163,6 +282,16 @@ void Hurd::AddClangSystemIncludeArgs(con
+   // Lacking those, try to detect the correct set of system includes for the
+   // target triple.
++  // Add include directories specific to the selected multilib set and multilib.
++  if (GCCInstallation.isValid()) {
++    const auto &Callback = Multilibs.includeDirsCallback();
++    if (Callback) {
++      for (const auto &Path : Callback(GCCInstallation.getMultilib()))
++        addExternCSystemIncludeIfExists(
++            DriverArgs, CC1Args, GCCInstallation.getInstallPath() + Path);
++    }
++  }
++
+   const StringRef X86MultiarchIncludeDirs[] = {
+       "/usr/include/i386-gnu"};
+@@ -189,3 +318,94 @@ void Hurd::AddClangSystemIncludeArgs(con
+   addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
+ }
++
++static std::string DetectLibcxxIncludePath(StringRef base) {
++  std::error_code EC;
++  int MaxVersion = 0;
++  std::string MaxVersionString = "";
++  for (llvm::sys::fs::directory_iterator LI(base, EC), LE; !EC && LI != LE;
++       LI = LI.increment(EC)) {
++    StringRef VersionText = llvm::sys::path::filename(LI->path());
++    int Version;
++    if (VersionText[0] == 'v' &&
++        !VersionText.slice(1, StringRef::npos).getAsInteger(10, Version)) {
++      if (Version > MaxVersion) {
++        MaxVersion = Version;
++        MaxVersionString = VersionText;
++      }
++    }
++  }
++  return MaxVersion ? (base + "/" + MaxVersionString).str() : "";
++}
++
++void Hurd::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
++                                 llvm::opt::ArgStringList &CC1Args) const {
++  const std::string& SysRoot = computeSysRoot();
++  const std::string LibCXXIncludePathCandidates[] = {
++      DetectLibcxxIncludePath(getDriver().ResourceDir + "/include/c++"),
++      DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
++      // If this is a development, non-installed, clang, libcxx will
++      // not be found at ../include/c++ but it likely to be found at
++      // one of the following two locations:
++      DetectLibcxxIncludePath(SysRoot + "/usr/local/include/c++"),
++      DetectLibcxxIncludePath(SysRoot + "/usr/include/c++") };
++  for (const auto &IncludePath : LibCXXIncludePathCandidates) {
++    if (IncludePath.empty() || !getVFS().exists(IncludePath))
++      continue;
++    // Use the first candidate that exists.
++    addSystemInclude(DriverArgs, CC1Args, IncludePath);
++    return;
++  }
++}
++
++void Hurd::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
++                                    llvm::opt::ArgStringList &CC1Args) const {
++  // We need a detected GCC installation on Hurd to provide libstdc++'s
++  // headers.
++  if (!GCCInstallation.isValid())
++    return;
++
++  // By default, look for the C++ headers in an include directory adjacent to
++  // the lib directory of the GCC installation. Note that this is expect to be
++  // equivalent to '/usr/include/c++/X.Y' in almost all cases.
++  StringRef LibDir = GCCInstallation.getParentLibPath();
++  StringRef InstallDir = GCCInstallation.getInstallPath();
++  StringRef TripleStr = GCCInstallation.getTriple().str();
++  const Multilib &Multilib = GCCInstallation.getMultilib();
++  const std::string GCCMultiarchTriple = getMultiarchTriple(
++      getDriver(), GCCInstallation.getTriple(), getDriver().SysRoot);
++  const std::string TargetMultiarchTriple =
++      getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot);
++  const GCCVersion &Version = GCCInstallation.getVersion();
++
++  // The primary search for libstdc++ supports multiarch variants.
++  if (addLibStdCXXIncludePaths(LibDir.str() + "/../include",
++                               "/c++/" + Version.Text, TripleStr,
++                               GCCMultiarchTriple, TargetMultiarchTriple,
++                               Multilib.includeSuffix(), DriverArgs, CC1Args))
++    return;
++
++  // Otherwise, fall back on a bunch of options which don't use multiarch
++  // layouts for simplicity.
++  const std::string LibStdCXXIncludePathCandidates[] = {
++      // Gentoo is weird and places its headers inside the GCC install,
++      // so if the first attempt to find the headers fails, try these patterns.
++      InstallDir.str() + "/include/g++-v" + Version.Text,
++      InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
++          Version.MinorStr,
++      InstallDir.str() + "/include/g++-v" + Version.MajorStr,
++      // Android standalone toolchain has C++ headers in yet another place.
++      LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text,
++      // Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++,
++      // without a subdirectory corresponding to the gcc version.
++      LibDir.str() + "/../include/c++",
++  };
++
++  for (const auto &IncludePath : LibStdCXXIncludePathCandidates) {
++    if (addLibStdCXXIncludePaths(IncludePath, /*Suffix*/ "", TripleStr,
++                                 /*GCCMultiarchTriple*/ "",
++                                 /*TargetMultiarchTriple*/ "",
++                                 Multilib.includeSuffix(), DriverArgs, CC1Args))
++      break;
++  }
++}
+Index: llvm-toolchain-7_7.0.1~svn347285/clang/lib/Driver/ToolChains/Hurd.h
+===================================================================
+--- llvm-toolchain-7_7.0.1~svn347285.orig/clang/lib/Driver/ToolChains/Hurd.h
++++ llvm-toolchain-7_7.0.1~svn347285/clang/lib/Driver/ToolChains/Hurd.h
+@@ -27,6 +27,12 @@ public:
+   void
+   AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+                             llvm::opt::ArgStringList &CC1Args) const override;
++  void addLibCxxIncludePaths(
++      const llvm::opt::ArgList &DriverArgs,
++      llvm::opt::ArgStringList &CC1Args) const override;
++  void addLibStdCxxIncludePaths(
++      const llvm::opt::ArgList &DriverArgs,
++      llvm::opt::ArgStringList &CC1Args) const override;
+   virtual std::string computeSysRoot() const;
diff --git a/patches/hurd/hurd-lib_Support_Unix_Path.inc.diff b/patches/hurd/hurd-lib_Support_Unix_Path.inc.diff
new file mode 100644 (file)
index 0000000..372d535
--- /dev/null
@@ -0,0 +1,43 @@
+Index: llvm-toolchain-7-7/lib/Support/Unix/Path.inc
+===================================================================
+--- llvm-toolchain-7-7.orig/lib/Support/Unix/Path.inc
++++ llvm-toolchain-7-7/lib/Support/Unix/Path.inc
+@@ -83,7 +83,7 @@
+ #define STATVFS_F_FRSIZE(vfs) static_cast<uint64_t>(vfs.f_bsize)
+ #endif
+-#if defined(__NetBSD__)
++#if defined(__NetBSD__) || defined(__GNU__)
+ #define STATVFS_F_FLAG(vfs) (vfs).f_flag
+ #else
+ #define STATVFS_F_FLAG(vfs) (vfs).f_flags
+@@ -99,7 +99,7 @@ const file_t kInvalidFile = -1;
+ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ||     \
+     defined(__minix) || defined(__FreeBSD_kernel__) || defined(__linux__) ||   \
+-    defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX)
++    defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) || defined(__GNU__)
+ static int
+ test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
+ {
+@@ -348,7 +348,7 @@ std::error_code remove(const Twine &path
+ }
+ static bool is_local_impl(struct STATVFS &Vfs) {
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__GNU__)
+ #ifndef NFS_SUPER_MAGIC
+ #define NFS_SUPER_MAGIC 0x6969
+ #endif
+@@ -358,7 +358,11 @@ static bool is_local_impl(struct STATVFS
+ #ifndef CIFS_MAGIC_NUMBER
+ #define CIFS_MAGIC_NUMBER 0xFF534D42
+ #endif
++#ifdef __GNU__
++  switch ((uint32_t)Vfs.__f_type) {
++#else
+   switch ((uint32_t)Vfs.f_type) {
++#endif
+   case NFS_SUPER_MAGIC:
+   case SMB_SUPER_MAGIC:
+   case CIFS_MAGIC_NUMBER:
diff --git a/patches/hurd/hurd-pathmax.diff b/patches/hurd/hurd-pathmax.diff
new file mode 100644 (file)
index 0000000..fcf72b7
--- /dev/null
@@ -0,0 +1,93 @@
+Index: llvm-toolchain-7_7.1.0~svn353565/clang/lib/Basic/FileManager.cpp
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/clang/lib/Basic/FileManager.cpp
++++ llvm-toolchain-7_7.1.0~svn353565/clang/lib/Basic/FileManager.cpp
+@@ -501,6 +501,12 @@ void FileManager::invalidateCache(const
+   UniqueRealFiles.erase(Entry->getUniqueID());
+ }
++// For GNU Hurd
++#if defined(__GNU__) && !defined(PATH_MAX)
++# define PATH_MAX 4096
++#endif
++
++
+ void FileManager::GetUniqueIDMapping(
+                    SmallVectorImpl<const FileEntry *> &UIDToFiles) const {
+   UIDToFiles.clear();
+Index: llvm-toolchain-7_7.1.0~svn353565/lldb/include/lldb/lldb-defines.h
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/lldb/include/lldb/lldb-defines.h
++++ llvm-toolchain-7_7.1.0~svn353565/lldb/include/lldb/lldb-defines.h
+@@ -28,6 +28,11 @@
+ #define INT32_MAX 2147483647
+ #endif
++// For GNU Hurd
++#if defined(__GNU__) && !defined(PATH_MAX)
++# define PATH_MAX 4096
++#endif
++
+ #if !defined(UINT32_MAX)
+ #define UINT32_MAX 4294967295U
+ #endif
+Index: llvm-toolchain-7_7.1.0~svn353565/lib/Support/Unix/Path.inc
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/lib/Support/Unix/Path.inc
++++ llvm-toolchain-7_7.1.0~svn353565/lib/Support/Unix/Path.inc
+@@ -49,6 +49,7 @@
+ // For GNU Hurd
+ #if defined(__GNU__) && !defined(PATH_MAX)
+ # define PATH_MAX 4096
++# define MAXPATHLEN 4096
+ #endif
+ #include <sys/types.h>
+Index: llvm-toolchain-7_7.1.0~svn353565/tools/dsymutil/DwarfLinker.cpp
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/tools/dsymutil/DwarfLinker.cpp
++++ llvm-toolchain-7_7.1.0~svn353565/tools/dsymutil/DwarfLinker.cpp
+@@ -101,6 +101,11 @@
+ #include <utility>
+ #include <vector>
++// For GNU Hurd
++#if defined(__GNU__) && !defined(PATH_MAX)
++# define PATH_MAX 4096
++#endif
++
+ namespace llvm {
+ namespace dsymutil {
+Index: llvm-toolchain-7_7.1.0~svn353565/polly/lib/External/ppcg/cuda_common.c
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/polly/lib/External/ppcg/cuda_common.c
++++ llvm-toolchain-7_7.1.0~svn353565/polly/lib/External/ppcg/cuda_common.c
+@@ -15,6 +15,11 @@
+ #include "cuda_common.h"
+ #include "ppcg.h"
++// For GNU Hurd
++#if defined(__GNU__) && !defined(PATH_MAX)
++# define PATH_MAX 4096
++#endif
++
+ /* Open the host .cu file and the kernel .hu and .cu files for writing.
+  * Add the necessary includes.
+  */
+Index: llvm-toolchain-7_7.1.0~svn353565/clang/lib/Frontend/ModuleDependencyCollector.cpp
+===================================================================
+--- llvm-toolchain-7_7.1.0~svn353565.orig/clang/lib/Frontend/ModuleDependencyCollector.cpp
++++ llvm-toolchain-7_7.1.0~svn353565/clang/lib/Frontend/ModuleDependencyCollector.cpp
+@@ -99,6 +99,11 @@ struct ModuleDependencyMMCallbacks : pub
+ }
++// For GNU Hurd
++#if defined(__GNU__) && !defined(PATH_MAX)
++# define PATH_MAX 4096
++#endif
++
+ // TODO: move this to Support/Path.h and check for HAVE_REALPATH?
+ static bool real_path(StringRef SrcPath, SmallVectorImpl<char> &RealPath) {
+ #ifdef LLVM_ON_UNIX
diff --git a/patches/hurd/hurd-tools_llvm-shlib_CMakeLists.txt.diff b/patches/hurd/hurd-tools_llvm-shlib_CMakeLists.txt.diff
new file mode 100644 (file)
index 0000000..89d34fc
--- /dev/null
@@ -0,0 +1,12 @@
+Index: llvm-toolchain-7-7/tools/llvm-shlib/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.orig/tools/llvm-shlib/CMakeLists.txt
++++ llvm-toolchain-7-7/tools/llvm-shlib/CMakeLists.txt
+@@ -40,6 +40,7 @@ set_property(TARGET LLVM PROPERTY VERSIO
+ list(REMOVE_DUPLICATES LIB_NAMES)
+ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
++   OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
diff --git a/patches/hurd/impl-path-hurd.diff b/patches/hurd/impl-path-hurd.diff
new file mode 100644 (file)
index 0000000..4d7b7a6
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_7~svn334230/lib/Support/Unix/Path.inc
+===================================================================
+--- llvm-toolchain-snapshot_7~svn334230.orig/lib/Support/Unix/Path.inc
++++ llvm-toolchain-snapshot_7~svn334230/lib/Support/Unix/Path.inc
+@@ -175,7 +175,7 @@ std::string getMainExecutable(const char
+   if (getprogpath(exe_path, argv0) != NULL)
+     return exe_path;
+-#elif defined(__linux__) || defined(__CYGWIN__)
++#elif defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__)
+   char exe_path[MAXPATHLEN];
+   StringRef aPath("/proc/self/exe");
+   if (sys::fs::exists(aPath)) {
diff --git a/patches/install-scan-build-py.diff b/patches/install-scan-build-py.diff
new file mode 100644 (file)
index 0000000..4f118f3
--- /dev/null
@@ -0,0 +1,16 @@
+---
+ clang/tools/CMakeLists.txt |    1 +
+ 1 file changed, 1 insertion(+)
+
+Index: llvm-toolchain-snapshot_6.0~svn314025/clang/tools/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn314025.orig/clang/tools/CMakeLists.txt
++++ llvm-toolchain-snapshot_6.0~svn314025/clang/tools/CMakeLists.txt
+@@ -23,6 +23,7 @@ if(CLANG_ENABLE_STATIC_ANALYZER)
+   add_clang_subdirectory(clang-check)
+   add_clang_subdirectory(clang-func-mapping)
+   add_clang_subdirectory(scan-build)
++  add_clang_subdirectory(scan-build-py)
+   add_clang_subdirectory(scan-view)
+ endif()
diff --git a/patches/kfreebsd/CMakeLists.txt.diff b/patches/kfreebsd/CMakeLists.txt.diff
new file mode 100644 (file)
index 0000000..30ec60e
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-7-7.0.1/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/CMakeLists.txt
++++ llvm-toolchain-7-7.0.1/CMakeLists.txt
+@@ -821,7 +821,7 @@ if(LLVM_TARGET_IS_CROSSCOMPILE_HOST)
+ # (this is a variable that CrossCompile sets on recursive invocations)
+ endif()
+-if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
++if( ${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)" AND NOT "kFreeBSD" )
+   # On FreeBSD, /usr/local/* is not used by default. In order to build LLVM
+   # with libxml2, iconv.h, etc., we must add /usr/local paths.
+   include_directories(SYSTEM "/usr/local/include")
diff --git a/patches/kfreebsd/clang_lib_Basic_Targets.diff b/patches/kfreebsd/clang_lib_Basic_Targets.diff
new file mode 100644 (file)
index 0000000..8361b81
--- /dev/null
@@ -0,0 +1,48 @@
+Index: llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/clang/lib/Basic/Targets.cpp
++++ llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets.cpp
+@@ -469,8 +469,8 @@ TargetInfo *AllocateTarget(const llvm::T
+       return new OpenBSDI386TargetInfo(Triple, Opts);
+     case llvm::Triple::FreeBSD:
+       return new FreeBSDTargetInfo<X86_32TargetInfo>(Triple, Opts);
+-    case llvm::Triple::KFreeBSD:
+-      return new KFreeBSDTargetInfo<X86_32TargetInfo>(Triple, Opts);
++    case llvm::Triple::kFreeBSD:
++      return new kFreeBSDTargetInfo<X86_32TargetInfo>(Triple, Opts);
+     case llvm::Triple::Minix:
+       return new MinixTargetInfo<X86_32TargetInfo>(Triple, Opts);
+     case llvm::Triple::Solaris:
+@@ -528,8 +528,8 @@ TargetInfo *AllocateTarget(const llvm::T
+       return new FreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
+     case llvm::Triple::Fuchsia:
+       return new FuchsiaTargetInfo<X86_64TargetInfo>(Triple, Opts);
+-    case llvm::Triple::KFreeBSD:
+-      return new KFreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
++    case llvm::Triple::kFreeBSD:
++      return new kFreeBSDTargetInfo<X86_64TargetInfo>(Triple, Opts);
+     case llvm::Triple::Solaris:
+       return new SolarisTargetInfo<X86_64TargetInfo>(Triple, Opts);
+     case llvm::Triple::Win32: {
+Index: llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets/OSTargets.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/clang/lib/Basic/Targets/OSTargets.h
++++ llvm-toolchain-7-7.0.1/clang/lib/Basic/Targets/OSTargets.h
+@@ -226,7 +226,7 @@ public:
+ // GNU/kFreeBSD Target
+ template <typename Target>
+-class LLVM_LIBRARY_VISIBILITY KFreeBSDTargetInfo : public OSTargetInfo<Target> {
++class LLVM_LIBRARY_VISIBILITY kFreeBSDTargetInfo : public OSTargetInfo<Target> {
+ protected:
+   void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
+                     MacroBuilder &Builder) const override {
+@@ -243,7 +243,7 @@ protected:
+   }
+ public:
+-  KFreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
++  kFreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+       : OSTargetInfo<Target>(Triple, Opts) {}
+ };
diff --git a/patches/kfreebsd/compiler-rt_lib.diff b/patches/kfreebsd/compiler-rt_lib.diff
new file mode 100644 (file)
index 0000000..e94c723
--- /dev/null
@@ -0,0 +1,528 @@
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
+@@ -86,9 +86,14 @@
+ extern "C" {
+ // <sys/umtx.h> must be included after <errno.h> and <sys/types.h> on
+ // FreeBSD 9.2 and 10.0.
++#if SANITIZER_KFREEBSD
++#include <bsd/sys/cdefs.h>
++#endif
+ #include <sys/umtx.h>
+ }
++#if !SANITIZER_KFREEBSD
+ #include <sys/thr.h>
++#endif
+ #endif  // SANITIZER_FREEBSD
+ #if SANITIZER_NETBSD
+@@ -466,10 +471,12 @@ bool FileExists(const char *filename) {
+ }
+ tid_t GetTid() {
+-#if SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
+   long Tid;
+   thr_self(&Tid);
+   return Tid;
++#elif SANITIZER_KFREEBSD
++  return (uptr)pthread_self();
+ #elif SANITIZER_OPENBSD
+   return internal_syscall(SYSCALL(getthrid));
+ #elif SANITIZER_NETBSD
+@@ -1143,10 +1150,10 @@ bool LibraryNameIs(const char *full_name
+ // Call cb for each region mapped by map.
+ void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr)) {
+   CHECK_NE(map, nullptr);
+-#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD || SANITIZER_KFREEBSD
+   typedef ElfW(Phdr) Elf_Phdr;
+   typedef ElfW(Ehdr) Elf_Ehdr;
+-#endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
++#endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD || SANITIZER_KFREEBSD
+   char *base = (char *)map->l_addr;
+   Elf_Ehdr *ehdr = (Elf_Ehdr *)base;
+   char *phdrs = base + ehdr->e_phoff;
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
+@@ -35,10 +35,12 @@
+ #include <syslog.h>
+ #if SANITIZER_FREEBSD
+-#include <pthread_np.h>
++# if !SANITIZER_KFREEBSD
++# include <pthread_np.h>
++# define pthread_getattr_np pthread_attr_get_np
++# endif
+ #include <osreldate.h>
+ #include <sys/sysctl.h>
+-#define pthread_getattr_np pthread_attr_get_np
+ #endif
+ #if SANITIZER_OPENBSD
+@@ -523,9 +525,9 @@ void GetThreadStackAndTls(bool main, upt
+ #endif
+ }
+-#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD || SANITIZER_KFREEBSD
+ typedef ElfW(Phdr) Elf_Phdr;
+-#elif SANITIZER_WORDSIZE == 32 && __FreeBSD_version <= 902001 // v9.2
++#elif SANITIZER_WORDSIZE == 32 && !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
+ #define Elf_Phdr XElf32_Phdr
+ #define dl_phdr_info xdl_phdr_info
+ #define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b))
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+@@ -16,7 +16,7 @@
+ #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
+   !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(_WIN32) && \
+   !defined(__Fuchsia__) && !defined(__rtems__) && \
+-  !(defined(__sun__) && defined(__svr4__))
++  !(defined(__sun__) && defined(__svr4__)) && !defined(__FreeBSD_kernel__)
+ # error "This operating system is not supported"
+ #endif
+@@ -26,12 +26,18 @@
+ # define SANITIZER_LINUX   0
+ #endif
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ # define SANITIZER_FREEBSD 1
+ #else
+ # define SANITIZER_FREEBSD 0
+ #endif
++#if defined(__FreeBSD_kernel__)
++# define SANITIZER_KFREEBSD 1
++#else
++# define SANITIZER_KFREEBSD 0
++#endif
++
+ #if defined(__NetBSD__)
+ # define SANITIZER_NETBSD 1
+ #else
+@@ -113,7 +119,8 @@
+ #define SANITIZER_POSIX \
+   (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || \
+-    SANITIZER_NETBSD || SANITIZER_OPENBSD || SANITIZER_SOLARIS)
++    SANITIZER_NETBSD || SANITIZER_OPENBSD || SANITIZER_SOLARIS || \
++    SANITIZER_KFREEBSD)
+ #if __LP64__ || defined(_WIN64)
+ #  define SANITIZER_WORDSIZE 64
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -49,7 +49,7 @@
+ #include <utmp.h>
+ #endif
+-#if !SANITIZER_IOS
++#if !SANITIZER_IOS && !SANITIZER_KFREEBSD
+ #include <net/route.h>
+ #endif
+@@ -86,7 +86,11 @@
+ # include <sys/signal.h>
+ # include <sys/timespec.h>
+ # include <sys/timex.h>
++#if SANITIZER_KFREEBSD
++# include <mqueue.h>
++#else
+ # include <sys/mqueue.h>
++#endif
+ # include <sys/msg.h>
+ # include <sys/ipc.h>
+ # include <sys/msg.h>
+@@ -95,7 +99,11 @@
+ # include <sys/mtio.h>
+ # include <sys/consio.h>
+ # include <sys/kbio.h>
++#if SANITIZER_KFREEBSD
++# include <link.h>
++#else
+ # include <sys/link_elf.h>
++#endif
+ # include <netinet/ip_mroute.h>
+ # include <netinet/in.h>
+ # include <net/ethernet.h>
+@@ -286,7 +294,7 @@ namespace __sanitizer {
+ #endif
+-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
++#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
+   unsigned struct_shminfo_sz = sizeof(struct shminfo);
+   unsigned struct_shm_info_sz = sizeof(struct shm_info);
+   int shmctl_ipc_stat = (int)IPC_STAT;
+@@ -316,7 +324,7 @@ namespace __sanitizer {
+       return 0;
+   }
+-#if SANITIZER_LINUX
++#if SANITIZER_LINUX || SANITIZER_KFREEBSD
+ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
+ #elif SANITIZER_FREEBSD
+ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+@@ -496,7 +504,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
+   unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
+ #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
+-#if !SANITIZER_ANDROID && !SANITIZER_MAC
++#if !SANITIZER_ANDROID && !SANITIZER_MAC && !SANITIZER_KFREEBSD
+   unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req);
+   unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req);
+ #endif
+@@ -547,7 +555,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
+   unsigned IOCTL_TIOCSPGRP = TIOCSPGRP;
+   unsigned IOCTL_TIOCSTI = TIOCSTI;
+   unsigned IOCTL_TIOCSWINSZ = TIOCSWINSZ;
+-#if ((SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID)
++#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
+   unsigned IOCTL_SIOCGETSGCNT = SIOCGETSGCNT;
+   unsigned IOCTL_SIOCGETVIFCNT = SIOCGETVIFCNT;
+ #endif
+@@ -989,7 +997,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi
+ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
+ #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
+-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
++#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
+ CHECK_TYPE_SIZE(glob_t);
+ CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
+ CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
+@@ -1009,8 +1017,10 @@ CHECK_SIZE_AND_OFFSET(addrinfo, ai_sockt
+ CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
+ CHECK_SIZE_AND_OFFSET(addrinfo, ai_protocol);
+ CHECK_SIZE_AND_OFFSET(addrinfo, ai_addrlen);
++#if !SANITIZER_KFREEBSD
+ CHECK_SIZE_AND_OFFSET(addrinfo, ai_canonname);
+ CHECK_SIZE_AND_OFFSET(addrinfo, ai_addr);
++#endif
+ CHECK_TYPE_SIZE(hostent);
+ CHECK_SIZE_AND_OFFSET(hostent, h_name);
+@@ -1032,7 +1042,9 @@ CHECK_SIZE_AND_OFFSET(msghdr, msg_contro
+ CHECK_SIZE_AND_OFFSET(msghdr, msg_controllen);
+ CHECK_SIZE_AND_OFFSET(msghdr, msg_flags);
++#if !SANITIZER_KFREEBSD
+ CHECK_TYPE_SIZE(cmsghdr);
++#endif
+ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
+ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
+ CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
+@@ -1074,7 +1086,9 @@ CHECK_SIZE_AND_OFFSET(pollfd, fd);
+ CHECK_SIZE_AND_OFFSET(pollfd, events);
+ CHECK_SIZE_AND_OFFSET(pollfd, revents);
++#if !SANITIZER_KFREEBSD
+ CHECK_TYPE_SIZE(nfds_t);
++#endif
+ CHECK_TYPE_SIZE(sigset_t);
+@@ -1114,7 +1128,9 @@ CHECK_TYPE_SIZE(__kernel_fd_set);
+ #endif
+ #if !SANITIZER_ANDROID
++# if !SANITIZER_KFREEBSD
+ CHECK_TYPE_SIZE(wordexp_t);
++# endif
+ CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordc);
+ CHECK_SIZE_AND_OFFSET(wordexp_t, we_wordv);
+ CHECK_SIZE_AND_OFFSET(wordexp_t, we_offs);
+@@ -1147,13 +1163,14 @@ CHECK_TYPE_SIZE(ether_addr);
+ #if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
+ CHECK_TYPE_SIZE(ipc_perm);
+-# if SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
+ CHECK_SIZE_AND_OFFSET(ipc_perm, key);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, seq);
+-# else
++#endif
++#if !SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
+ CHECK_SIZE_AND_OFFSET(ipc_perm, __key);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, __seq);
+-# endif
++#endif
+ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
+ CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
+@@ -1192,7 +1209,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_netma
+ #ifdef ifa_dstaddr
+ #undef ifa_dstaddr
+ #endif
+-# if SANITIZER_FREEBSD
++# if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
+ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
+ # else
+ COMPILER_CHECK(sizeof(((__sanitizer_ifaddrs *)nullptr)->ifa_dstaddr) ==
+@@ -1218,15 +1235,19 @@ CHECK_SIZE_AND_OFFSET(timeb, timezone);
+ CHECK_SIZE_AND_OFFSET(timeb, dstflag);
+ #endif
++#if !SANITIZER_KFREEBSD
+ CHECK_TYPE_SIZE(passwd);
++#endif
+ CHECK_SIZE_AND_OFFSET(passwd, pw_name);
+ CHECK_SIZE_AND_OFFSET(passwd, pw_passwd);
+ CHECK_SIZE_AND_OFFSET(passwd, pw_uid);
+ CHECK_SIZE_AND_OFFSET(passwd, pw_gid);
++#if !SANITIZER_KFREEBSD
+ CHECK_SIZE_AND_OFFSET(passwd, pw_dir);
+ CHECK_SIZE_AND_OFFSET(passwd, pw_shell);
++#endif
+-#if !SANITIZER_ANDROID
++#if !SANITIZER_ANDROID && !SANITIZER_KFREEBSD
+ CHECK_SIZE_AND_OFFSET(passwd, pw_gecos);
+ #endif
+@@ -1292,7 +1313,7 @@ CHECK_SIZE_AND_OFFSET(cookie_io_function
+ CHECK_SIZE_AND_OFFSET(cookie_io_functions_t, close);
+ #endif
+-#if SANITIZER_LINUX || SANITIZER_FREEBSD
++#if SANITIZER_LINUX || (SANITIZER_FREEBSD && !SANITIZER_KFREEBSD)
+ CHECK_TYPE_SIZE(sem_t);
+ #endif
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -20,7 +20,7 @@
+ #include "sanitizer_internal_defs.h"
+ #include "sanitizer_platform.h"
+-#if SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
+ // FreeBSD's dlopen() returns a pointer to an Obj_Entry structure that
+ // incorporates the map structure.
+ # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
+@@ -43,7 +43,7 @@
+ # else
+ #  define internal_syscall_ptr  syscall
+ # endif
+-#elif defined(__x86_64__) && (SANITIZER_FREEBSD || SANITIZER_MAC)
++#elif defined(__x86_64__) && ((SANITIZER_FREEBSD && !SANITIZER_KFREEBSD) || SANITIZER_MAC)
+ # define internal_syscall __syscall
+ # define internal_syscall64 __syscall
+ # define internal_syscall_ptr __syscall
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/asan/asan_linux.cc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/asan/asan_linux.cc
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/asan/asan_linux.cc
+@@ -38,7 +38,7 @@
+ #include <unistd.h>
+ #include <unwind.h>
+-#if SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD && !SANITIZER_KFREEBSD
+ #include <sys/link_elf.h>
+ #endif
+@@ -48,7 +48,11 @@
+ #if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
+ #include <ucontext.h>
++#if SANITIZER_KFREEBSD
++#include <link.h>
++#else
+ extern "C" void* _DYNAMIC;
++#endif
+ #elif SANITIZER_NETBSD
+ #include <link_elf.h>
+ #include <ucontext.h>
+@@ -61,7 +65,7 @@ extern Elf_Dyn _DYNAMIC;
+ // x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in
+ // 32-bit mode.
+ #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \
+-  __FreeBSD_version <= 902001  // v9.2
++  !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001  // v9.2
+ #define ucontext_t xucontext_t
+ #endif
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/ubsan/ubsan_platform.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/ubsan/ubsan_platform.h
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/ubsan/ubsan_platform.h
+@@ -15,7 +15,7 @@
+ // Other platforms should be easy to add, and probably work as-is.
+ #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ||        \
+-    defined(__NetBSD__) || defined(__OpenBSD__) || \
++    defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || \
+     (defined(__sun__) && defined(__svr4__)) || \
+     defined(_WIN32) || defined(__Fuchsia__) || defined(__rtems__)
+ # define CAN_SANITIZE_UB 1
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
+@@ -196,7 +196,7 @@ ASM_SYMBOL_INTERCEPTOR(setjmp):
+ #elif defined(__APPLE__)
+   lea 16(%rsp), %rdi
+   mov %rdi, %rsi
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD_kernel__)
+   lea 16(%rsp), %rdi
+   mov %rdi, %rsi
+   xor %fs:0x30, %rsi  // magic mangling of rsp (see libc setjmp)
+@@ -244,7 +244,7 @@ ASM_SYMBOL_INTERCEPTOR(_setjmp):
+ #elif defined(__APPLE__)
+   lea 16(%rsp), %rdi
+   mov %rdi, %rsi
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD_kernel__)
+   lea 16(%rsp), %rdi
+   mov %rdi, %rsi
+   xor %fs:0x30, %rsi  // magic mangling of rsp (see libc setjmp)
+@@ -299,7 +299,7 @@ ASM_SYMBOL_INTERCEPTOR(sigsetjmp):
+ #elif defined(__APPLE__)
+   lea 32(%rsp), %rdi
+   mov %rdi, %rsi
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD_kernel__)
+   lea 32(%rsp), %rdi
+   mov %rdi, %rsi
+   xor %fs:0x30, %rsi  // magic mangling of rsp (see libc setjmp)
+@@ -386,7 +386,7 @@ ASM_SYMBOL_INTERCEPTOR(__sigsetjmp):
+ ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp))
+ #endif  // !defined(__APPLE__) && !defined(__NetBSD__)
+-#if defined(__FreeBSD__) || defined(__linux__)
++#if defined(__FreeBSD__) || defined(__linux__) || defined(__FreeBSD_kernel__)
+ /* We do not need executable stack.  */
+ /* This note is not needed on NetBSD. */
+ .section        .note.GNU-stack,"",@progbits
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerDefs.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/fuzzer/FuzzerDefs.h
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerDefs.h
+@@ -26,6 +26,7 @@
+ #define LIBFUZZER_APPLE 0
+ #define LIBFUZZER_FUCHSIA 0
+ #define LIBFUZZER_LINUX 1
++#define LIBFUZZER_KFREEBSD 0
+ #define LIBFUZZER_NETBSD 0
+ #define LIBFUZZER_FREEBSD 0
+ #define LIBFUZZER_OPENBSD 0
+@@ -54,6 +55,15 @@
+ #define LIBFUZZER_FREEBSD 1
+ #define LIBFUZZER_OPENBSD 0
+ #define LIBFUZZER_WINDOWS 0
++#elif __FreeBSD_kernel__
++#define LIBFUZZER_APPLE 0
++#define LIBFUZZER_FUCHSIA 0
++#define LIBFUZZER_LINUX 0
++#define LIBFUZZER_NETBSD 0
++#define LIBFUZZER_FREEBSD 0
++#define LIBFUZZER_KFREEBSD 1
++#define LIBFUZZER_OPENBSD 0
++#define LIBFUZZER_WINDOWS 0
+ #elif __OpenBSD__
+ #define LIBFUZZER_APPLE 0
+ #define LIBFUZZER_FUCHSIA 0
+@@ -88,7 +98,7 @@
+ #define LIBFUZZER_POSIX                                                        \
+   (LIBFUZZER_APPLE || LIBFUZZER_LINUX || LIBFUZZER_NETBSD ||                   \
+-   LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD)
++   LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD)
+ #ifdef __x86_64
+ #  if __has_attribute(target)
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
+@@ -119,7 +119,7 @@ size_t GetPeakRSSMb() {
+   if (getrusage(RUSAGE_SELF, &usage))
+     return 0;
+   if (LIBFUZZER_LINUX || LIBFUZZER_FREEBSD || LIBFUZZER_NETBSD ||
+-      LIBFUZZER_OPENBSD) {
++      LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD) {
+     // ru_maxrss is in KiB
+     return usage.ru_maxrss >> 10;
+   } else if (LIBFUZZER_APPLE) {
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
+@@ -12,7 +12,7 @@
+ #include "FuzzerDefs.h"
+ #if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD ||                \
+-    LIBFUZZER_OPENBSD
++    LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD
+ __attribute__((weak)) extern uint8_t __start___libfuzzer_extra_counters;
+ __attribute__((weak)) extern uint8_t __stop___libfuzzer_extra_counters;
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
+@@ -14,7 +14,7 @@
+ //===----------------------------------------------------------------------===//
+ #include "FuzzerDefs.h"
+ #if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FUCHSIA ||                \
+-    LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD
++    LIBFUZZER_FREEBSD || LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD
+ #include "FuzzerExtFunctions.h"
+ #include "FuzzerIO.h"
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
+@@ -10,7 +10,7 @@
+ //===----------------------------------------------------------------------===//
+ #include "FuzzerDefs.h"
+ #if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD ||                \
+-    LIBFUZZER_OPENBSD
++    LIBFUZZER_OPENBSD || LIBFUZZER_KFREEBSD
+ #include "FuzzerCommand.h"
+ #include <stdlib.h>
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
+@@ -21,7 +21,7 @@
+ // 32-bit mode.
+ #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
+ # include <osreldate.h>
+-# if __FreeBSD_version <= 902001  // v9.2
++# if !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
+ #  include <link.h>
+ #  include <sys/param.h>
+ #  include <ucontext.h>
+Index: llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
++++ llvm-toolchain-7-7.0.1/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
+@@ -38,7 +38,7 @@
+ // Fix 'kinfo_vmentry' definition on FreeBSD prior v9.2 in 32-bit mode.
+ #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
+ #include <osreldate.h>
+-#if __FreeBSD_version <= 902001 // v9.2
++#if !SANITIZER_KFREEBSD && __FreeBSD_version <= 902001 // v9.2
+ #define kinfo_vmentry xkinfo_vmentry
+ #endif
+ #endif
diff --git a/patches/kfreebsd/include_llvm_ADT_Triple.h.diff b/patches/kfreebsd/include_llvm_ADT_Triple.h.diff
new file mode 100644 (file)
index 0000000..219c7a2
--- /dev/null
@@ -0,0 +1,33 @@
+Index: llvm-toolchain-7-7.0.1/include/llvm/ADT/Triple.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/include/llvm/ADT/Triple.h
++++ llvm-toolchain-7-7.0.1/include/llvm/ADT/Triple.h
+@@ -158,7 +158,7 @@ public:
+     FreeBSD,
+     Fuchsia,
+     IOS,
+-    KFreeBSD,
++    kFreeBSD,
+     Linux,
+     Lv2,        // PS3
+     MacOSX,
+@@ -575,8 +575,8 @@ public:
+   }
+   /// Tests whether the OS is kFreeBSD.
+-  bool isOSKFreeBSD() const {
+-    return getOS() == Triple::KFreeBSD;
++  bool isOSkFreeBSD() const {
++    return getOS() == Triple::kFreeBSD;
+   }
+   /// Tests whether the OS is Hurd.
+@@ -586,7 +586,7 @@ public:
+   /// Tests whether the OS uses glibc.
+   bool isOSGlibc() const {
+-    return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
++    return (getOS() == Triple::Linux || getOS() == Triple::kFreeBSD ||
+             getOS() == Triple::Hurd) &&
+            !isAndroid();
+   }
diff --git a/patches/kfreebsd/include_llvm_MC_MCELFObjectWriter.h.diff b/patches/kfreebsd/include_llvm_MC_MCELFObjectWriter.h.diff
new file mode 100644 (file)
index 0000000..35bfffa
--- /dev/null
@@ -0,0 +1,12 @@
+Index: llvm-toolchain-7-7.0.1/include/llvm/MC/MCELFObjectWriter.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/include/llvm/MC/MCELFObjectWriter.h
++++ llvm-toolchain-7-7.0.1/include/llvm/MC/MCELFObjectWriter.h
+@@ -75,6 +75,7 @@ public:
+         return ELF::ELFOSABI_CLOUDABI;
+       case Triple::PS4:
+       case Triple::FreeBSD:
++      case Triple::kFreeBSD:
+         return ELF::ELFOSABI_FREEBSD;
+       default:
+         return ELF::ELFOSABI_NONE;
diff --git a/patches/kfreebsd/kfreebsd-libcxx-threads-detection.diff b/patches/kfreebsd/kfreebsd-libcxx-threads-detection.diff
new file mode 100644 (file)
index 0000000..ae37db2
--- /dev/null
@@ -0,0 +1,12 @@
+Index: llvm-toolchain-7-7.0.1/libcxx/include/__config
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/libcxx/include/__config
++++ llvm-toolchain-7-7.0.1/libcxx/include/__config
+@@ -1107,6 +1107,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
+     !defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
+     !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+ #  if defined(__FreeBSD__) || \
++      defined(__FreeBSD_kernel__) || \
+       defined(__Fuchsia__) || \
+       defined(__NetBSD__) || \
+       defined(__linux__) || \
diff --git a/patches/kfreebsd/kfreebsd-openmp.diff b/patches/kfreebsd/kfreebsd-openmp.diff
new file mode 100644 (file)
index 0000000..2ca72e1
--- /dev/null
@@ -0,0 +1,128 @@
+Index: llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/openmp/runtime/src/kmp.h
++++ llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp.h
+@@ -1052,6 +1052,10 @@ extern kmp_uint64 __kmp_now_nsec();
+ /* TODO: tune for KMP_OS_HURD */
+ #define KMP_INIT_WAIT 1024U /* initial number of spin-tests   */
+ #define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
++#elif KMP_OS_KFREEBSD
++/* TODO: tune for KMP_OS_KFREEBSD */
++#define KMP_INIT_WAIT 1024U /* initial number of spin-tests   */
++#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
+ #endif
+ #if KMP_ARCH_X86 || KMP_ARCH_X86_64
+Index: llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp_ftn_entry.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/openmp/runtime/src/kmp_ftn_entry.h
++++ llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp_ftn_entry.h
+@@ -369,7 +369,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_
+ #else
+   int gtid;
+-#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
++#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
+   gtid = __kmp_entry_gtid();
+ #elif KMP_OS_WINDOWS
+   if (!__kmp_init_parallel ||
+Index: llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp_platform.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/openmp/runtime/src/kmp_platform.h
++++ llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp_platform.h
+@@ -18,6 +18,7 @@
+ #define KMP_OS_LINUX 0
+ #define KMP_OS_FREEBSD 0
++#define KMP_OS_KFREEBSD 0
+ #define KMP_OS_NETBSD 0
+ #define KMP_OS_DARWIN 0
+ #define KMP_OS_WINDOWS 0
+@@ -50,6 +51,11 @@
+ #define KMP_OS_FREEBSD 1
+ #endif
++#if (defined __FreeBSD_kernel__)
++#undef KMP_OS_KFREEBSD
++#define KMP_OS_KFREEBSD 1
++#endif
++
+ #if (defined __NetBSD__)
+ #undef KMP_OS_NETBSD
+ #define KMP_OS_NETBSD 1
+@@ -67,11 +73,11 @@
+ #if (1 !=                                                                      \
+      KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_NETBSD + KMP_OS_DARWIN +           \
+-         KMP_OS_WINDOWS + KMP_OS_HURD)
++         KMP_OS_WINDOWS + KMP_OS_HURD + KMP_OS_KFREEBSD)
+ #error Unknown OS
+ #endif
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_KFREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN || KMP_OS_HURD
+ #undef KMP_OS_UNIX
+ #define KMP_OS_UNIX 1
+ #endif
+Index: llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp_runtime.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/openmp/runtime/src/kmp_runtime.cpp
++++ llvm-toolchain-7-7.0.1/openmp/runtime/src/kmp_runtime.cpp
+@@ -7643,7 +7643,7 @@ __kmp_determine_reduction_method(
+ #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64
+ #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS ||       \
+-    KMP_OS_DARWIN || KMP_OS_HURD
++    KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD
+     int teamsize_cutoff = 4;
+@@ -7670,7 +7670,7 @@ __kmp_determine_reduction_method(
+ #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
+-#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD || KMP_OS_KFREEBSD
+     // basic tuning
+Index: llvm-toolchain-7-7.0.1/openmp/runtime/src/z_Linux_util.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/openmp/runtime/src/z_Linux_util.cpp
++++ llvm-toolchain-7-7.0.1/openmp/runtime/src/z_Linux_util.cpp
+@@ -444,7 +444,7 @@ void __kmp_terminate_thread(int gtid) {
+    determined exactly, FALSE if incremental refinement is necessary. */
+ static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
+   int stack_data;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
+   pthread_attr_t attr;
+   int status;
+   size_t size = 0;
+@@ -496,7 +496,7 @@ static void *__kmp_launch_worker(void *t
+   sigset_t new_set, old_set;
+ #endif /* KMP_BLOCK_SIGNALS */
+   void *exit_val;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
+   void *volatile padding = 0;
+ #endif
+   int gtid;
+@@ -1764,7 +1764,7 @@ static int __kmp_get_xproc(void) {
+   int r = 0;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
+   r = sysconf(_SC_NPROCESSORS_ONLN);
+@@ -1952,7 +1952,7 @@ int __kmp_is_address_mapped(void *addr)
+   int found = 0;
+   int rc;
+-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD
++#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
+   /* On GNUish OSes, read the /proc/<pid>/maps pseudo-file to get all the address
+      ranges mapped into the address space. */
diff --git a/patches/kfreebsd/kfreebsd-threads-build.diff b/patches/kfreebsd/kfreebsd-threads-build.diff
new file mode 100644 (file)
index 0000000..7ed8ed6
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-7-7.0.1/libcxx/src/thread.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/libcxx/src/thread.cpp
++++ llvm-toolchain-7-7.0.1/libcxx/src/thread.cpp
+@@ -19,7 +19,7 @@
+ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+ # include <sys/param.h>
+-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
++# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+ #   include <sys/sysctl.h>
+ # endif
+ #endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
diff --git a/patches/kfreebsd/kfreebsd-triple-clang.diff b/patches/kfreebsd/kfreebsd-triple-clang.diff
new file mode 100644 (file)
index 0000000..37b2950
--- /dev/null
@@ -0,0 +1,633 @@
+Index: llvm-toolchain-7-7.0.1/clang/lib/Driver/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/clang/lib/Driver/CMakeLists.txt
++++ llvm-toolchain-7-7.0.1/clang/lib/Driver/CMakeLists.txt
+@@ -48,6 +48,7 @@ add_clang_library(clangDriver
+   ToolChains/HIP.cpp
+   ToolChains/Hexagon.cpp
+   ToolChains/Hurd.cpp
++  ToolChains/KFreeBSD.cpp
+   ToolChains/Linux.cpp
+   ToolChains/MipsLinux.cpp
+   ToolChains/MinGW.cpp
+Index: llvm-toolchain-7-7.0.1/clang/lib/Driver/Driver.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/clang/lib/Driver/Driver.cpp
++++ llvm-toolchain-7-7.0.1/clang/lib/Driver/Driver.cpp
+@@ -27,6 +27,7 @@
+ #include "ToolChains/Haiku.h"
+ #include "ToolChains/Hexagon.h"
+ #include "ToolChains/Hurd.h"
++#include "ToolChains/KFreeBSD.h"
+ #include "ToolChains/Lanai.h"
+ #include "ToolChains/Linux.h"
+ #include "ToolChains/MSVC.h"
+@@ -4320,6 +4321,9 @@ const ToolChain &Driver::getToolChain(co
+     case llvm::Triple::FreeBSD:
+       TC = llvm::make_unique<toolchains::FreeBSD>(*this, Target, Args);
+       break;
++    case llvm::Triple::kFreeBSD:
++      TC = llvm::make_unique<toolchains::kFreeBSD>(*this, Target, Args);
++      break;
+     case llvm::Triple::Minix:
+       TC = llvm::make_unique<toolchains::Minix>(*this, Target, Args);
+       break;
+Index: llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/Clang.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/clang/lib/Driver/ToolChains/Clang.cpp
++++ llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -528,7 +528,7 @@ static bool useFramePointerForTargetByDe
+     return !areOptimizationsEnabled(Args);
+   }
+-  if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI || Triple.isOSHurd()) {
++  if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI || Triple.isOSHurd() || Triple.isOSkFreeBSD()) {
+     switch (Triple.getArch()) {
+     // Don't use a frame pointer on linux if optimizing for certain targets.
+     case llvm::Triple::mips64:
+Index: llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/Gnu.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/clang/lib/Driver/ToolChains/Gnu.cpp
++++ llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -234,6 +234,8 @@ static const char *getLDMOption(const ll
+   case llvm::Triple::x86:
+     if (T.isOSIAMCU())
+       return "elf_iamcu";
++    if (T.isOSkFreeBSD())
++      return "elf_i386_fbsd";
+     return "elf_i386";
+   case llvm::Triple::aarch64:
+     return "aarch64linux";
+@@ -277,6 +279,8 @@ static const char *getLDMOption(const ll
+   case llvm::Triple::x86_64:
+     if (T.getEnvironment() == llvm::Triple::GNUX32)
+       return "elf32_x86_64";
++    if (T.isOSkFreeBSD())
++      return "elf_x86_64_fbsd";
+     return "elf_x86_64";
+   default:
+     return nullptr;
+@@ -499,6 +503,18 @@ void tools::gnutools::Linker::ConstructJ
+         CmdArgs.push_back("--wrap=pthread_create");
+       CmdArgs.push_back("-lc");
++      if (getToolChain().getTriple().isOSkFreeBSD()) {
++      switch (getToolChain().getArch()) {
++      case llvm::Triple::x86_64:
++        CmdArgs.push_back("-rpath-link=/lib/x86_64-kfreebsd-gnu");
++        break;
++      case llvm::Triple::x86:
++        CmdArgs.push_back("-rpath-link=/lib/i386-kfreebsd-gnu");
++        break;
++      default:
++        break;
++      }
++      }
+       // Add IAMCU specific libs, if needed.
+       if (IsIAMCU)
+@@ -1836,7 +1852,8 @@ void Generic_GCC::GCCInstallationDetecto
+       "x86_64-redhat-linux",    "x86_64-suse-linux",
+       "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
+       "x86_64-slackware-linux", "x86_64-unknown-linux",
+-      "x86_64-amazon-linux"};
++      "x86_64-amazon-linux",    "x86_64-kfreebsd-gnu",
++      "x86_64-pc-kfreebsd-gnu"};
+   static const char *const X32LibDirs[] = {"/libx32", "/lib"};
+   static const char *const X32Triples[] = {
+       "x86_64-linux-gnux32",    "x86_64-unknown-linux-gnux32",
+@@ -1847,8 +1864,9 @@ void Generic_GCC::GCCInstallationDetecto
+       "i386-linux-gnu",       "i386-redhat-linux6E",   "i686-redhat-linux",
+       "i586-redhat-linux",    "i386-redhat-linux",     "i586-suse-linux",
+       "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu",
+-      "i386-gnu",             "i486-gnu",              "i586-gnu",
+-      "i686-gnu"};
++      "i686-kfreebsd-gnu",    "i686-pc-kfreebsd-gnu",  "i486-kfreebsd-gnu",
++      "i386-kfreebsd-gnu",    "i386-gnu",              "i486-gnu",
++      "i586-gnu",             "i686-gnu"};
+   static const char *const MIPSLibDirs[] = {"/lib"};
+   static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux",
+Index: llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/KFreeBSD.cpp
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/KFreeBSD.cpp
+@@ -0,0 +1,459 @@
++//===--- KFreeBSD.cpp - kFreeBSD ToolChain Implementations --------*- C++ -*-===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#include "KFreeBSD.h"
++#include "CommonArgs.h"
++#include "clang/Basic/VirtualFileSystem.h"
++#include "clang/Config/config.h"
++#include "clang/Driver/Driver.h"
++#include "clang/Driver/Options.h"
++#include "clang/Driver/SanitizerArgs.h"
++#include "llvm/Option/ArgList.h"
++#include "llvm/ProfileData/InstrProf.h"
++#include "llvm/Support/Path.h"
++
++using namespace clang::driver;
++using namespace clang::driver::toolchains;
++using namespace clang;
++using namespace llvm::opt;
++
++using tools::addPathIfExists;
++
++/// Get our best guess at the multiarch triple for a target.
++///
++/// Debian-based systems are starting to use a multiarch setup where they use
++/// a target-triple directory in the library and header search paths.
++/// Unfortunately, this triple does not align with the vanilla target triple,
++/// so we provide a rough mapping here.
++static std::string getMultiarchTriple(const Driver &D,
++                                      const llvm::Triple &TargetTriple,
++                                      StringRef SysRoot) {
++  // For most architectures, just use whatever we have rather than trying to be
++  // clever.
++  switch (TargetTriple.getArch()) {
++  default:
++    break;
++
++  // We use the existence of '/lib/<triple>' as a directory to detect
++  // some common kfreebsd triples that don't quite match the Clang
++  // triple for both 32-bit and 64-bit targets. Multiarch fixes its
++  // install triples to these regardless of what the actual target
++  // triple is.
++  case llvm::Triple::x86_64:
++    if (D.getVFS().exists(SysRoot + "/lib/x86_64-kfreebsd-gnu"))
++      return "x86_64-kfreebsd-gnu";
++    break;
++  case llvm::Triple::x86:
++    if (D.getVFS().exists(SysRoot + "/lib/i386-kfreebsd-gnu"))
++      return "i386-kfreebsd-gnu";
++    break;
++  }
++
++  return TargetTriple.str();
++}
++
++static StringRef getOSLibDir(const llvm::Triple &Triple, const ArgList &Args) {
++  // It happens that only x86 and PPC use the 'lib32' variant of oslibdir, and
++  // using that variant while targeting other architectures causes problems
++  // because the libraries are laid out in shared system roots that can't cope
++  // with a 'lib32' library search path being considered. So we only enable
++  // them when we know we may need it.
++  //
++  // FIXME: This is a bit of a hack. We should really unify this code for
++  // reasoning about oslibdir spellings with the lib dir spellings in the
++  // GCCInstallationDetector, but that is a more significant refactoring.
++
++  if (Triple.getArch() == llvm::Triple::x86)
++    return "lib";
++
++  if (Triple.getArch() == llvm::Triple::x86_64)
++    return "lib";
++
++  return Triple.isArch32Bit() ? "lib" : "lib64";
++}
++
++static void addMultilibsFilePaths(const Driver &D, const MultilibSet &Multilibs,
++                                  const Multilib &Multilib,
++                                  StringRef InstallPath,
++                                  ToolChain::path_list &Paths) {
++  if (const auto &PathsCallback = Multilibs.filePathsCallback())
++    for (const auto &Path : PathsCallback(Multilib))
++      addPathIfExists(D, InstallPath + Path, Paths);
++}
++
++kFreeBSD::kFreeBSD(const Driver &D, const llvm::Triple &Triple,
++                 const ArgList &Args)
++    : Generic_ELF(D, Triple, Args) {
++  GCCInstallation.init(Triple, Args);
++  Multilibs = GCCInstallation.getMultilibs();
++  std::string SysRoot = computeSysRoot();
++
++  // Cross-compiling binutils and GCC installations (vanilla and openSUSE at
++  // least) put various tools in a triple-prefixed directory off of the parent
++  // of the GCC installation. We use the GCC triple here to ensure that we end
++  // up with tools that support the same amount of cross compiling as the
++  // detected GCC installation. For example, if we find a GCC installation
++  // targeting x86_64, but it is a bi-arch GCC installation, it can also be
++  // used to target i386.
++  // FIXME: This seems unlikely to be Linux-, kFreeBSD- or Hurd-specific.
++  ToolChain::path_list &PPaths = getProgramPaths();
++  PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + "/../" +
++                         GCCInstallation.getTriple().str() + "/bin")
++                       .str());
++
++#ifdef ENABLE_LINKER_BUILD_ID
++  ExtraOpts.push_back("--build-id");
++#endif
++
++  // The selection of paths to try here is designed to match the patterns which
++  // the GCC driver itself uses, as this is part of the GCC-compatible driver.
++  // This was determined by running GCC in a fake filesystem, creating all
++  // possible permutations of these directories, and seeing which ones it added
++  // to the link paths.
++  path_list &Paths = getFilePaths();
++
++  const std::string OSLibDir = getOSLibDir(Triple, Args);
++  const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);
++
++  // Add the multilib suffixed paths where they are available.
++  if (GCCInstallation.isValid()) {
++    const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
++    const std::string &LibPath = GCCInstallation.getParentLibPath();
++    const Multilib &Multilib = GCCInstallation.getMultilib();
++    const MultilibSet &Multilibs = GCCInstallation.getMultilibs();
++
++    // Add toolchain / multilib specific file paths.
++    addMultilibsFilePaths(D, Multilibs, Multilib,
++                          GCCInstallation.getInstallPath(), Paths);
++
++    // Sourcery CodeBench MIPS toolchain holds some libraries under
++    // a biarch-like suffix of the GCC installation.
++    addPathIfExists(D, GCCInstallation.getInstallPath() + Multilib.gccSuffix(),
++                    Paths);
++
++    // GCC cross compiling toolchains will install target libraries which ship
++    // as part of the toolchain under <prefix>/<triple>/<libdir> rather than as
++    // any part of the GCC installation in
++    // <prefix>/<libdir>/gcc/<triple>/<version>. This decision is somewhat
++    // debatable, but is the reality today. We need to search this tree even
++    // when we have a sysroot somewhere else. It is the responsibility of
++    // whomever is doing the cross build targeting a sysroot using a GCC
++    // installation that is *not* within the system root to ensure two things:
++    //
++    //  1) Any DSOs that are linked in from this tree or from the install path
++    //     above must be present on the system root and found via an
++    //     appropriate rpath.
++    //  2) There must not be libraries installed into
++    //     <prefix>/<triple>/<libdir> unless they should be preferred over
++    //     those within the system root.
++    //
++    // Note that this matches the GCC behavior. See the below comment for where
++    // Clang diverges from GCC's behavior.
++    addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib/../" +
++                           OSLibDir + Multilib.osSuffix(),
++                    Paths);
++
++    // If the GCC installation we found is inside of the sysroot, we want to
++    // prefer libraries installed in the parent prefix of the GCC installation.
++    // It is important to *not* use these paths when the GCC installation is
++    // outside of the system root as that can pick up unintended libraries.
++    // This usually happens when there is an external cross compiler on the
++    // host system, and a more minimal sysroot available that is the target of
++    // the cross. Note that GCC does include some of these directories in some
++    // configurations but this seems somewhere between questionable and simply
++    // a bug.
++    if (StringRef(LibPath).startswith(SysRoot)) {
++      addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
++      addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
++    }
++  }
++
++  // Similar to the logic for GCC above, if we currently running Clang inside
++  // of the requested system root, add its parent library paths to
++  // those searched.
++  // FIXME: It's not clear whether we should use the driver's installed
++  // directory ('Dir' below) or the ResourceDir.
++  if (StringRef(D.Dir).startswith(SysRoot)) {
++    addPathIfExists(D, D.Dir + "/../lib/" + MultiarchTriple, Paths);
++    addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths);
++  }
++
++  addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
++  addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
++
++  addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
++  addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths);
++
++  // Try walking via the GCC triple path in case of biarch or multiarch GCC
++  // installations with strange symlinks.
++  if (GCCInstallation.isValid()) {
++    addPathIfExists(D,
++                    SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
++                        "/../../" + OSLibDir,
++                    Paths);
++
++    // Add the 'other' biarch variant path
++    Multilib BiarchSibling;
++    if (GCCInstallation.getBiarchSibling(BiarchSibling)) {
++      addPathIfExists(D, GCCInstallation.getInstallPath() +
++                             BiarchSibling.gccSuffix(),
++                      Paths);
++    }
++
++    // See comments above on the multilib variant for details of why this is
++    // included even from outside the sysroot.
++    const std::string &LibPath = GCCInstallation.getParentLibPath();
++    const llvm::Triple &GCCTriple = GCCInstallation.getTriple();
++    const Multilib &Multilib = GCCInstallation.getMultilib();
++    addPathIfExists(D, LibPath + "/../" + GCCTriple.str() + "/lib" +
++                           Multilib.osSuffix(),
++                    Paths);
++
++    // See comments above on the multilib variant for details of why this is
++    // only included from within the sysroot.
++    if (StringRef(LibPath).startswith(SysRoot))
++      addPathIfExists(D, LibPath, Paths);
++  }
++
++  // Similar to the logic for GCC above, if we are currently running Clang
++  // inside of the requested system root, add its parent library path to those
++  // searched.
++  // FIXME: It's not clear whether we should use the driver's installed
++  // directory ('Dir' below) or the ResourceDir.
++  if (StringRef(D.Dir).startswith(SysRoot))
++    addPathIfExists(D, D.Dir + "/../lib", Paths);
++
++  addPathIfExists(D, SysRoot + "/lib", Paths);
++  addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++}
++
++bool kFreeBSD::HasNativeLLVMSupport() const { return true; }
++
++Tool *kFreeBSD::buildLinker() const { return new tools::gnutools::Linker(*this); }
++
++Tool *kFreeBSD::buildAssembler() const {
++  return new tools::gnutools::Assembler(*this);
++}
++
++std::string kFreeBSD::computeSysRoot() const {
++  if (!getDriver().SysRoot.empty())
++    return getDriver().SysRoot;
++
++  return std::string();
++}
++
++std::string kFreeBSD::getDynamicLinker(const ArgList &Args) const {
++  const llvm::Triple::ArchType Arch = getArch();
++
++  if (Arch == llvm::Triple::x86_64)
++    return "/lib/ld-kfreebsd-x86-64.so.1";
++
++  if (Arch == llvm::Triple::x86)
++    return "/lib/ld.so.1";
++
++  llvm_unreachable("unsupported architecture");
++}
++
++void kFreeBSD::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
++                                     ArgStringList &CC1Args) const {
++  const Driver &D = getDriver();
++  std::string SysRoot = computeSysRoot();
++
++  if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
++    return;
++
++  if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
++    addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include");
++
++  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
++    SmallString<128> P(D.ResourceDir);
++    llvm::sys::path::append(P, "include");
++    addSystemInclude(DriverArgs, CC1Args, P);
++  }
++
++  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
++    return;
++
++  // Check for configure-time C include directories.
++  StringRef CIncludeDirs(C_INCLUDE_DIRS);
++  if (CIncludeDirs != "") {
++    SmallVector<StringRef, 5> dirs;
++    CIncludeDirs.split(dirs, ":");
++    for (StringRef dir : dirs) {
++      StringRef Prefix =
++          llvm::sys::path::is_absolute(dir) ? StringRef(SysRoot) : "";
++      addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
++    }
++    // addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
++    return;
++  }
++
++  // Lacking those, try to detect the correct set of system includes for the
++  // target triple.
++
++  // Add include directories specific to the selected multilib set and multilib.
++  if (GCCInstallation.isValid()) {
++    const auto &Callback = Multilibs.includeDirsCallback();
++    if (Callback) {
++      for (const auto &Path : Callback(GCCInstallation.getMultilib()))
++        addExternCSystemIncludeIfExists(
++            DriverArgs, CC1Args, GCCInstallation.getInstallPath() + Path);
++    }
++  }
++
++  // Implement generic Debian multiarch support.
++  const StringRef X86_64MultiarchIncludeDirs[] = {
++      "/usr/include/x86_64-kfreebsd-gnu"};
++
++  // CHECK
++  const StringRef X86MultiarchIncludeDirs[] = {
++      "/usr/include/i386-kfreebsd-gnu"};
++
++  ArrayRef<StringRef> MultiarchIncludeDirs;
++  switch (getTriple().getArch()) {
++  case llvm::Triple::x86:
++    MultiarchIncludeDirs = X86MultiarchIncludeDirs;
++    break;
++  case llvm::Triple::x86_64:
++    MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
++    break;
++  default:
++    break;
++  }
++
++  for (StringRef Dir : MultiarchIncludeDirs) {
++    if (D.getVFS().exists(SysRoot + Dir)) {
++      addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + Dir);
++      break;
++    }
++  }
++
++  // Add an include of '/include' directly. This isn't provided by default by
++  // system GCCs, but is often used with cross-compiling GCCs, and harmless to
++  // add even when Clang is acting as-if it were a system compiler.
++  addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include");
++
++  addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
++}
++
++static std::string DetectLibcxxIncludePath(StringRef base) {
++  std::error_code EC;
++  int MaxVersion = 0;
++  std::string MaxVersionString = "";
++  for (llvm::sys::fs::directory_iterator LI(base, EC), LE; !EC && LI != LE;
++       LI = LI.increment(EC)) {
++    StringRef VersionText = llvm::sys::path::filename(LI->path());
++    int Version;
++    if (VersionText[0] == 'v' &&
++        !VersionText.slice(1, StringRef::npos).getAsInteger(10, Version)) {
++      if (Version > MaxVersion) {
++        MaxVersion = Version;
++        MaxVersionString = VersionText;
++      }
++    }
++  }
++  return MaxVersion ? (base + "/" + MaxVersionString).str() : "";
++}
++
++void kFreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
++                                 llvm::opt::ArgStringList &CC1Args) const {
++  const std::string& SysRoot = computeSysRoot();
++  const std::string LibCXXIncludePathCandidates[] = {
++      DetectLibcxxIncludePath(getDriver().ResourceDir + "/include/c++"),
++      DetectLibcxxIncludePath(getDriver().Dir + "/../include/c++"),
++      // If this is a development, non-installed, clang, libcxx will
++      // not be found at ../include/c++ but it likely to be found at
++      // one of the following two locations:
++      DetectLibcxxIncludePath(SysRoot + "/usr/local/include/c++"),
++      DetectLibcxxIncludePath(SysRoot + "/usr/include/c++") };
++  for (const auto &IncludePath : LibCXXIncludePathCandidates) {
++    if (IncludePath.empty() || !getVFS().exists(IncludePath))
++      continue;
++    // Use the first candidate that exists.
++    addSystemInclude(DriverArgs, CC1Args, IncludePath);
++    return;
++  }
++}
++
++void kFreeBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
++                                    llvm::opt::ArgStringList &CC1Args) const {
++  // We need a detected GCC installation on kFreeBSD to provide libstdc++'s
++  // headers.
++  if (!GCCInstallation.isValid())
++    return;
++
++  // By default, look for the C++ headers in an include directory adjacent to
++  // the lib directory of the GCC installation. Note that this is expect to be
++  // equivalent to '/usr/include/c++/X.Y' in almost all cases.
++  StringRef LibDir = GCCInstallation.getParentLibPath();
++  StringRef InstallDir = GCCInstallation.getInstallPath();
++  StringRef TripleStr = GCCInstallation.getTriple().str();
++  const Multilib &Multilib = GCCInstallation.getMultilib();
++  const std::string GCCMultiarchTriple = getMultiarchTriple(
++      getDriver(), GCCInstallation.getTriple(), getDriver().SysRoot);
++  const std::string TargetMultiarchTriple =
++      getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot);
++  const GCCVersion &Version = GCCInstallation.getVersion();
++
++  // The primary search for libstdc++ supports multiarch variants.
++  if (addLibStdCXXIncludePaths(LibDir.str() + "/../include",
++                               "/c++/" + Version.Text, TripleStr,
++                               GCCMultiarchTriple, TargetMultiarchTriple,
++                               Multilib.includeSuffix(), DriverArgs, CC1Args))
++    return;
++
++  // Otherwise, fall back on a bunch of options which don't use multiarch
++  // layouts for simplicity.
++  const std::string LibStdCXXIncludePathCandidates[] = {
++      // Gentoo is weird and places its headers inside the GCC install,
++      // so if the first attempt to find the headers fails, try these patterns.
++      InstallDir.str() + "/include/g++-v" + Version.Text,
++      InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
++          Version.MinorStr,
++      InstallDir.str() + "/include/g++-v" + Version.MajorStr,
++      // Android standalone toolchain has C++ headers in yet another place.
++      LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text,
++      // Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++,
++      // without a subdirectory corresponding to the gcc version.
++      LibDir.str() + "/../include/c++",
++  };
++
++  for (const auto &IncludePath : LibStdCXXIncludePathCandidates) {
++    if (addLibStdCXXIncludePaths(IncludePath, /*Suffix*/ "", TripleStr,
++                                 /*GCCMultiarchTriple*/ "",
++                                 /*TargetMultiarchTriple*/ "",
++                                 Multilib.includeSuffix(), DriverArgs, CC1Args))
++      break;
++  }
++}
++
++/* FIXME:
++/home/srs/DEBs/llvm-toolchain-7/llvm-toolchain-7-7.0.1~+rc2-7/tools/clang/lib/Driver/ToolChains/KFreeBSD.cpp:431:15: error: no declaration matches â€˜clang::SanitizerMask clang::driver::toolchains::kFreeBSD::getSupportedSanitizers() const’
++ SanitizerMask kFreeBSD::getSupportedSanitizers() const {
++*/
++SanitizerMask kFreeBSD::getSupportedSanitizers() const {
++  const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
++  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
++  SanitizerMask Res = ToolChain::getSupportedSanitizers();
++  // FIXME: Add here!!
++  if (IsX86_64) {
++    Res |= SanitizerKind::DataFlow;
++    Res |= SanitizerKind::Leak;
++    Res |= SanitizerKind::Thread;
++    Res |= SanitizerKind::Efficiency;
++    Res |= SanitizerKind::Scudo;
++    Res |= SanitizerKind::HWAddress;
++    Res |= SanitizerKind::KernelHWAddress;
++  }
++  if (IsX86 || IsX86_64)
++    Res |= SanitizerKind::Function;
++
++  return Res;
++}
++
+Index: llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/KFreeBSD.h
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7-7.0.1/clang/lib/Driver/ToolChains/KFreeBSD.h
+@@ -0,0 +1,54 @@
++//===--- KFreeBSD.h - kFreeBSD ToolChain Implementations ----------*- C++ -*-===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_KFreeBSD_H
++#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_KFreeBSD_H
++
++#include "Gnu.h"
++#include "clang/Driver/ToolChain.h"
++
++namespace clang {
++namespace driver {
++namespace toolchains {
++
++class LLVM_LIBRARY_VISIBILITY kFreeBSD : public Generic_ELF {
++public:
++  kFreeBSD(const Driver &D, const llvm::Triple &Triple,
++          const llvm::opt::ArgList &Args);
++
++  bool HasNativeLLVMSupport() const override;
++
++  void
++  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
++                            llvm::opt::ArgStringList &CC1Args) const override;
++  void addLibCxxIncludePaths(
++      const llvm::opt::ArgList &DriverArgs,
++      llvm::opt::ArgStringList &CC1Args) const override;
++  void addLibStdCxxIncludePaths(
++      const llvm::opt::ArgList &DriverArgs,
++      llvm::opt::ArgStringList &CC1Args) const override;
++
++  SanitizerMask getSupportedSanitizers() const override;
++
++  virtual std::string computeSysRoot() const;
++
++  virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const;
++
++  std::vector<std::string> ExtraOpts;
++
++protected:
++  Tool *buildAssembler() const override;
++  Tool *buildLinker() const override;
++};
++
++} // end namespace toolchains
++} // end namespace driver
++} // end namespace clang
++
++#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_KFreeBSD_H
diff --git a/patches/kfreebsd/kfreebsd-triple.diff b/patches/kfreebsd/kfreebsd-triple.diff
new file mode 100644 (file)
index 0000000..227fbde
--- /dev/null
@@ -0,0 +1,23 @@
+Index: llvm-toolchain-7-7.0.1/unittests/ADT/TripleTest.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/unittests/ADT/TripleTest.cpp
++++ llvm-toolchain-7-7.0.1/unittests/ADT/TripleTest.cpp
+@@ -99,6 +99,18 @@ TEST(TripleTest, ParsedIDs) {
+   EXPECT_EQ(Triple::Hurd, T.getOS());
+   EXPECT_EQ(Triple::GNU, T.getEnvironment());
++  T = Triple("i386-pc-kfreebsd-gnu");
++  EXPECT_EQ(Triple::x86, T.getArch());
++  EXPECT_EQ(Triple::PC, T.getVendor());
++  EXPECT_EQ(Triple::kFreeBSD, T.getOS());
++  EXPECT_EQ(Triple::GNU, T.getEnvironment());
++
++  T = Triple("x86_64-pc-kfreebsd-gnu");
++  EXPECT_EQ(Triple::x86_64, T.getArch());
++  EXPECT_EQ(Triple::PC, T.getVendor());
++  EXPECT_EQ(Triple::kFreeBSD, T.getOS());
++  EXPECT_EQ(Triple::GNU, T.getEnvironment());
++
+   T = Triple("x86_64-pc-linux-gnu");
+   EXPECT_EQ(Triple::x86_64, T.getArch());
+   EXPECT_EQ(Triple::PC, T.getVendor());
diff --git a/patches/kfreebsd/lib_Support.diff b/patches/kfreebsd/lib_Support.diff
new file mode 100644 (file)
index 0000000..16ba701
--- /dev/null
@@ -0,0 +1,42 @@
+Index: llvm-toolchain-7-7.0.1/lib/Support/Triple.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lib/Support/Triple.cpp
++++ llvm-toolchain-7-7.0.1/lib/Support/Triple.cpp
+@@ -185,7 +185,7 @@ StringRef Triple::getOSTypeName(OSType K
+   case FreeBSD: return "freebsd";
+   case Fuchsia: return "fuchsia";
+   case IOS: return "ios";
+-  case KFreeBSD: return "kfreebsd";
++  case kFreeBSD: return "kfreebsd";
+   case Linux: return "linux";
+   case Lv2: return "lv2";
+   case MacOSX: return "macosx";
+@@ -478,7 +478,7 @@ static Triple::OSType parseOS(StringRef
+     .StartsWith("freebsd", Triple::FreeBSD)
+     .StartsWith("fuchsia", Triple::Fuchsia)
+     .StartsWith("ios", Triple::IOS)
+-    .StartsWith("kfreebsd", Triple::KFreeBSD)
++    .StartsWith("kfreebsd", Triple::kFreeBSD)
+     .StartsWith("linux", Triple::Linux)
+     .StartsWith("lv2", Triple::Lv2)
+     .StartsWith("macos", Triple::MacOSX)
+Index: llvm-toolchain-7-7.0.1/lib/Support/Unix/Path.inc
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lib/Support/Unix/Path.inc
++++ llvm-toolchain-7-7.0.1/lib/Support/Unix/Path.inc
+@@ -54,13 +54,13 @@
+ #include <sys/types.h>
+ #if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) &&   \
+-    !defined(__linux__)
++  !defined(__linux__) && !defined(__FreeBSD_kernel__)
+ #include <sys/statvfs.h>
+ #define STATVFS statvfs
+ #define FSTATVFS fstatvfs
+ #define STATVFS_F_FRSIZE(vfs) vfs.f_frsize
+ #else
+-#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #include <sys/mount.h>
+ #include <sys/param.h>
+ #elif defined(__linux__)
diff --git a/patches/kfreebsd/lib_Target_X86.diff b/patches/kfreebsd/lib_Target_X86.diff
new file mode 100644 (file)
index 0000000..4cb954e
--- /dev/null
@@ -0,0 +1,26 @@
+Index: llvm-toolchain-7-7.0.1/lib/Target/X86/X86Subtarget.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lib/Target/X86/X86Subtarget.cpp
++++ llvm-toolchain-7-7.0.1/lib/Target/X86/X86Subtarget.cpp
+@@ -270,7 +270,7 @@ void X86Subtarget::initSubtargetFeatures
+   if (StackAlignOverride)
+     stackAlignment = StackAlignOverride;
+   else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||
+-           isTargetKFreeBSD() || In64BitMode)
++           isTargetkFreeBSD() || In64BitMode)
+     stackAlignment = 16;
+   // Some CPUs have more overhead for gather. The specified overhead is relative
+Index: llvm-toolchain-7-7.0.1/lib/Target/X86/X86Subtarget.h
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lib/Target/X86/X86Subtarget.h
++++ llvm-toolchain-7-7.0.1/lib/Target/X86/X86Subtarget.h
+@@ -708,7 +708,7 @@ public:
+   bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
+   bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
+-  bool isTargetKFreeBSD() const { return TargetTriple.isOSKFreeBSD(); }
++  bool isTargetkFreeBSD() const { return TargetTriple.isOSkFreeBSD(); }
+   bool isTargetGlibc() const { return TargetTriple.isOSGlibc(); }
+   bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
+   bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
diff --git a/patches/kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff b/patches/kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff
new file mode 100644 (file)
index 0000000..013f92e
--- /dev/null
@@ -0,0 +1,18 @@
+Index: llvm-toolchain-7-7.0.1/lldb/source/Host/freebsd/Host.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lldb/source/Host/freebsd/Host.cpp
++++ llvm-toolchain-7-7.0.1/lldb/source/Host/freebsd/Host.cpp
+@@ -12,6 +12,13 @@
+ #include <sys/types.h>
+ #include <sys/exec.h>
++#ifdef __FreeBSD_kernel__
++#  ifdef __amd64__
++#  include </usr/include/x86_64-kfreebsd-gnu/sys/kglue/sys/types.h>
++#  else
++#  include </usr/include/i386-kfreebsd-gnu/sys/kglue/sys/types.h>
++#  endif
++#endif
+ #include <sys/proc.h>
+ #include <sys/ptrace.h>
+ #include <sys/sysctl.h>
diff --git a/patches/kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff b/patches/kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff
new file mode 100644 (file)
index 0000000..e7d1145
--- /dev/null
@@ -0,0 +1,28 @@
+Index: llvm-toolchain-7-7.0.1/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
++++ llvm-toolchain-7-7.0.1/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
+@@ -10,7 +10,9 @@
+ // C Includes
+ #include <errno.h>
+ #include <pthread.h>
++#ifndef __FreeBSD_kernel__
+ #include <pthread_np.h>
++#endif
+ #include <stdlib.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+Index: llvm-toolchain-7-7.0.1/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
++++ llvm-toolchain-7-7.0.1/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+@@ -11,7 +11,9 @@
+ // C Includes
+ #include <errno.h>
+ #include <pthread.h>
++#ifndef __FreeBSD_kernel__
+ #include <pthread_np.h>
++#endif
+ #include <stdlib.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
diff --git a/patches/kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff b/patches/kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff
new file mode 100644 (file)
index 0000000..73e4051
--- /dev/null
@@ -0,0 +1,12 @@
+Index: llvm-toolchain-7-7.0.1/tools/llvm-shlib/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.0.1.orig/tools/llvm-shlib/CMakeLists.txt
++++ llvm-toolchain-7-7.0.1/tools/llvm-shlib/CMakeLists.txt
+@@ -40,6 +40,7 @@ set_property(TARGET LLVM PROPERTY VERSIO
+ list(REMOVE_DUPLICATES LIB_NAMES)
+ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
++   OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD")
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
+    OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
diff --git a/patches/libcxx/libcxx-silent-failure-arm64.diff b/patches/libcxx/libcxx-silent-failure-arm64.diff
new file mode 100644 (file)
index 0000000..c06b6e3
--- /dev/null
@@ -0,0 +1,24 @@
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp
+@@ -8,6 +8,7 @@
+ //===----------------------------------------------------------------------===//
+ //
+ // UNSUPPORTED: libcpp-has-no-threads
++// XFAIL: *
+ // <condition_variable>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp
+@@ -9,6 +9,7 @@
+ //
+ // UNSUPPORTED: libcpp-has-no-threads
+ // UNSUPPORTED: c++98, c++03, c++11
++// XFAIL: *
+ // <shared_mutex>
diff --git a/patches/libcxx/libcxx-silent-failure-ppc64el.diff b/patches/libcxx/libcxx-silent-failure-ppc64el.diff
new file mode 100644 (file)
index 0000000..3a84f1a
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
+@@ -14,7 +14,7 @@
+ //
+ // GCC currently fails because it needs -fabi-version=6 to fix mangling of
+ // std::atomic when used with __attribute__((vector(X))).
+-// XFAIL: gcc
++// XFAIL: *
+ // <atomic>
diff --git a/patches/libcxx/libcxx-silent-test-libcxx.diff b/patches/libcxx/libcxx-silent-test-libcxx.diff
new file mode 100644 (file)
index 0000000..c272b94
--- /dev/null
@@ -0,0 +1,51 @@
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/numerics/rand/rand.util/rand.util.canonical/generate_canonical.pass.cpp
+@@ -12,6 +12,8 @@
+ // template<class RealType, size_t bits, class URNG>
+ //     RealType generate_canonical(URNG& g);
++// XFAIL: *
++
+ #include <random>
+ #include <cassert>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/re/re.traits/isctype.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/re/re.traits/isctype.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/re/re.traits/isctype.pass.cpp
+@@ -16,6 +16,7 @@
+ // TODO(EricWF): This test takes 40+ minutes to build with Clang 3.8 under ASAN or MSAN.
+ // UNSUPPORTED: asan, msan
++// XFAIL: *
+ #include <regex>
+ #include <cassert>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxxabi/test/catch_multi_level_pointer.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxxabi/test/catch_multi_level_pointer.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxxabi/test/catch_multi_level_pointer.pass.cpp
+@@ -9,6 +9,8 @@
+ // UNSUPPORTED: libcxxabi-no-exceptions
++// XFAIL: *
++
+ #include <cassert>
+ #include <cstdlib>
+ #include <iostream>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
+@@ -16,6 +16,8 @@
+ // template <class T, class... Args> void construct(T* p, Args&&... args);
++// XFAIL: *
++
+ #include <scoped_allocator>
+ #include <cassert>
+ #include <string>
diff --git a/patches/libcxx/libcxx-test-atomics-set-compare-exchange-to-be-expected-fails-on-arm.patch b/patches/libcxx/libcxx-test-atomics-set-compare-exchange-to-be-expected-fails-on-arm.patch
new file mode 100644 (file)
index 0000000..af43457
--- /dev/null
@@ -0,0 +1,58 @@
+Clang 3.9 regression causes a bug when generating code for
+std::atomic_compare_and_exchange*(std::atomic<long long>,...) without
+optimizations. If same code is compiled with -O2 tests pass without problems.
+Atomics are implement in headers with builtin functions which makes this
+affect application code instead of libc++ library code.
+
+libcxx tests default to -O0 compilation so these test need to be marked failing
+on arm to allow installing packages. Use cases is so borderline failure that it
+shouldn't prevent building the package. (64bit atomics in 32bit mode)
+
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
+@@ -8,6 +8,7 @@
+ //===----------------------------------------------------------------------===//
+ //
+ // UNSUPPORTED: libcpp-has-no-threads
++// XFAIL: arm
+ //  ... assertion fails line 34
+ // <atomic>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
+@@ -8,6 +8,7 @@
+ //===----------------------------------------------------------------------===//
+ //
+ // UNSUPPORTED: libcpp-has-no-threads
++// XFAIL: arm
+ //  ... assertion fails line 38
+ // <atomic>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
+@@ -8,6 +8,7 @@
+ //===----------------------------------------------------------------------===//
+ //
+ // UNSUPPORTED: libcpp-has-no-threads
++// XFAIL: arm
+ //  ... assertion fails line 34
+ // <atomic>
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
+@@ -8,6 +8,7 @@
+ //===----------------------------------------------------------------------===//
+ //
+ // UNSUPPORTED: libcpp-has-no-threads
++// XFAIL: arm
+ //  ... assertion fails line 38
+ // <atomic>
diff --git a/patches/libcxx/libcxx-test-fix-lockfree-test-for-i386.patch b/patches/libcxx/libcxx-test-fix-lockfree-test-for-i386.patch
new file mode 100644 (file)
index 0000000..631b554
--- /dev/null
@@ -0,0 +1,31 @@
+Lock is_always_lock free test fails on i386 because std::atomic is aligned
+to 8 bytes while long long is aligned to 4 bytes. clang can't generate inline
+code for unaligned 8 byte atomics even tough instruction set and gcc support
+it.
+
+That makes it expected thaqt ATOMIC_LLONG_LOCK_FREE and
+std::atomic<long long>::is_always_lock_free don't match on i386. Correct test
+for std::atomic<long long> is to check if target cpu support cmpxchg8 instruction.
+To set instruction support one can check __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 define.
+
+Bug: https://llvm.org/bugs/show_bug.cgi?id=19355
+
+Index: llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+@@ -20,6 +20,14 @@
+ # error Feature test macro missing.
+ #endif
++#if defined(__i386__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
++/* Fix for clang setting __GCC_ATOMIC_LLONG_LOCK_FREE incorecctly for x86
++ * https://llvm.org/bugs/show_bug.cgi?id=19355
++ */
++#undef ATOMIC_LLONG_LOCK_FREE
++#define ATOMIC_LLONG_LOCK_FREE 2
++#endif
++
+ template <typename T> void checkAlwaysLockFree() {
+   if (std::atomic<T>::is_always_lock_free)
+     assert(std::atomic<T>().is_lock_free());
diff --git a/patches/libcxx/libcxxabi-arm-ehabi-fix.patch b/patches/libcxx/libcxxabi-arm-ehabi-fix.patch
new file mode 100644 (file)
index 0000000..a8afdaa
--- /dev/null
@@ -0,0 +1,118 @@
+Fix arm EHABI code to work. armhf had exception test failing without EHABI support.
+
+No known upstream bug about this. Actual code change is more like workaround than
+something that upstream would accept. Proper fix would be adding _Unwind_Control_Block
+to clang unwind.h. _Unwind_Control_Block should also extend _Unwind_Exception to make
+sure their ABI stays in sync.
+
+No known upstream bug about this.
+
+Index: llvm-toolchain-snapshot_7svn337372/libcxxabi/src/cxa_exception.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7svn337372.orig/libcxxabi/src/cxa_exception.cpp
++++ llvm-toolchain-snapshot_7svn337372/libcxxabi/src/cxa_exception.cpp
+@@ -261,15 +261,16 @@ __cxa_throw(void *thrown_object, std::ty
+ #ifdef __USING_SJLJ_EXCEPTIONS__
+     _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
+-#else
++#elif !LIBCXXABI_ARM_EHABI
+     _Unwind_RaiseException(&exception_header->unwindHeader);
++#else
++    _Unwind_RaiseException(exception_header->unwindHeader);
+ #endif
+     //  This only happens when there is no handler, or some unexpected unwinding
+     //     error happens.
+     failed_throw(exception_header);
+ }
+-
+ // 2.5.3 Exception Handlers
+ /*
+ The adjusted pointer is computed by the personality routine during phase 1
+@@ -532,7 +533,11 @@ void __cxa_end_catch() {
+             //    to touch a foreign exception in any way, that is undefined
+             //     behavior.  They likely can't since the only way to catch
+             //     a foreign exception is with catch (...)!
++#if !LIBCXXABI_ARM_EHABI
+             _Unwind_DeleteException(&globals->caughtExceptions->unwindHeader);
++#else
++            _Unwind_DeleteException(globals->caughtExceptions->unwindHeader);
++#endif
+             globals->caughtExceptions = 0;
+         }
+     }
+@@ -589,8 +594,10 @@ void __cxa_rethrow() {
+     }
+ #ifdef __USING_SJLJ_EXCEPTIONS__
+     _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
+-#else
++#elif !LIBCXXABI_ARM_EHABI
+     _Unwind_RaiseException(&exception_header->unwindHeader);
++#else
++    _Unwind_RaiseException(exception_header->unwindHeader);
+ #endif
+     //  If we get here, some kind of unwinding error has occurred.
+@@ -714,8 +721,10 @@ __cxa_rethrow_primary_exception(void* th
+         dep_exception_header->unwindHeader.exception_cleanup = dependent_exception_cleanup;
+ #ifdef __USING_SJLJ_EXCEPTIONS__
+         _Unwind_SjLj_RaiseException(&dep_exception_header->unwindHeader);
++#elif !LIBCXXABI_ARM_EHABI
++      _Unwind_RaiseException(&dep_exception_header->unwindHeader);
+ #else
+-        _Unwind_RaiseException(&dep_exception_header->unwindHeader);
++      _Unwind_RaiseException(dep_exception_header->unwindHeader);
+ #endif
+         // Some sort of unwinding error.  Note that terminate is a handler.
+         __cxa_begin_catch(&dep_exception_header->unwindHeader);
+Index: llvm-toolchain-snapshot_7svn337372/libcxxabi/src/cxa_exception.hpp
+===================================================================
+--- llvm-toolchain-snapshot_7svn337372.orig/libcxxabi/src/cxa_exception.hpp
++++ llvm-toolchain-snapshot_7svn337372/libcxxabi/src/cxa_exception.hpp
+@@ -24,6 +24,45 @@ static const uint64_t kOurExceptionClass
+ static const uint64_t kOurDependentExceptionClass = 0x434C4E47432B2B01; // CLNGC++\1
+ static const uint64_t get_vendor_and_language     = 0xFFFFFFFFFFFFFF00; // mask for CLNGC++
++#if LIBCXXABI_ARM_EHABI
++// GCC has _Unwind_Control_Block in unwind.h (unwind_arm_common.h)
++#if defined(__clang__)
++struct _Unwind_Control_Block
++{
++      uint64_t exception_class;
++      void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
++      struct {
++              _Unwind_Word reserved1;
++              _Unwind_Word reserved2;
++              _Unwind_Word reserved3;
++              _Unwind_Word reserved4;
++              _Unwind_Word reserved5;
++      } unwinder_cache;
++      struct {
++              _Unwind_Word sp;
++              _Unwind_Word bitpattern[5];
++      } barrier_cache;
++      struct {
++              _Unwind_Word bitpattern[4];
++      } cleanup_cache;
++      struct {
++              _Unwind_Word fnstart;
++              _Unwind_Word *ehtp;
++              _Unwind_Word additional;
++              _Unwind_Word reserved1;
++      } pr_cache;
++      long long int :0;
++      operator _Unwind_Exception*() noexcept
++      {
++              return reinterpret_cast<_Unwind_Exception*>(this);
++      }
++};
++
++#endif
++
++#define _Unwind_Exception _Unwind_Control_Block
++#endif
++
+ struct _LIBCXXABI_HIDDEN __cxa_exception {
+ #if defined(__LP64__) || defined(_LIBCXXABI_ARM_EHABI)
+     // This is a new field to support C++ 0x exception_ptr.
diff --git a/patches/libcxx/libcxxabi-test-don-t-fail-extended-long-double.patch b/patches/libcxx/libcxxabi-test-don-t-fail-extended-long-double.patch
new file mode 100644 (file)
index 0000000..1b5b723
--- /dev/null
@@ -0,0 +1,17 @@
+Powerpc has extended double that doesn't match x86 coding. Power format would
+need special tests to verify correctness but for now it is enough to prevent
+incorrect test from running.
+
+Index: llvm-toolchain-snapshot_7~svn337372/libcxxabi/test/test_demangle.pass.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7~svn337372.orig/libcxxabi/test/test_demangle.pass.cpp
++++ llvm-toolchain-snapshot_7~svn337372svn337372/libcxxabi/test/test_demangle.pass.cpp
+@@ -29648,7 +29648,7 @@ const char* invalid_cases[] =
+     "NSoERj5E=Y1[uM:ga",
+     "Aon_PmKVPDk7?fg4XP5smMUL6;<WsI_mgbf23cCgsHbT<l8EE\0uVRkNOoXDrgdA4[8IU>Vl<>IL8ayHpiVDDDXTY;^o9;i",
+     "_ZNSt16allocator_traitsISaIN4llvm3sys2fs18directory_iteratorEEE9constructIS3_IS3_EEEDTcl12_S_constructfp_fp0_spcl7forwardIT0_Efp1_EEERS4_PT_DpOS7_",
+-#if !LDBL_FP80
++#if !LDBL_FP80 && __LDBL_MANT_DIG__ < 64
+     "_ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c",
+ #endif
+       // The following test cases were found by libFuzzer+ASAN
diff --git a/patches/lldb-libname.diff b/patches/lldb-libname.diff
new file mode 100644 (file)
index 0000000..8e6aec3
--- /dev/null
@@ -0,0 +1,15 @@
+---
+ lldb/scripts/Python/finishSwigPythonLLDB.py |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lldb/scripts/Python/finishSwigPythonLLDB.py
++++ b/lldb/scripts/Python/finishSwigPythonLLDB.py
+@@ -443,7 +443,7 @@ def make_symlink_liblldb(
+             if eOSType == utilsOsType.EnumOsType.Darwin:
+                 strLibFileExtn = ".dylib"
+             else:
+-                strLibFileExtn = ".so"
++                strLibFileExtn = "-7.so"
+             strSrc = os.path.join(vstrLldbLibDir, "liblldb" + strLibFileExtn)
+     bOk, strErrMsg = make_symlink(
diff --git a/patches/lldb-soname.diff b/patches/lldb-soname.diff
new file mode 100644 (file)
index 0000000..bc560b1
--- /dev/null
@@ -0,0 +1,44 @@
+---
+ lldb/source/API/CMakeLists.txt |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+Index: llvm-toolchain-7_7~+rc1/lldb/source/API/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/lldb/source/API/CMakeLists.txt
++++ llvm-toolchain-7_7~+rc1/lldb/source/API/CMakeLists.txt
+@@ -4,7 +4,12 @@ endif()
+ get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
+-add_lldb_library(liblldb SHARED
++set(output_name lldb)
++if (CMAKE_SYSTEM_NAME MATCHES "Windows")
++  set(output_name liblldb)
++endif()
++
++add_lldb_library(liblldb SHARED OUTPUT_NAME ${output_name} SONAME
+   SBAddress.cpp
+   SBAttachInfo.cpp
+   SBBlock.cpp
+@@ -112,7 +117,7 @@ endif ()
+ set_target_properties(liblldb
+   PROPERTIES
+-  VERSION ${LLDB_VERSION}
++  VERSION 1
+ )
+ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+@@ -141,11 +141,6 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows"
+   if (MSVC AND NOT LLDB_DISABLE_PYTHON)
+     target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
+   endif()
+-else()
+-  set_target_properties(liblldb
+-    PROPERTIES
+-    OUTPUT_NAME lldb
+-  )
+ endif()
+ if (LLDB_WRAP_PYTHON)
+
diff --git a/patches/lldb/lldb-addversion-suffix-to-llvm-server-exec.patch b/patches/lldb/lldb-addversion-suffix-to-llvm-server-exec.patch
new file mode 100644 (file)
index 0000000..0489ecb
--- /dev/null
@@ -0,0 +1,35 @@
+lldb-server exec users always /usr/bin/lldb-server. Server is required
+for any debugging with lldb which makes it unusable unless default version
+package has been installed. Small changes to code and debian/rules allows
+a workaround for lldb-server start up.
+
+To use this one needs to add cmake definition during configure. eg
+-DDEBIAN_VERSION_SUFFIX=-$(LLVM_VERSION)
+
+Better implementation would be to use /usr/share/llvm-$(VERSION)/bin but 
+that change seems to require a big change to the path handling code
+which could then break something else.
+
+This probably should have upstream bug but I couldn't find any existing report.
+
+Index: llvm-toolchain-snapshot_7.0~svn293997/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+===================================================================
+--- llvm-toolchain-snapshot_7.0~svn293997.orig/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
++++ llvm-toolchain-snapshot_7.0~svn293997/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+@@ -32,6 +32,7 @@
+ #include "lldb/Utility/StreamString.h"
+ #include "llvm/ADT/SmallString.h"
+ #include "llvm/Support/ScopedPrinter.h"
++#include "llvm/Config/llvm-config.h"
+ // Project includes
+ #include "ProcessGDBRemoteLog.h"
+@@ -39,7 +40,7 @@
+ #if defined(__APPLE__)
+ #define DEBUGSERVER_BASENAME "debugserver"
+ #else
+-#define DEBUGSERVER_BASENAME "lldb-server"
++# define DEBUGSERVER_BASENAME    "lldb-server-" LLVM_VERSION_STRING
+ #endif
+ #if defined(HAVE_LIBCOMPRESSION)
diff --git a/patches/lldb/lldb-disable-swig-error.diff b/patches/lldb/lldb-disable-swig-error.diff
new file mode 100644 (file)
index 0000000..a715805
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_5.0~svn306792/lldb/scripts/lldb.swig
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn306792.orig/lldb/scripts/lldb.swig
++++ llvm-toolchain-snapshot_5.0~svn306792/lldb/scripts/lldb.swig
+@@ -50,7 +50,7 @@ except ImportError:
+ %enddef
+ // These versions will not generate working python modules, so error out early.
+ #if SWIG_VERSION >= 0x030009 && SWIG_VERSION < 0x030011
+-#error Swig versions 3.0.9 and 3.0.10 are incompatible with lldb.
++#warning Swig versions 3.0.9 and 3.0.10 are incompatible with lldb.
+ #endif
+ // The name of the module to be created.
diff --git a/patches/lldb/lldb-link-atomic-cmake.patch b/patches/lldb/lldb-link-atomic-cmake.patch
new file mode 100644 (file)
index 0000000..1460694
--- /dev/null
@@ -0,0 +1,27 @@
+Description: Link with -latomic when mips* processor is detected
+Author: Gianfranco Costamagna <locutusofborg@debian.org>
+Last-Update: 2016-07-27
+
+---
+ lldb/cmake/LLDBDependencies.cmake |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: llvm-toolchain-snapshot_6.0~svn317000/lldb/source/Utility/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn317000.orig/lldb/source/Utility/CMakeLists.txt
++++ llvm-toolchain-snapshot_6.0~svn317000/lldb/source/Utility/CMakeLists.txt
+@@ -30,6 +30,14 @@ endif()
+ list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
++if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips" OR
++   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mipsel" OR
++   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64el" OR
++   CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "powerpcspe")
++  list(APPEND LLDB_SYSTEM_LIBS atomic)
++endif()
++
++
+ if (LLVM_BUILD_STATIC)
+   if (NOT LLDB_DISABLE_PYTHON)
+     list(APPEND LLDB_SYSTEM_LIBS python2.7 util)
diff --git a/patches/lldb/lldb-missing-install.diff b/patches/lldb/lldb-missing-install.diff
new file mode 100644 (file)
index 0000000..a802c1c
--- /dev/null
@@ -0,0 +1,24 @@
+Index: llvm-toolchain-snapshot_6.0~svn319966/lldb/tools/argdumper/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn319966.orig/lldb/tools/argdumper/CMakeLists.txt
++++ llvm-toolchain-snapshot_6.0~svn319966/lldb/tools/argdumper/CMakeLists.txt
+@@ -4,3 +4,7 @@ add_lldb_tool(lldb-argdumper INCLUDE_IN_
+   LINK_LIBS
+     lldbUtility
+   )
++
++install(TARGETS lldb-argdumper
++  RUNTIME DESTINATION bin)
++
+Index: llvm-toolchain-snapshot_6.0~svn319966/lldb/tools/lldb-server/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn319966.orig/lldb/tools/lldb-server/CMakeLists.txt
++++ llvm-toolchain-snapshot_6.0~svn319966/lldb/tools/lldb-server/CMakeLists.txt
+@@ -55,3 +55,7 @@ add_lldb_tool(lldb-server INCLUDE_IN_FRA
+ )
+ target_link_libraries(lldb-server PRIVATE ${LLDB_SYSTEM_LIBS})
++
++install(TARGETS lldb-server
++  RUNTIME DESTINATION bin)
++
diff --git a/patches/mips-force-nomadd4.diff b/patches/mips-force-nomadd4.diff
new file mode 100644 (file)
index 0000000..a878e3e
--- /dev/null
@@ -0,0 +1,18 @@
+The MIPS port aims to support the Loongson 3 family of CPUs in addition
+of the other MIPS CPUs. On the Loongson 3 family the MADD4 instructions
+are fused, while they are not fused on the other MIPS CPUs. In order to
+support both, we have to disabled those instructions.
+
+For that, the patch below basically corresponds to the --with-madd4=no
+used on the GCC side.
+
+--- a/clang/lib/Basic/Targets/Mips.h
++++ b/clang/lib/Basic/Targets/Mips.h
+@@ -306,6 +306,7 @@ public:
+     FloatABI = HardFloat;
+     DspRev = NoDSP;
+     HasFP64 = isFP64Default();
++    DisableMadd4 = true;
+     for (const auto &Feature : Features) {
+       if (Feature == "+single-float")
diff --git a/patches/mips-fpxx-enable.diff b/patches/mips-fpxx-enable.diff
new file mode 100644 (file)
index 0000000..7a07a20
--- /dev/null
@@ -0,0 +1,17 @@
+Index: llvm-toolchain-snapshot_5.0~svn297449/clang/lib/Driver/ToolChains/Arch/Mips.cpp
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn297449.orig/clang/lib/Driver/ToolChains/Arch/Mips.cpp
++++ llvm-toolchain-snapshot_5.0~svn297449/clang/lib/Driver/ToolChains/Arch/Mips.cpp
+@@ -368,10 +368,10 @@ bool mips::isFP64ADefault(const llvm::Tr
+ bool mips::isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName,
+                          StringRef ABIName, mips::FloatABI FloatABI) {
+-  if (Triple.getVendor() != llvm::Triple::ImaginationTechnologies &&
++/*  if (Triple.getVendor() != llvm::Triple::ImaginationTechnologies &&
+       Triple.getVendor() != llvm::Triple::MipsTechnologies &&
+       !Triple.isAndroid())
+-    return false;
++    return false;*/
+   if (ABIName != "32")
+     return false;
diff --git a/patches/openmp-soname.diff b/patches/openmp-soname.diff
new file mode 100644 (file)
index 0000000..55daa85
--- /dev/null
@@ -0,0 +1,14 @@
+Index: llvm-toolchain-snapshot_7~svn335949/openmp/runtime/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/openmp/runtime/CMakeLists.txt
++++ llvm-toolchain-snapshot_7~svn335949/openmp/runtime/CMakeLists.txt
+@@ -357,7 +357,8 @@ else()
+   set(LIBOMP_INSTALL_KIND ARCHIVE)
+ endif()
+-set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX})
++set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBOMP_VERSION_MAJOR})
++
+ # Optional backwards compatibility aliases.
+ set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL
diff --git a/patches/openmp/bootstrap-with-openmp-version-export-missing.diff b/patches/openmp/bootstrap-with-openmp-version-export-missing.diff
new file mode 100644 (file)
index 0000000..f503df2
--- /dev/null
@@ -0,0 +1,14 @@
+Index: llvm-toolchain-7-7/openmp/runtime/src/CMakeLists.txt
+===================================================================
+--- llvm-toolchain-7-7.orig/openmp/runtime/src/CMakeLists.txt
++++ llvm-toolchain-7-7/openmp/runtime/src/CMakeLists.txt
+@@ -174,7 +174,8 @@ endif()
+ # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+-target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS})
++target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS}
++  "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt")
+ # Create *.inc before compiling any sources
+ # objects depend on : .inc files
diff --git a/patches/openmp/openmp-check-execstack.diff b/patches/openmp/openmp-check-execstack.diff
new file mode 100644 (file)
index 0000000..5bfbc2c
--- /dev/null
@@ -0,0 +1,14 @@
+Index: llvm-toolchain-snapshot_7~svn335949/openmp/runtime/tools/check-execstack.pl
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/openmp/runtime/tools/check-execstack.pl
++++ llvm-toolchain-snapshot_7~svn335949/openmp/runtime/tools/check-execstack.pl
+@@ -46,7 +46,8 @@ sub execstack($) {
+     #    GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
+     # Linux* OS Intel(R) 64:
+     #    GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x8
+-    if ( $stack[ 0 ] !~ m{\A\s*(?:GNU_)?STACK(?:\s+0x[0-9a-f]+){5}\s+([R ][W ][E ])\s+0x[0-9a-f]+\s*\z} ) {
++#    if ( $stack[ 0 ] !~ m{\A\s*(?:GNU_)?STACK(?:\s+0x[0-9a-f]+){5}\s+([R ][W ][E ])\s+0x[0-9a-f]+\s*\z} ) {
++    if ( $stack[ 0 ] !~ m{\A\s*(?:GNU_)?STACK(?:\s+0x[0-9a-f]+){5}\s+([R ][W ][E ])\s+0(?:x[0-9a-f]+)*\s*\z} ) {
+         runtime_error( "$file: Cannot parse stack segment line:", ">>> $stack[ 0 ]" );
+     }; # if
+     my $attrs = $1;
diff --git a/patches/openmp/openmp-mips-affinity.patch b/patches/openmp/openmp-mips-affinity.patch
new file mode 100644 (file)
index 0000000..10a868e
--- /dev/null
@@ -0,0 +1,56 @@
+Index: llvm-toolchain-snapshot_7~svn335949/openmp/runtime/src/kmp_affinity.h
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/openmp/runtime/src/kmp_affinity.h
++++ llvm-toolchain-snapshot_7~svn335949/openmp/runtime/src/kmp_affinity.h
+@@ -212,28 +212,29 @@ public:
+ #elif __NR_sched_getaffinity != 223
+ #error Wrong code for getaffinity system call.
+ #endif /* __NR_sched_getaffinity */
+-#elif KMP_ARCH_MIPS
+-#ifndef __NR_sched_setaffinity
+-#define __NR_sched_setaffinity 4239
+-#elif __NR_sched_setaffinity != 4239
+-#error Wrong code for setaffinity system call.
+-#endif /* __NR_sched_setaffinity */
+-#ifndef __NR_sched_getaffinity
+-#define __NR_sched_getaffinity 4240
+-#elif __NR_sched_getaffinity != 4240
+-#error Wrong code for getaffinity system call.
+-#endif /* __NR_sched_getaffinity */
+-#elif KMP_ARCH_MIPS64
+-#ifndef __NR_sched_setaffinity
+-#define __NR_sched_setaffinity 5195
+-#elif __NR_sched_setaffinity != 5195
+-#error Wrong code for setaffinity system call.
+-#endif /* __NR_sched_setaffinity */
+-#ifndef __NR_sched_getaffinity
+-#define __NR_sched_getaffinity 5196
+-#elif __NR_sched_getaffinity != 5196
+-#error Wrong code for getaffinity system call.
+-#endif /* __NR_sched_getaffinity */
++# elif KMP_ARCH_MIPS
++#  ifndef __NR_sched_setaffinity
++#   define __NR_sched_setaffinity  4239
++#  elif __NR_sched_setaffinity != 4239
++#   error Wrong code for setaffinity system call.
++#  endif /* __NR_sched_setaffinity */
++#  ifndef __NR_sched_getaffinity
++#   define __NR_sched_getaffinity  4240
++#  elif __NR_sched_getaffinity != 4240
++#   error Wrong code for getaffinity system call.
++#  endif /* __NR_sched_getaffinity */
++# elif KMP_ARCH_MIPS64
++#  ifndef __NR_sched_setaffinity
++#   define __NR_sched_setaffinity  5195
++#  elif __NR_sched_setaffinity != 5195
++#   error Wrong code for setaffinity system call.
++#  endif /* __NR_sched_setaffinity */
++#  ifndef __NR_sched_getaffinity
++#   define __NR_sched_getaffinity  5196
++#  elif __NR_sched_getaffinity != 5196
++#   error Wrong code for getaffinity system call.
++#  endif /* __NR_sched_getaffinity */
++# else
+ #error Unknown or unsupported architecture
+ #endif /* KMP_ARCH_* */
+ class KMPNativeAffinity : public KMPAffinity {
diff --git a/patches/powerpcspe/D49754-powerpcspe-clang.diff b/patches/powerpcspe/D49754-powerpcspe-clang.diff
new file mode 100644 (file)
index 0000000..bc85405
--- /dev/null
@@ -0,0 +1,136 @@
+Description: Add -m(no-)spe, and e500 CPU definitions and support to clang
+Author: Justin Hibbits <jrh29@alumni.cwru.edu>
+Origin: https://reviews.llvm.org/D49754
+Last-Update: 2018-12-04
+
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/include/clang/Driver/Options.td
++++ llvm-toolchain-7-7.0.1~+rc2/clang/include/clang/Driver/Options.td
+@@ -2053,6 +2053,8 @@ def faltivec : Flag<["-"], "faltivec">,
+ def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[DriverOption]>;
+ def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>;
+ def mno_altivec : Flag<["-"], "mno-altivec">, Group<m_ppc_Features_Group>;
++def mspe : Flag<["-"], "mspe">, Group<m_ppc_Features_Group>;
++def mno_spe : Flag<["-"], "mno-spe">, Group<m_ppc_Features_Group>;
+ def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>;
+ def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
+ def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Basic/Targets/PPC.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Basic/Targets/PPC.cpp
+@@ -54,6 +54,8 @@ bool PPCTargetInfo::handleTargetFeatures
+       HasFloat128 = true;
+     } else if (Feature == "+power9-vector") {
+       HasP9Vector = true;
++    } else if (Feature == "+spe") {
++      HasSPE = true;
+     }
+     // TODO: Finish this list and add an assert that we've handled them
+     // all.
+@@ -161,6 +163,8 @@ void PPCTargetInfo::getTargetDefines(con
+     Builder.defineMacro("__VEC__", "10206");
+     Builder.defineMacro("__ALTIVEC__");
+   }
++  if (HasSPE)
++    Builder.defineMacro("__SPE__");
+   if (HasVSX)
+     Builder.defineMacro("__VSX__");
+   if (HasP8Vector)
+@@ -334,6 +338,7 @@ bool PPCTargetInfo::hasFeature(StringRef
+       .Case("extdiv", HasExtDiv)
+       .Case("float128", HasFloat128)
+       .Case("power9-vector", HasP9Vector)
++      .Case("spe", HasSPE)
+       .Default(false);
+ }
+@@ -413,16 +418,16 @@ ArrayRef<TargetInfo::GCCRegAlias> PPCTar
+ }
+ static constexpr llvm::StringLiteral ValidCPUNames[] = {
+-    {"generic"}, {"440"},         {"450"},     {"601"},    {"602"},
+-    {"603"},     {"603e"},        {"603ev"},   {"604"},    {"604e"},
+-    {"620"},     {"630"},         {"g3"},      {"7400"},   {"g4"},
+-    {"7450"},    {"g4+"},         {"750"},     {"970"},    {"g5"},
+-    {"a2"},      {"a2q"},         {"e500mc"},  {"e5500"},  {"power3"},
+-    {"pwr3"},    {"power4"},      {"pwr4"},    {"power5"}, {"pwr5"},
+-    {"power5x"}, {"pwr5x"},       {"power6"},  {"pwr6"},   {"power6x"},
+-    {"pwr6x"},   {"power7"},      {"pwr7"},    {"power8"}, {"pwr8"},
+-    {"power9"},  {"pwr9"},        {"powerpc"}, {"ppc"},    {"powerpc64"},
+-    {"ppc64"},   {"powerpc64le"}, {"ppc64le"},
++    {"generic"},   {"440"},       {"450"},         {"601"},     {"602"},
++    {"603"},       {"603e"},      {"603ev"},       {"604"},     {"604e"},
++    {"620"},       {"630"},       {"g3"},          {"7400"},    {"g4"},
++    {"7450"},      {"g4+"},       {"750"},         {"970"},     {"g5"},
++    {"a2"},        {"a2q"},       {"e500"},        {"e500mc"},  {"e5500"},
++    {"power3"},    {"pwr3"},      {"power4"},      {"pwr4"},    {"power5"},
++    {"pwr5"},      {"power5x"},   {"pwr5x"},       {"power6"},  {"pwr6"},
++    {"power6x"},   {"pwr6x"},     {"power7"},      {"pwr7"},    {"power8"},
++    {"pwr8"},      {"power9"},    {"pwr9"},        {"powerpc"}, {"ppc"},
++    {"powerpc64"}, {"ppc64"},     {"powerpc64le"}, {"ppc64le"},
+ };
+ bool PPCTargetInfo::isValidCPUName(StringRef Name) const {
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/lib/Basic/Targets/PPC.h
++++ llvm-toolchain-7-7.0.1~+rc2/clang/lib/Basic/Targets/PPC.h
+@@ -45,7 +45,8 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetI
+     ArchDefinePwr8 = 1 << 12,
+     ArchDefinePwr9 = 1 << 13,
+     ArchDefineA2 = 1 << 14,
+-    ArchDefineA2q = 1 << 15
++    ArchDefineA2q = 1 << 15,
++    ArchDefine500v2 = 1 << 16
+   } ArchDefineTypes;
+@@ -66,6 +67,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetI
+   bool HasBPERMD = false;
+   bool HasExtDiv = false;
+   bool HasP9Vector = false;
++  bool HasSPE = false;
+ protected:
+   std::string ABI;
+@@ -145,6 +147,8 @@ public:
+                         ArchDefinePwr6x | ArchDefinePwr6 | ArchDefinePwr5x |
+                         ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr |
+                         ArchDefinePpcsq)
++              .Cases("e500", "e500v2",
++                    ArchDefineName | ArchDefine500v2)
+               .Default(ArchDefineNone);
+     }
+     return CPUKnown;
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/test/Driver/ppc-features.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/clang/test/Driver/ppc-features.cpp
+@@ -168,6 +168,9 @@
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -minvariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-INVFUNCDESC %s
+ // CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
++// RUN: %clang -target powerpc-unknown-linux-gnu %s -mno-spe -mspe -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
++// CHECK-SPE: "-target-feature" "+spe"
++
+ // Assembler features
+ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
+ // CHECK_BE_AS_ARGS: "-mppc64"
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/test/Misc/target-invalid-cpu-note.c
++++ llvm-toolchain-7-7.0.1~+rc2/clang/test/Misc/target-invalid-cpu-note.c
+@@ -79,7 +79,7 @@
+ // PPC: error: unknown target CPU 'not-a-cpu'
+ // PPC: note: valid target CPU values are: generic, 440, 450, 601, 602, 603,
+ // PPC-SAME: 603e, 603ev, 604, 604e, 620, 630, g3, 7400, g4, 7450, g4+, 750,
+-// PPC-SAME: 970, g5, a2, a2q, e500mc, e5500, power3, pwr3, power4, pwr4,
++// PPC-SAME: 970, g5, a2, a2q, e500, e500mc, e5500, power3, pwr3, power4, pwr4,
+ // PPC-SAME: power5, pwr5, power5x, pwr5x, power6, pwr6, power6x, pwr6x, power7,
+ // PPC-SAME: pwr7, power8, pwr8, power9, pwr9, powerpc, ppc, powerpc64, ppc64,
+ // PPC-SAME: powerpc64le, ppc64le
+--- llvm-toolchain-7-7.0.1~+rc2.orig/clang/test/Preprocessor/init.c
++++ llvm-toolchain-7-7.0.1~+rc2/clang/test/Preprocessor/init.c
+@@ -6980,6 +6980,10 @@
+ //
+ // PPC32-LINUX-NOT: _CALL_LINUX
+ //
++// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -target-feature +spe < /dev/null | FileCheck -match-full-lines -check-prefix PPC32-SPE %s
++//
++// PPC32-SPE:#define __SPE__ 1
++//
+ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-apple-darwin8 < /dev/null | FileCheck -match-full-lines -check-prefix PPC-DARWIN %s
+ //
+ // PPC-DARWIN:#define _ARCH_PPC 1
diff --git a/patches/powerpcspe/D54409-powerpcspe-register-spilling.diff b/patches/powerpcspe/D54409-powerpcspe-register-spilling.diff
new file mode 100644 (file)
index 0000000..3a50a54
--- /dev/null
@@ -0,0 +1,88 @@
+Description: PowerPC/SPE: Fix register spilling for SPE registers
+Author: Justin Hibbits <jrh29@alumni.cwru.edu>
+Origin: https://reviews.llvm.org/D54409
+Last-Update: 2018-12-05
+
+--- llvm-toolchain-7-7.0.1~+rc2.orig/lib/Target/PowerPC/PPCRegisterInfo.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/lib/Target/PowerPC/PPCRegisterInfo.cpp
+@@ -844,6 +844,9 @@ static unsigned offsetMinAlign(const Mac
+   case PPC::STXSD:
+   case PPC::STXSSP:
+     return 4;
++  case PPC::EVLDD:
++  case PPC::EVSTDD:
++    return 8;
+   case PPC::LXV:
+   case PPC::STXV:
+     return 16;
+@@ -960,7 +963,10 @@ PPCRegisterInfo::eliminateFrameIndex(Mac
+   // happen in invalid code.
+   assert(OpC != PPC::DBG_VALUE &&
+          "This should be handled in a target-independent way");
+-  if (!noImmForm && ((isInt<16>(Offset) &&
++  bool canBeImmediate = (OpC == PPC::EVSTDD || OpC == PPC::EVLDD) ?
++                        isUInt<8>(Offset) :
++                        isInt<16>(Offset);
++  if (!noImmForm && ((canBeImmediate &&
+                       ((Offset % offsetMinAlign(MI)) == 0)) ||
+                      OpC == TargetOpcode::STACKMAP ||
+                      OpC == TargetOpcode::PATCHPOINT)) {
+--- llvm-toolchain-7-7.0.1~+rc2.orig/test/CodeGen/PowerPC/spe.ll
++++ llvm-toolchain-7-7.0.1~+rc2/test/CodeGen/PowerPC/spe.ll
+@@ -525,18 +525,53 @@ entry:
+ ; CHECK: #NO_APP
+ }
+-define double @test_spill(double %a) nounwind {
++declare double @test_spill_spe_regs(double, double);
++define dso_local void @test_func2() #0 {
+ entry:
++  ret void
++}
++
++@global_var1 = global i32 0, align 4
++define double @test_spill(double %a, i32 %a1, i64 %a2, i8 * %a3, i32 *%a4, i32* %a5) nounwind {
++entry:
++  %a.addr = alloca double, align 8
++  %a1.addr = alloca i32, align 4
++  %a2.addr = alloca i64, align 8
++  %a3.addr = alloca i8*, align 4
++  %a4.addr = alloca i32*, align 4
++  %a5.addr = alloca i32*, align 4
++  %ptr = alloca i32*, align 4
++  %v1 = alloca [8 x i32], align 4
++  %v2 = alloca [7 x i32], align 4
++  %v3 = alloca [5 x i32], align 4
++  store i32 %a1, i32* %a1.addr, align 4
++  store i64 %a2, i64* %a2.addr, align 8
++  store i8* %a3, i8** %a3.addr, align 4
++  store i32* %a4, i32** %a4.addr, align 4
++  store i32* %a5, i32** %a5.addr, align 4
++  store i32* @global_var1, i32** %ptr, align 4
+   %0 = fadd double %a, %a
+-  call void asm sideeffect "","~{r0},~{r3},~{s4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27},~{r28},~{r29},~{r30},~{r31}"() nounwind
++  call void asm sideeffect "","~{s0},~{s3},~{s4},~{s5},~{s6},~{s7},~{s8},~{s9},~{s10},~{s11},~{s12},~{s13},~{s14},~{s15},~{s16},~{s17},~{s18},~{s19},~{s20},~{s21},~{s22},~{s23},~{s24},~{s25},~{s26},~{s27},~{s28},~{s29},~{s30},~{s31}"() nounwind
+   %1 = fadd double %0, 3.14159
++  %2 = load i32*, i32** %ptr, align 4
++  %3 = bitcast [8 x i32]* %v1 to i8*
++  call void @llvm.memset.p0i8.i32(i8* align 4 %3, i8 0, i32 24, i1 true)
++  %4 = load i32*, i32** %a5.addr, align 4
++  store i32 0, i32* %4, align 4
++  call void @test_func2()
++  %5 = bitcast [7 x i32]* %v2 to i8*
++  call void @llvm.memset.p0i8.i32(i8* align 4 %5, i8 0, i32 20, i1 true)
+   br label %return
+ return:
+   ret double %1
+ ; CHECK-LABEL: test_spill
+-; CHECK: efdadd
++; CHECK: li [[VREG:[0-9]+]], 256
++; CHECK: evstddx {{[0-9]+}}, {{[0-9]+}}, [[VREG]]
++; CHECK-NOT: evstdd {{[0-9]+}}, 256({{[0-9]+}}
+ ; CHECK: evstdd
++; CHECK: efdadd
+ ; CHECK: evldd
+ }
++declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1) #1
diff --git a/patches/powerpcspe/D54584-powerpcspe-double-parameter.diff b/patches/powerpcspe/D54584-powerpcspe-double-parameter.diff
new file mode 100644 (file)
index 0000000..ceae0ae
--- /dev/null
@@ -0,0 +1,216 @@
+Description: PowerPC: Optimize SPE double parameter calling setup
+Author: Justin Hibbits <jrh29@alumni.cwru.edu>
+Origin: https://reviews.llvm.org/D54583
+Last-Update: 2018-12-04
+
+--- llvm-toolchain-7-7.0.1~+rc2.orig/lib/Target/PowerPC/PPCISelLowering.cpp
++++ llvm-toolchain-7-7.0.1~+rc2/lib/Target/PowerPC/PPCISelLowering.cpp
+@@ -389,8 +389,16 @@ PPCTargetLowering::PPCTargetLowering(con
+   } else {
+     setOperationAction(ISD::BITCAST, MVT::f32, Expand);
+     setOperationAction(ISD::BITCAST, MVT::i32, Expand);
+-    setOperationAction(ISD::BITCAST, MVT::i64, Expand);
+     setOperationAction(ISD::BITCAST, MVT::f64, Expand);
++    if (Subtarget.hasSPE()) {
++      setOperationAction(ISD::BITCAST, MVT::i64, Custom);
++    } else {
++      setOperationAction(ISD::BITCAST, MVT::i64, Expand);
++    }
++  }
++
++  if (Subtarget.hasSPE()) {
++    setOperationAction(ISD::EXTRACT_ELEMENT, MVT::i64, Custom);
+   }
+   // We cannot sextinreg(i1).  Expand to shifts.
+@@ -1355,6 +1363,9 @@ const char *PPCTargetLowering::getTarget
+   case PPCISD::QBFLT:           return "PPCISD::QBFLT";
+   case PPCISD::QVLFSb:          return "PPCISD::QVLFSb";
+   case PPCISD::BUILD_FP128:     return "PPCISD::BUILD_FP128";
++  case PPCISD::BUILD_SPE64:     return "PPCISD::BUILD_SPE64";
++  case PPCISD::EXTRACT_SPE_LO:  return "PPCISD::EXTRACT_SPE_LO";
++  case PPCISD::EXTRACT_SPE_HI:  return "PPCISD::EXTRACT_SPE_HI";
+   }
+   return nullptr;
+ }
+@@ -7764,6 +7775,15 @@ SDValue PPCTargetLowering::LowerBITCAST(
+   SDLoc dl(Op);
+   SDValue Op0 = Op->getOperand(0);
++  if (Subtarget.hasSPE()) {
++    if (Op.getValueType() == MVT::f64 &&
++        Op0.getOpcode() == ISD::BUILD_PAIR &&
++        (Op0.getOperand(1).getValueType() == MVT::i32) &&
++        (Op0.getOperand(0).getValueType() == MVT::i32))
++      return DAG.getNode(PPCISD::BUILD_SPE64, dl, MVT::f64, Op0.getOperand(0),
++          Op0.getOperand(1));
++  }
++
+   if (!EnableQuadPrecision ||
+       (Op.getValueType() != MVT::f128 ) ||
+       (Op0.getOpcode() != ISD::BUILD_PAIR) ||
+@@ -7775,6 +7795,26 @@ SDValue PPCTargetLowering::LowerBITCAST(
+                      Op0.getOperand(1));
+ }
++// Lower EXTRACT_ELEMENT (i64 BITCAST f64), 0/1 to evmerge*
++SDValue PPCTargetLowering::LowerEXTRACT_ELEMENT(SDValue Op, SelectionDAG &DAG) const {
++
++  SDLoc dl(Op);
++  SDValue Op0 = Op->getOperand(0);
++
++  if (!Subtarget.hasSPE())
++    return SDValue();
++
++  if (!(Op.getValueType() == MVT::i32 &&
++      Op0.getOpcode() == ISD::BITCAST))
++    return SDValue();
++
++  assert(Op0.getNumOperands() > 0 && "WTF?");
++  if (Op->getConstantOperandVal(1) == 0)
++    return DAG.getNode(PPCISD::EXTRACT_SPE_LO,  dl, MVT::i32, Op0.getOperand(0));
++
++  return DAG.getNode(PPCISD::EXTRACT_SPE_HI, dl, MVT::i32, Op0.getOperand(0));
++}
++
+ // If this is a case we can't handle, return null and let the default
+ // expansion code take care of it.  If we CAN select this case, and if it
+ // selects to a single instruction, return Op.  Otherwise, if we can codegen
+@@ -9584,6 +9624,8 @@ SDValue PPCTargetLowering::LowerOperatio
+     return LowerBSWAP(Op, DAG);
+   case ISD::ATOMIC_CMP_SWAP:
+     return LowerATOMIC_CMP_SWAP(Op, DAG);
++  case ISD::EXTRACT_ELEMENT:
++    return LowerEXTRACT_ELEMENT(Op, DAG);
+   }
+ }
+@@ -9641,6 +9683,8 @@ void PPCTargetLowering::ReplaceNodeResul
+       return;
+     Results.push_back(LowerFP_TO_INT(SDValue(N, 0), DAG, dl));
+     return;
++  case ISD::BITCAST:
++    return;
+   }
+ }
+--- llvm-toolchain-7-7.0.1~+rc2.orig/lib/Target/PowerPC/PPCISelLowering.h
++++ llvm-toolchain-7-7.0.1~+rc2/lib/Target/PowerPC/PPCISelLowering.h
+@@ -192,6 +192,15 @@ namespace llvm {
+       /// Direct move of 2 consective GPR to a VSX register.
+       BUILD_FP128,
++      /// Merge 2 GPRs to a single SPE register
++      BUILD_SPE64,
++
++      /// Extract high SPE register component
++      EXTRACT_SPE_HI,
++
++      /// Extract low SPE register component
++      EXTRACT_SPE_LO,
++
+       /// Extract a subvector from signed integer vector and convert to FP.
+       /// It is primarily used to convert a (widened) illegal integer vector
+       /// type to a legal floating point vector type.
+@@ -1079,6 +1088,7 @@ namespace llvm {
+     SDValue lowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
+     SDValue lowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
+     SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG) const;
++    SDValue LowerEXTRACT_ELEMENT(SDValue Op, SelectionDAG &DAG) const;
+     SDValue DAGCombineExtBoolTrunc(SDNode *N, DAGCombinerInfo &DCI) const;
+     SDValue DAGCombineBuildVector(SDNode *N, DAGCombinerInfo &DCI) const;
+--- llvm-toolchain-7-7.0.1~+rc2.orig/lib/Target/PowerPC/PPCInstrInfo.td
++++ llvm-toolchain-7-7.0.1~+rc2/lib/Target/PowerPC/PPCInstrInfo.td
+@@ -225,6 +225,22 @@ def PPCbuild_fp128: SDNode<"PPCISD::BUIL
+                               SDTCisSameAs<1,2>]>,
+                            []>;
++def PPCbuild_spe64: SDNode<"PPCISD::BUILD_SPE64",
++                           SDTypeProfile<1, 2,
++                             [SDTCisFP<0>, SDTCisSameSizeAs<1,2>,
++                              SDTCisSameAs<1,2>]>,
++                           []>;
++
++def PPCextract_spe_hi : SDNode<"PPCISD::EXTRACT_SPE_HI",
++                               SDTypeProfile<1, 1,
++                                 [SDTCisInt<0>, SDTCisFP<1>]>,
++                                 []>;
++
++def PPCextract_spe_lo : SDNode<"PPCISD::EXTRACT_SPE_LO",
++                               SDTypeProfile<1, 1,
++                               [SDTCisInt<0>, SDTCisFP<1>]>,
++                               []>;
++
+ // These are target-independent nodes, but have target-specific formats.
+ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeqStart,
+                            [SDNPHasChain, SDNPOutGlue]>;
+--- llvm-toolchain-7-7.0.1~+rc2.orig/lib/Target/PowerPC/PPCInstrSPE.td
++++ llvm-toolchain-7-7.0.1~+rc2/lib/Target/PowerPC/PPCInstrSPE.td
+@@ -512,7 +512,7 @@ def EVLWWSPLATX    : EVXForm_1<792, (out
+ def EVMERGEHI      : EVXForm_1<556, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
+                                "evmergehi $RT, $RA, $RB", IIC_VecGeneral, []>;
+-def EVMERGELO      : EVXForm_1<557, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
++def EVMERGELO      : EVXForm_1<557, (outs sperc:$RT), (ins gprc:$RA, gprc:$RB),
+                                "evmergelo $RT, $RA, $RB", IIC_VecGeneral, []>;
+ def EVMERGEHILO    : EVXForm_1<558, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
+                                "evmergehilo $RT, $RA, $RB", IIC_VecGeneral, []>;
+@@ -889,4 +889,15 @@ def : Pat<(f64 (selectcc i1:$lhs, i1:$rh
+           (SELECT_SPE (CRANDC $lhs, $rhs), $tval, $fval)>;
+ def : Pat<(f64 (selectcc i1:$lhs, i1:$rhs, f64:$tval, f64:$fval, SETNE)),
+           (SELECT_SPE (CRXOR $lhs, $rhs), $tval, $fval)>;
++
++
++def : Pat<(f64 (PPCbuild_spe64 i32:$rB, i32:$rA)),
++          (f64 (COPY_TO_REGCLASS (EVMERGELO $rA, $rB), SPERC))>;
++
++def : Pat<(i32 (PPCextract_spe_hi f64:$rA)),
++          (i32 (EXTRACT_SUBREG (EVMERGEHI $rA, $rA), sub_32))>;
++
++def : Pat<(i32 (PPCextract_spe_lo f64:$rA)),
++          (i32 (EXTRACT_SUBREG $rA, sub_32))>;
++
+ }
+--- llvm-toolchain-7-7.0.1~+rc2.orig/test/CodeGen/PowerPC/spe.ll
++++ llvm-toolchain-7-7.0.1~+rc2/test/CodeGen/PowerPC/spe.ll
+@@ -472,10 +472,8 @@ entry:
+ ; CHECK-LABEL: test_dselect
+ ; CHECK: andi.
+ ; CHECK: bc
+-; CHECK: evldd
+-; CHECK: b
+-; CHECK: evldd
+-; CHECK: evstdd
++; CHECK: evor
++; CHECK: evmergehi
+ ; CHECK: blr
+ }
+@@ -519,7 +517,7 @@ entry:
+   %1 = call i32 asm sideeffect "efdctsi $0, $1", "=d,d"(double %0)
+   ret i32 %1
+ ; CHECK-LABEL: test_dasmconst
+-; CHECK: evldd
++; CHECK: evmergelo
+ ; CHECK: #APP
+ ; CHECK: efdctsi
+ ; CHECK: #NO_APP
+@@ -541,7 +539,7 @@ entry:
+   %a4.addr = alloca i32*, align 4
+   %a5.addr = alloca i32*, align 4
+   %ptr = alloca i32*, align 4
+-  %v1 = alloca [8 x i32], align 4
++  %v1 = alloca [9 x i32], align 4
+   %v2 = alloca [7 x i32], align 4
+   %v3 = alloca [5 x i32], align 4
+   store i32 %a1, i32* %a1.addr, align 4
+@@ -554,7 +552,7 @@ entry:
+   call void asm sideeffect "","~{s0},~{s3},~{s4},~{s5},~{s6},~{s7},~{s8},~{s9},~{s10},~{s11},~{s12},~{s13},~{s14},~{s15},~{s16},~{s17},~{s18},~{s19},~{s20},~{s21},~{s22},~{s23},~{s24},~{s25},~{s26},~{s27},~{s28},~{s29},~{s30},~{s31}"() nounwind
+   %1 = fadd double %0, 3.14159
+   %2 = load i32*, i32** %ptr, align 4
+-  %3 = bitcast [8 x i32]* %v1 to i8*
++  %3 = bitcast [9 x i32]* %v1 to i8*
+   call void @llvm.memset.p0i8.i32(i8* align 4 %3, i8 0, i32 24, i1 true)
+   %4 = load i32*, i32** %a5.addr, align 4
+   store i32 0, i32* %4, align 4
diff --git a/patches/powerpcspe/powerpcspe-add-missing-include-path.diff b/patches/powerpcspe/powerpcspe-add-missing-include-path.diff
new file mode 100644 (file)
index 0000000..c3a0b53
--- /dev/null
@@ -0,0 +1,18 @@
+Description: Fix missing include paths on powerpcspe
+Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908791
+Forwarded: https://reviews.llvm.org/D52066
+Last-Update: 2018-09-13
+
+--- llvm-toolchain-7-7~+rc3.orig/clang/lib/Driver/ToolChains/Linux.cpp
++++ llvm-toolchain-7-7~+rc3/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -700,7 +700,8 @@ void Linux::AddClangSystemIncludeArgs(co
+       "/usr/include/mips64el-linux-gnu",
+       "/usr/include/mips64el-linux-gnuabi64"};
+   const StringRef PPCMultiarchIncludeDirs[] = {
+-      "/usr/include/powerpc-linux-gnu"};
++      "/usr/include/powerpc-linux-gnu",
++      "/usr/include/powerpc-linux-gnuspe"};
+   const StringRef PPC64MultiarchIncludeDirs[] = {
+       "/usr/include/powerpc64-linux-gnu"};
+   const StringRef PPC64LEMultiarchIncludeDirs[] = {
diff --git a/patches/pr39427-misscompile.diff b/patches/pr39427-misscompile.diff
new file mode 100644 (file)
index 0000000..797e02b
--- /dev/null
@@ -0,0 +1,29 @@
+Index: llvm-toolchain-7-7/include/llvm/ADT/Optional.h
+===================================================================
+--- llvm-toolchain-7-7.orig/include/llvm/ADT/Optional.h
++++ llvm-toolchain-7-7/include/llvm/ADT/Optional.h
+@@ -108,24 +108,6 @@ template <typename T, bool IsPodLike> st
+   }
+ };
+-#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
+-/// Storage for trivially copyable types only.
+-template <typename T> struct OptionalStorage<T, true> {
+-  AlignedCharArrayUnion<T> storage;
+-  bool hasVal = false;
+-
+-  OptionalStorage() = default;
+-
+-  OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
+-  OptionalStorage &operator=(const T &y) {
+-    *reinterpret_cast<T *>(storage.buffer) = y;
+-    hasVal = true;
+-    return *this;
+-  }
+-
+-  void reset() { hasVal = false; }
+-};
+-#endif
+ } // namespace optional_detail
+ template <typename T> class Optional {
diff --git a/patches/python-clangpath.diff b/patches/python-clangpath.diff
new file mode 100644 (file)
index 0000000..1088377
--- /dev/null
@@ -0,0 +1,15 @@
+---
+ clang/bindings/python/clang/cindex.py |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/clang/bindings/python/clang/cindex.py
++++ b/clang/bindings/python/clang/cindex.py
+@@ -3851,7 +3851,7 @@ class Config:
+         elif name == 'Windows':
+             file = 'libclang.dll'
+         else:
+-            file = 'libclang.so'
++            file = 'libclang-7.so'
+         if Config.library_path:
+             file = Config.library_path + '/' + file
diff --git a/patches/remove-apple-clang-manpage.diff b/patches/remove-apple-clang-manpage.diff
new file mode 100644 (file)
index 0000000..71d176c
--- /dev/null
@@ -0,0 +1,38 @@
+Index: llvm-toolchain-7-7/clang/docs/CommandGuide/clang.rst
+===================================================================
+--- llvm-toolchain-7-7.orig/clang/docs/CommandGuide/clang.rst
++++ llvm-toolchain-7-7/clang/docs/CommandGuide/clang.rst
+@@ -310,20 +310,10 @@ Clang fully supports cross compilation a
+ Depending on how your version of Clang is configured, it may have support for a
+ number of cross compilers, or may only support a native target.
+-.. option:: -arch <architecture>
++.. option:: -target <architecture>
+   Specify the architecture to build for.
+-.. option:: -mmacosx-version-min=<version>
+-
+-  When building for Mac OS X, specify the minimum version supported by your
+-  application.
+-
+-.. option:: -miphoneos-version-min
+-
+-  When building for iPhone OS, specify the minimum version supported by your
+-  application.
+-
+ .. option:: -march=<cpu>
+   Specify that Clang should generate code for a specific processor family
+@@ -616,11 +606,6 @@ ENVIRONMENT
+   These environment variables specify additional paths, as for :envvar:`CPATH`, which are
+   only used when processing the appropriate language.
+-.. envvar:: MACOSX_DEPLOYMENT_TARGET
+-
+-  If :option:`-mmacosx-version-min` is unspecified, the default deployment
+-  target is read from this environment variable. This option only affects
+-  Darwin targets.
+ BUGS
+ ----
diff --git a/patches/remove-test-freezing.diff b/patches/remove-test-freezing.diff
new file mode 100644 (file)
index 0000000..f34afe6
--- /dev/null
@@ -0,0 +1,34 @@
+Index: llvm-toolchain-snapshot_7~svn335949/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cc
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cc
++++ llvm-toolchain-snapshot_7~svn335949/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cc
+@@ -1,29 +0,0 @@
+-// RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
+-
+-#include <stdio.h>
+-
+-#if !defined(__GLIBC_PREREQ)
+-#define __GLIBC_PREREQ(a, b) 0
+-#endif
+-
+-// getauxval() used instead of sysconf() in GetPageSize() is defined starting
+-// glbc version 2.16.
+-#if __GLIBC_PREREQ(2, 16)
+-extern "C" long sysconf(int name) {
+-  fprintf(stderr, "sysconf wrapper called\n");
+-  return 0;
+-}
+-#endif  // defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 16)
+-
+-int main() {
+-  // All we need to check is that the sysconf() interceptor defined above was
+-  // not called. Should it get called, it will crash right there, any
+-  // instrumented code executed before sanitizer init is finished will crash
+-  // accessing non-initialized sanitizer internals. Even if it will not crash
+-  // in some configuration, it should never be called anyway.
+-  fprintf(stderr, "Passed\n");
+-  // CHECK-NOT: sysconf wrapper called
+-  // CHECK: Passed
+-  // CHECK-NOT: sysconf wrapper called
+-  return 0;
+-}
diff --git a/patches/reproducible-pch.diff b/patches/reproducible-pch.diff
new file mode 100644 (file)
index 0000000..bb73886
--- /dev/null
@@ -0,0 +1,40 @@
+Description: Make ordering of OPENCL_EXTENSION_TYPES reproducible
+
+Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
+Bug-Debian: https://bugs.debian.org/877359
+Forwarded: no
+
+Index: llvm-toolchain-7-7/clang/lib/Serialization/ASTWriter.cpp
+===================================================================
+--- llvm-toolchain-7-7.orig/clang/lib/Serialization/ASTWriter.cpp
++++ llvm-toolchain-7-7/clang/lib/Serialization/ASTWriter.cpp
+@@ -4293,9 +4293,13 @@ void ASTWriter::WriteOpenCLExtensionType
+     return;
+   RecordData Record;
++  // Sort to allow reproducible .pch files - https://bugs.debian.org/877359
++  std::map<TypeID, std::set<std::string>> sortedOpenCLTypeExtMap;
+   for (const auto &I : SemaRef.OpenCLTypeExtMap) {
+-    Record.push_back(
+-        static_cast<unsigned>(getTypeID(I.first->getCanonicalTypeInternal())));
++    sortedOpenCLTypeExtMap[getTypeID(I.first->getCanonicalTypeInternal())]=I.second;
++  }
++  for (const auto &I : sortedOpenCLTypeExtMap) {
++    Record.push_back(static_cast<unsigned>(I.first));
+     Record.push_back(I.second.size());
+     for (auto Ext : I.second)
+       AddString(Ext, Record);
+@@ -4308,8 +4312,12 @@ void ASTWriter::WriteOpenCLExtensionDecl
+     return;
+   RecordData Record;
++  std::map<DeclID, std::set<std::string>> sortedOpenCLDeclExtMap;
+   for (const auto &I : SemaRef.OpenCLDeclExtMap) {
+-    Record.push_back(getDeclID(I.first));
++    sortedOpenCLDeclExtMap[getDeclID(I.first)]=I.second;
++  }
++  for (const auto &I : sortedOpenCLDeclExtMap) {
++    Record.push_back(I.first);
+     Record.push_back(static_cast<unsigned>(I.second.size()));
+     for (auto Ext : I.second)
+       AddString(Ext, Record);
diff --git a/patches/revert-change-soname.diff b/patches/revert-change-soname.diff
new file mode 100644 (file)
index 0000000..24cca1e
--- /dev/null
@@ -0,0 +1,65 @@
+Index: tools/llvm-shlib/simple_version_script.map.in
+===================================================================
+--- tools/llvm-shlib/simple_version_script.map.in      (revision 352580)
++++ tools/llvm-shlib/simple_version_script.map.in      (revision 352579)
+@@ -1 +1 @@
+-LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; };
++LLVM_@LLVM_VERSION_MAJOR@ { global: *; };
+Index: tools/llvm-config/CMakeLists.txt
+===================================================================
+--- tools/llvm-config/CMakeLists.txt   (revision 352580)
++++ tools/llvm-config/CMakeLists.txt   (revision 352579)
+@@ -37,7 +37,7 @@
+ set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+ set(LLVM_BUILD_SYSTEM cmake)
+ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+-set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}")
++set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}")
+ set(LLVM_HAS_GLOBAL_ISEL "ON")
+ # Use the C++ link flags, since they should be a superset of C link flags.
+Index: cmake/modules/AddLLVM.cmake
+===================================================================
+--- cmake/modules/AddLLVM.cmake        (revision 352580)
++++ cmake/modules/AddLLVM.cmake        (revision 352579)
+@@ -83,7 +83,7 @@
+     # FIXME: Don't write the "local:" line on OpenBSD.
+     # in the export file, also add a linker script to version LLVM symbols (form: LLVM_N.M)
+     add_custom_command(OUTPUT ${native_export_file}
+-      COMMAND echo "LLVM_${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR} {" > ${native_export_file}
++      COMMAND echo "LLVM_${LLVM_VERSION_MAJOR} {" > ${native_export_file}
+       COMMAND grep -q "[[:alnum:]]" ${export_file} && echo "  global:" >> ${native_export_file} || :
+       COMMAND sed -e "s/$/;/" -e "s/^/    /" < ${export_file} >> ${native_export_file}
+       COMMAND echo "  local: *;" >> ${native_export_file}
+@@ -500,7 +500,7 @@
+         PROPERTIES
+         # Since 4.0.0, the ABI version is indicated by the major version
+         SOVERSION ${LLVM_VERSION_MAJOR}
+-        VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
++        VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
+     endif()
+   endif()
+@@ -522,7 +522,7 @@
+       if(${output_name} STREQUAL "output_name-NOTFOUND")
+         set(output_name ${name})
+       endif()
+-      set(library_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX})
++      set(library_name ${output_name}-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
+       set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
+       set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name})
+       llvm_install_library_symlink(${api_name} ${library_name} SHARED
+Index: docs/ReleaseNotes.rst
+===================================================================
+--- docs/ReleaseNotes.rst      (revision 352580)
++++ docs/ReleaseNotes.rst      (revision 352579)
+@@ -30,6 +30,9 @@
+   is available on the Visual Studio Marketplace. The new integration
+   supports Visual Studio 2017.
++* Libraries have been renamed from 7.0 to 7. This change also impacts
++  downstream libraries like lldb.
++
+ * The LoopInstSimplify pass (``-loop-instsimplify``) has been removed.
+ * Symbols starting with ``?`` are no longer mangled by LLVM when using the
diff --git a/patches/rustc-aarch64-test-failure.diff b/patches/rustc-aarch64-test-failure.diff
new file mode 100644 (file)
index 0000000..83374d8
--- /dev/null
@@ -0,0 +1,152 @@
+From 1c34cd56bc59b1540e0a814d2f80ade77daa9248 Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone@redhat.com>
+Date: Tue, 11 Sep 2018 17:52:01 +0000
+Subject: [PATCH] [GlobalISel] Lower dbg.declare into indirect DBG_VALUE
+
+Summary:
+D31439 changed the semantics of dbg.declare to take the address of a
+variable as the first argument, making it indirect.  It specifically
+updated FastISel for this change here:
+
+https://reviews.llvm.org/D31439#change-WVArzi177jPl
+
+GlobalISel needs to follow suit, or else it will be missing a level of
+indirection in the generated debuginfo.  This problem was seen in a Rust
+debuginfo test on aarch64, since GlobalISel is used at -O0 for aarch64.
+
+https://github.com/rust-lang/rust/issues/49807
+https://bugzilla.redhat.com/show_bug.cgi?id=1611597
+https://bugzilla.redhat.com/show_bug.cgi?id=1625768
+
+Reviewers: dblaikie, aprantl, t.p.northover, javed.absar, rnk
+
+Reviewed By: rnk
+
+Subscribers: #debug-info, rovka, kristof.beyls, JDevlieghere, llvm-commits, tstellar
+
+Differential Revision: https://reviews.llvm.org/D51749
+
+git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341969 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lib/CodeGen/GlobalISel/IRTranslator.cpp       |  9 ++-
+ test/CodeGen/AArch64/GlobalISel/debug-cpp.ll  | 67 +++++++++++++++++++
+ .../CodeGen/AArch64/GlobalISel/debug-insts.ll |  4 +-
+ 3 files changed, 74 insertions(+), 6 deletions(-)
+ create mode 100644 test/CodeGen/AArch64/GlobalISel/debug-cpp.ll
+
+Index: llvm-toolchain-7-7/lib/CodeGen/GlobalISel/IRTranslator.cpp
+===================================================================
+--- llvm-toolchain-7-7.orig/lib/CodeGen/GlobalISel/IRTranslator.cpp
++++ llvm-toolchain-7-7/lib/CodeGen/GlobalISel/IRTranslator.cpp
+@@ -763,9 +763,12 @@ bool IRTranslator::translateKnownIntrins
+       // instructions (in fact, they get ignored if they *do* exist).
+       MF->setVariableDbgInfo(DI.getVariable(), DI.getExpression(),
+                              getOrCreateFrameIndex(*AI), DI.getDebugLoc());
+-    } else
+-      MIRBuilder.buildDirectDbgValue(getOrCreateVReg(*Address),
+-                                     DI.getVariable(), DI.getExpression());
++    } else {
++      // A dbg.declare describes the address of a source variable, so lower it
++      // into an indirect DBG_VALUE.
++      MIRBuilder.buildIndirectDbgValue(getOrCreateVReg(*Address),
++                                       DI.getVariable(), DI.getExpression());
++    }
+     return true;
+   }
+   case Intrinsic::vaend:
+Index: llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-cpp.ll
+===================================================================
+--- /dev/null
++++ llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-cpp.ll
+@@ -0,0 +1,67 @@
++; RUN: llc -global-isel -mtriple=aarch64 %s -stop-after=irtranslator -o - | FileCheck %s
++; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 -o /dev/null
++
++; struct NTCopy {
++;   NTCopy();
++;   NTCopy(const NTCopy &);
++;   int x;
++; };
++; int foo(NTCopy o) {
++;   return o.x;
++; }
++
++; ModuleID = 'ntcopy.cpp'
++source_filename = "ntcopy.cpp"
++target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
++target triple = "aarch64-unknown-linux-gnu"
++
++%struct.NTCopy = type { i32 }
++
++; CHECK-LABEL: name: _Z3foo6NTCopy
++; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), 0, !23, !DIExpression(), debug-location !24
++; Function Attrs: noinline nounwind optnone
++define dso_local i32 @_Z3foo6NTCopy(%struct.NTCopy* %o) #0 !dbg !7 {
++entry:
++  call void @llvm.dbg.declare(metadata %struct.NTCopy* %o, metadata !23, metadata !DIExpression()), !dbg !24
++  %x = getelementptr inbounds %struct.NTCopy, %struct.NTCopy* %o, i32 0, i32 0, !dbg !25
++  %0 = load i32, i32* %x, align 4, !dbg !25
++  ret i32 %0, !dbg !26
++}
++
++; Function Attrs: nounwind readnone speculatable
++declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
++
++attributes #0 = { noinline nounwind optnone }
++attributes #1 = { nounwind readnone speculatable }
++
++!llvm.dbg.cu = !{!0}
++!llvm.module.flags = !{!3, !4, !5}
++!llvm.ident = !{!6}
++
++!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
++!1 = !DIFile(filename: "ntcopy.cpp", directory: "/tmp")
++!2 = !{}
++!3 = !{i32 2, !"Dwarf Version", i32 4}
++!4 = !{i32 2, !"Debug Info Version", i32 3}
++!5 = !{i32 1, !"wchar_size", i32 4}
++!6 = !{!"clang version 8.0.0 "}
++!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo6NTCopy", scope: !1, file: !1, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
++!8 = !DISubroutineType(types: !9)
++!9 = !{!10, !11}
++!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
++!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "NTCopy", file: !1, line: 1, size: 32, flags: DIFlagTypePassByReference, elements: !12, identifier: "_ZTS6NTCopy")
++!12 = !{!13, !14, !18}
++!13 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !11, file: !1, line: 4, baseType: !10, size: 32)
++!14 = !DISubprogram(name: "NTCopy", scope: !11, file: !1, line: 2, type: !15, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
++!15 = !DISubroutineType(types: !16)
++!16 = !{null, !17}
++!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
++!18 = !DISubprogram(name: "NTCopy", scope: !11, file: !1, line: 3, type: !19, isLocal: false, isDefinition: false, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false)
++!19 = !DISubroutineType(types: !20)
++!20 = !{null, !17, !21}
++!21 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !22, size: 64)
++!22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !11)
++!23 = !DILocalVariable(name: "o", arg: 1, scope: !7, file: !1, line: 6, type: !11)
++!24 = !DILocation(line: 6, column: 16, scope: !7)
++!25 = !DILocation(line: 7, column: 12, scope: !7)
++!26 = !DILocation(line: 7, column: 3, scope: !7)
+Index: llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
+===================================================================
+--- llvm-toolchain-7-7.orig/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
++++ llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
+@@ -6,18 +6,16 @@
+ ; CHECK:    - { id: {{.*}}, name: in.addr, type: default, offset: 0, size: {{.*}}, alignment: {{.*}},
+ ; CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true,
+ ; CHECK-NEXT: debug-info-variable: '!11', debug-info-expression: '!DIExpression()',
+-; CHECK: DBG_VALUE debug-use %0(s32), debug-use $noreg, !11, !DIExpression(), debug-location !12
+ define void @debug_declare(i32 %in) #0 !dbg !7 {
+ entry:
+   %in.addr = alloca i32, align 4
+   store i32 %in, i32* %in.addr, align 4
+   call void @llvm.dbg.declare(metadata i32* %in.addr, metadata !11, metadata !DIExpression()), !dbg !12
+-  call void @llvm.dbg.declare(metadata i32 %in, metadata !11, metadata !DIExpression()), !dbg !12
+   ret void, !dbg !12
+ }
+ ; CHECK-LABEL: name: debug_declare_vla
+-; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), debug-use $noreg, !14, !DIExpression(), debug-location !15
++; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), 0, !14, !DIExpression(), debug-location !15
+ define void @debug_declare_vla(i32 %in) #0 !dbg !13 {
+ entry:
+   %vla.addr = alloca i32, i32 %in
diff --git a/patches/scan-build-clang-X.diff b/patches/scan-build-clang-X.diff
new file mode 100644 (file)
index 0000000..8221cc0
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-7_7~+rc1/clang/tools/scan-build/bin/scan-build
+===================================================================
+--- llvm-toolchain-7_7~+rc1.orig/clang/tools/scan-build/bin/scan-build
++++ llvm-toolchain-7_7~+rc1/clang/tools/scan-build/bin/scan-build
+@@ -1079,7 +1079,7 @@ sub RunBuildCommand {
+   if ($Cmd =~ /(.*\/?gcc[^\/]*$)/ or
+       $Cmd =~ /(.*\/?cc[^\/]*$)/ or
+       $Cmd =~ /(.*\/?llvm-gcc[^\/]*$)/ or
+-      $Cmd =~ /(.*\/?clang$)/ or
++      $Cmd =~ /(.*\/?clang[^\/]*$)/ or
+       $Cmd =~ /(.*\/?ccc-analyzer[^\/]*$)/) {
+     if (!($Cmd =~ /ccc-analyzer/) and !defined $ENV{"CCC_CC"}) {
diff --git a/patches/scan-build-clang-path.diff b/patches/scan-build-clang-path.diff
new file mode 100644 (file)
index 0000000..309287a
--- /dev/null
@@ -0,0 +1,15 @@
+---
+ clang/tools/scan-build/bin/scan-build |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/clang/tools/scan-build/bin/scan-build
++++ b/clang/tools/scan-build/bin/scan-build
+@@ -1432,7 +1432,7 @@ sub FindClang {
+   if (!defined $Options{AnalyzerDiscoveryMethod}) {
+     $Clang = Cwd::realpath("$RealBin/bin/clang") if (-f "$RealBin/bin/clang");
+     if (!defined $Clang || ! -x $Clang) {
+-      $Clang = Cwd::realpath("$RealBin/clang") if (-f "$RealBin/clang");
++      $Clang = Cwd::realpath("/usr/lib/llvm-7/bin/clang");
+     }
+     if (!defined $Clang || ! -x $Clang) {
+       return "error: Cannot find an executable 'clang' relative to" .
diff --git a/patches/scan-view-fix-path.diff b/patches/scan-view-fix-path.diff
new file mode 100644 (file)
index 0000000..a37e688
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_5.0~svn297449/clang/tools/scan-view/bin/scan-view
+===================================================================
+--- llvm-toolchain-snapshot_5.0~svn297449.orig/clang/tools/scan-view/bin/scan-view
++++ llvm-toolchain-snapshot_5.0~svn297449/clang/tools/scan-view/bin/scan-view
+@@ -61,7 +61,7 @@ def start_browser(port, options):
+ def run(port, options, root):
+     # Prefer to look relative to the installed binary
+-    share = os.path.dirname(__file__) + "/../share/scan-view"
++    share = os.path.dirname(__file__) + "/../share/"
+     if not os.path.isdir(share):
+         # Otherwise look relative to the source
+         share = os.path.dirname(__file__) + "/../../scan-view/share"
diff --git a/patches/series b/patches/series
new file mode 100644 (file)
index 0000000..43b6f2f
--- /dev/null
@@ -0,0 +1,166 @@
+# Debian versions
+19-clang_debian_version.patch
+0003-Debian-version-info-and-bugreport.patch
+clang-format-version.diff
+clang-analyzer-force-version.diff
+
+# Disabling features
+23-strlcpy_strlcat_warning_removed.diff
+
+27-fix_clang_stdint.diff
+declare_clear_cache.diff
+unwind-chain-inclusion.diff
+atomic_library_1.diff
+
+# Path updates
+python-clangpath.diff
+fix-clang-path-and-build.diff
+0048-Set-html_static_path-_static-everywhere.patch
+x32-fix-driver-search-paths.diff
+symbolizer-path.diff
+clang-tidy-run-bin.diff
+0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
+debug-jit-path.diff
+
+# commented because of bug 903709
+#force-gcc-header-obj.diff
+
+do-not-fail-on-unexpected-pass.diff
+disable-display-PASS-UNSUPPORTED-XFAIL.diff
+
+# llvm-config
+fix-llvm-config-obj-src-root.patch
+fix-llvm-config.diff
+0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch
+
+# Lib names
+0044-soname.diff
+lldb-soname.diff
+lldb-libname.diff
+openmp-soname.diff
+
+# Disable some tests
+silent-gold-test.diff
+silent-more-tests.diff
+silent-MCJIIT-tests.diff
+silent-gold-utils.diff
+silent-test-failing-codeverage.diff
+silent-amd-tet.diff
+silent-test-macho.diff
+silent-llvm-isel-fuzzer.diff
+remove-test-freezing.diff
+disable-llvm-symbolizer-test.diff
+disable-path-test-failing.diff
+disable-source-interleave.diff
+
+# Decrease the freq for the keep alive
+test-keep-alive.diff
+
+# scan-build
+scan-build-clang-path.diff
+install-scan-build-py.diff
+scan-view-fix-path.diff
+fix-scan-view-path.diff
+scan-build-clang-X.diff
+
+# lldb
+lldb/lldb-link-atomic-cmake.patch
+lldb/lldb-addversion-suffix-to-llvm-server-exec.patch
+lldb/lldb-missing-install.diff
+lldb/lldb-disable-swig-error.diff
+
+# Fix arch issue
+disable-error-xray.diff
+
+# OpenMP
+openmp/openmp-check-execstack.diff
+openmp/openmp-mips-affinity.patch
+openmp/bootstrap-with-openmp-version-export-missing.diff
+
+# libcxx
+libcxx/libcxxabi-test-don-t-fail-extended-long-double.patch
+libcxx/libcxx-test-fix-lockfree-test-for-i386.patch
+libcxx/libcxxabi-arm-ehabi-fix.patch
+libcxx/libcxx-test-atomics-set-compare-exchange-to-be-expected-fails-on-arm.patch
+libcxx/libcxx-silent-test-libcxx.diff
+libcxx/libcxx-silent-failure-ppc64el.diff
+libcxx/libcxx-silent-failure-arm64.diff
+
+# Rust on ppc
+D51108-rust-powerpc.diff
+
+# Change default optims
+mips-fpxx-enable.diff
+26-set-correct-float-abi.diff
+clang-baseline-fix-i386.patch
+disable-sse2-old-x86.diff
+clang-arm-default-vfp3-on-armv7a.patch
+
+# For the bootstrap
+bootstrap-fix-include-next.diff
+clangd-atomic-cmake.patch
+
+# Rustc
+rustc-aarch64-test-failure.diff
+
+# Fix docs
+remove-apple-clang-manpage.diff
+0049-Use-Debian-provided-MathJax-everywhere.patch
+
+# reproducible
+reproducible-pch.diff
+
+# Hurd port
+hurd/hurd-pathmax.diff
+hurd/hurd-EIEIO-undef.diff
+hurd/impl-path-hurd.diff
+hurd/hurd-lib_Support_Unix_Path.inc.diff
+hurd/hurd-tools_llvm-shlib_CMakeLists.txt.diff
+hurd/D54079-hurd-openmp.diff
+hurd/D54338-hurd-libcxx-threads-build.diff
+hurd/D54339-hurd-libcxx-threads-detection.diff
+hurd/D54378-hurd-triple.diff
+hurd/D54379-hurd-triple-clang.diff
+hurd/D54677-hurd-path_max.diff
+hurd/hurd-cxx-paths.diff
+hurd/D53557-hurd-self-exe-realpath.diff
+
+strip-ignore-deterministic-archives.diff
+
+# powerpcspe
+powerpcspe/powerpcspe-add-missing-include-path.diff
+powerpcspe/D49754-powerpcspe-clang.diff
+powerpcspe/D54409-powerpcspe-register-spilling.diff
+powerpcspe/D54584-powerpcspe-double-parameter.diff
+
+D52340-rustc-debuginfo.diff
+
+# Disable https://llvm.org/viewvc/llvm-project?view=revision&revision=352580
+# 7.0.1 was always abi compatible with 7.0
+# Therefor, the libraries are still compatible with the 7.1.0 version
+#7.1.0/revert-change-soname-2.diff
+#7.1.0/revert-change-soname.diff
+
+# fix the abi issue
+pr39427-misscompile.diff
+
+
+# kfreebsd
+kfreebsd/clang_lib_Basic_Targets.diff
+kfreebsd/CMakeLists.txt.diff
+kfreebsd/compiler-rt_lib.diff
+kfreebsd/include_llvm_ADT_Triple.h.diff
+kfreebsd/kfreebsd-libcxx-threads-detection.diff
+kfreebsd/kfreebsd-openmp.diff
+kfreebsd/kfreebsd-threads-build.diff
+kfreebsd/kfreebsd-triple-clang.diff
+kfreebsd/kfreebsd-triple.diff
+kfreebsd/lib_Support.diff
+kfreebsd/lib_Target_X86.diff
+kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff
+kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff
+kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff
+kfreebsd/include_llvm_MC_MCELFObjectWriter.h.diff
+AtomicExpand-Fix-a-crash-bug-when-lowering-unordered-loads.patch
+mips-force-nomadd4.diff
+D71028-mips-atomics-rust-test.diff
diff --git a/patches/silent-MCJIIT-tests.diff b/patches/silent-MCJIIT-tests.diff
new file mode 100644 (file)
index 0000000..8a486c0
--- /dev/null
@@ -0,0 +1,214 @@
+---
+ test/BugPoint/crash-narrowfunctiontest.ll                               |    1 -
+ test/BugPoint/remove_arguments_test.ll                                  |    1 -
+ test/ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll                     |    2 +-
+ test/ExecutionEngine/MCJIT/eh-lg-pic.ll                                 |    2 +-
+ test/ExecutionEngine/MCJIT/multi-module-sm-pic-a.ll                     |    2 +-
+ test/ExecutionEngine/MCJIT/stubs-sm-pic.ll                              |    2 +-
+ test/ExecutionEngine/MCJIT/test-global-init-nonzero-sm-pic.ll           |    2 +-
+ test/ExecutionEngine/MCJIT/test-ptr-reloc-sm-pic.ll                     |    2 +-
+ test/ExecutionEngine/OrcMCJIT/cross-module-sm-pic-a.ll                  |    2 +-
+ test/ExecutionEngine/OrcMCJIT/eh-lg-pic.ll                              |    2 +-
+ test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll                  |    2 +-
+ test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-sm-pic.ll |    2 +-
+ test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-sm-pic.ll           |    2 +-
+ test/ExecutionEngine/OrcMCJIT/stubs-sm-pic.ll                           |    2 +-
+ test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero-sm-pic.ll        |    2 +-
+ test/ExecutionEngine/OrcMCJIT/test-ptr-reloc-sm-pic.ll                  |    2 +-
+ test/Feature/load_module.ll                                             |    1 -
+ 17 files changed, 14 insertions(+), 17 deletions(-)
+
+Index: llvm-toolchain-snapshot_7~svn335949/test/BugPoint/crash-narrowfunctiontest.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/BugPoint/crash-narrowfunctiontest.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/BugPoint/crash-narrowfunctiontest.ll
+@@ -2,7 +2,6 @@
+ ;
+ ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls --opt-command opt -silence-passes > /dev/null
+ ; REQUIRES: loadable_module
+-; XFAIL: *
+ define i32 @foo() { ret i32 1 }
+Index: llvm-toolchain-snapshot_7~svn335949/test/BugPoint/remove_arguments_test.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/BugPoint/remove_arguments_test.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/BugPoint/remove_arguments_test.ll
+@@ -1,7 +1,6 @@
+ ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes --opt-command opt
+ ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
+ ; REQUIRES: loadable_module
+-; XFAIL: *
+ ; Test to make sure that arguments are removed from the function if they are
+ ; unnecessary. And clean up any types that frees up too.
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -extra-module=%p/Inputs/cross-module-b.ll -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, i686, i386
++; XFAIL: *
+ declare i32 @FB()
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/eh-lg-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/MCJIT/eh-lg-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/eh-lg-pic.ll
+@@ -1,6 +1,6 @@
+ ; REQUIRES: cxx-shared-library
+ ; RUN: %lli -relocation-model=pic -code-model=large %s
+-; XFAIL: cygwin, win32, mingw, mips-, mipsel-, i686, i386, aarch64, arm
++; XFAIL: *
+ declare i8* @__cxa_allocate_exception(i64)
+ declare void @__cxa_throw(i8*, i8*, i8*)
+ declare i32 @__gxx_personality_v0(...)
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/multi-module-sm-pic-a.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/MCJIT/multi-module-sm-pic-a.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/multi-module-sm-pic-a.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, i686, i386
++; XFAIL: *
+ declare i32 @FB()
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/stubs-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/MCJIT/stubs-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/stubs-sm-pic.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
+-; XFAIL: mips-, mipsel-, i686, i386, aarch64, arm
++; XFAIL: mips-, mipsel-, i686, i386, aarch64, arm, x86_64
+ define i32 @main() nounwind {
+ entry:
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/test-global-init-nonzero-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/MCJIT/test-global-init-nonzero-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/test-global-init-nonzero-sm-pic.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386
++; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, x86_64
+ @count = global i32 1, align 4
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/test-ptr-reloc-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/MCJIT/test-ptr-reloc-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/MCJIT/test-ptr-reloc-sm-pic.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -O0 -relocation-model=pic -code-model=small %s
+-; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386
++; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, x86_64
+ @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
+ @ptr = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), align 4
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/cross-module-sm-pic-a.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/cross-module-sm-pic-a.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/cross-module-sm-pic-a.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/cross-module-b.ll -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, i686, i386
++; XFAIL: *
+ declare i32 @FB()
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/eh-lg-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/eh-lg-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/eh-lg-pic.ll
+@@ -1,6 +1,6 @@
+ ; REQUIRES: cxx-shared-library
+ ; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=large %s
+-; XFAIL: cygwin, win32, mingw, mips-, mipsel-, i686, i386, aarch64, arm
++; XFAIL: *
+ declare i8* @__cxa_allocate_exception(i64)
+ declare void @__cxa_throw(i8*, i8*, i8*)
+ declare i32 @__gxx_personality_v0(...)
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/multi-module-sm-pic-a.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, i686, i386
++; XFAIL: *
+ declare i32 @FB()
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/remote/test-global-init-nonzero-sm-pic.ll
+@@ -1,6 +1,6 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext \
+ ; RUN:   -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, mingw32, win32
++; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, mingw32, win32, x86_64
+ ; UNSUPPORTED: powerpc64-unknown-linux-gnu
+ ; Remove UNSUPPORTED for powerpc64-unknown-linux-gnu if problem caused by r266663 is fixed
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/remote/test-ptr-reloc-sm-pic.ll
+@@ -1,6 +1,6 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext \
+ ; RUN:   -O0 -relocation-model=pic -code-model=small %s
+-; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, mingw32, win32
++; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, mingw32, win32, x86_64
+ ; UNSUPPORTED: powerpc64-unknown-linux-gnu
+ ; Remove UNSUPPORTED for powerpc64-unknown-linux-gnu if problem caused by r266663 is fixed
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/stubs-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/stubs-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/stubs-sm-pic.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
+-; XFAIL: mips-, mipsel-, i686, i386, aarch64, arm
++; XFAIL: mips-, mipsel-, i686, i386, aarch64, arm, x86_64
+ define i32 @main() nounwind {
+ entry:
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/test-global-init-nonzero-sm-pic.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=small %s > /dev/null
+-; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386
++; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, x86_64
+ @count = global i32 1, align 4
+Index: llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/test-ptr-reloc-sm-pic.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/ExecutionEngine/OrcMCJIT/test-ptr-reloc-sm-pic.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/ExecutionEngine/OrcMCJIT/test-ptr-reloc-sm-pic.ll
+@@ -1,5 +1,5 @@
+ ; RUN: %lli -jit-kind=orc-mcjit -O0 -relocation-model=pic -code-model=small %s
+-; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386
++; XFAIL: mips-, mipsel-, aarch64, arm, i686, i386, x86_64
+ @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
+ @ptr = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), align 4
+Index: llvm-toolchain-snapshot_7~svn335949/test/Feature/load_module.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335949.orig/test/Feature/load_module.ll
++++ llvm-toolchain-snapshot_7~svn335949/test/Feature/load_module.ll
+@@ -3,7 +3,6 @@
+ ; RUN:   -disable-output 2>&1 | grep Hello
+ ; REQUIRES: loadable_module
+ ; FIXME: On Cygming, it might fail without building LLVMHello manually.
+-; XFAIL: *
+ @junk = global i32 0
diff --git a/patches/silent-amd-tet.diff b/patches/silent-amd-tet.diff
new file mode 100644 (file)
index 0000000..5cd8acc
--- /dev/null
@@ -0,0 +1,11 @@
+Index: llvm-toolchain-snapshot_6.0~svn315566/test/MC/AMDGPU/hsa.s
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn315566.orig/test/MC/AMDGPU/hsa.s
++++ llvm-toolchain-snapshot_6.0~svn315566/test/MC/AMDGPU/hsa.s
+@@ -1,5 +1,6 @@
+ // RUN: llvm-mc -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | FileCheck %s --check-prefix=ASM
+ // RUN: llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | llvm-readobj -symbols -s -sd | FileCheck %s --check-prefix=ELF
++// XFAIL: *
+ // ELF: Section {
+ // ELF: Name: .text
diff --git a/patches/silent-gold-test.diff b/patches/silent-gold-test.diff
new file mode 100644 (file)
index 0000000..5cf60a2
--- /dev/null
@@ -0,0 +1,38 @@
+Description: fails on debian unstable amd64
+ Command Output (stderr):
+ --
+ /build/llvm-toolchain-snapshot-4.0~svn279916/test/tools/gold/X86/start-lib-common.ll:22:10: error: expected string not found in input
+ ; CHECK: @x = common global i32 0, align 8
+          ^
+ <stdin>:1:1: note: scanning from here
+ ; ModuleID = '/build/llvm-toolchain-snapshot-4.0~svn279916/build-llvm/test/tools/gold/X86/Output/start-lib-common.ll.tmp3.o'
+ ^
+ <stdin>:4:1: note: possible intended match here
+ @x = common global i32 0, align 4
+ ^
+
+
+Index: llvm-toolchain-snapshot_7~svn323434/test/tools/gold/X86/start-lib-common.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn323434.orig/test/tools/gold/X86/start-lib-common.ll
++++ llvm-toolchain-snapshot_7~svn323434/test/tools/gold/X86/start-lib-common.ll
+@@ -9,6 +9,7 @@
+ ; RUN:    -shared %t1.o --start-lib %t2.o --end-lib -o %t3.o
+ ; RUN: llvm-dis %t3.o -o - | FileCheck %s
++; XFAIL: *
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ @x = common global i32 0, align 4
+Index: llvm-toolchain-snapshot_7~svn323434/test/tools/gold/X86/comdat.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn323434.orig/test/tools/gold/X86/comdat.ll
++++ llvm-toolchain-snapshot_7~svn323434/test/tools/gold/X86/comdat.ll
+@@ -5,6 +5,7 @@
+ ; RUN:  -plugin-opt=save-temps
+ ; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
+ ; RUN: llvm-readobj -t %t3.o | FileCheck --check-prefix=OBJ %s
++; XFAIL: *
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
diff --git a/patches/silent-gold-utils.diff b/patches/silent-gold-utils.diff
new file mode 100644 (file)
index 0000000..2198499
--- /dev/null
@@ -0,0 +1,190 @@
+---
+ test/tools/gold/X86/common_thinlto.ll             |    1 +
+ test/tools/gold/X86/emit-llvm.ll                  |    2 ++
+ test/tools/gold/X86/parallel.ll                   |    1 +
+ test/tools/gold/X86/pr19901_thinlto.ll            |    1 +
+ test/tools/gold/X86/slp-vectorize.ll              |    1 +
+ test/tools/gold/X86/strip_names.ll                |    1 +
+ test/tools/gold/X86/thinlto.ll                    |    2 ++
+ test/tools/gold/X86/thinlto_archive.ll            |    1 +
+ test/tools/gold/X86/thinlto_internalize.ll        |    2 ++
+ test/tools/gold/X86/thinlto_linkonceresolution.ll |    2 ++
+ test/tools/gold/X86/thinlto_weak_resolution.ll    |    3 ++-
+ test/tools/gold/X86/type-merge2.ll                |    2 +-
+ test/tools/gold/X86/vectorize.ll                  |    1 +
+ test/tools/gold/X86/visibility.ll                 |    1 +
+ 14 files changed, 19 insertions(+), 2 deletions(-)
+
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/common_thinlto.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/common_thinlto.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/common_thinlto.ll
+@@ -17,6 +17,7 @@
+ ; RUN: llvm-nm %t3 | FileCheck %s --check-prefix=NM
+ ; NM: bar
++; XFAIL: *
+ source_filename = "common1.c"
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/emit-llvm.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/emit-llvm.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/emit-llvm.ll
+@@ -21,6 +21,8 @@
+ ; RUN: not test -a %t4.o
+ ; NM: T f3
++; XFAIL: *
++
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/parallel.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/parallel.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/parallel.ll
+@@ -5,6 +5,7 @@
+ ; RUN: llvm-dis %t.1.5.precodegen.bc -o - | FileCheck --check-prefix=CHECK-BC1 %s
+ ; RUN: llvm-nm %t.o | FileCheck --check-prefix=CHECK0 %s
+ ; RUN: llvm-nm %t.o1 | FileCheck --check-prefix=CHECK1 %s
++; XFAIL: *
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/pr19901_thinlto.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/pr19901_thinlto.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/pr19901_thinlto.ll
+@@ -4,6 +4,7 @@
+ ; RUN:     --plugin-opt=thinlto \
+ ; RUN:     -shared -m elf_x86_64 -o %t.so %t2.o %t.o
+ ; RUN: llvm-readobj -t %t.so | FileCheck %s
++; XFAIL: i686, i386
+ ; CHECK:       Symbol {
+ ; CHECK:         Name: f
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/slp-vectorize.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/slp-vectorize.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/slp-vectorize.ll
+@@ -7,6 +7,7 @@
+ ; test that the vectorizer is run.
+ ; CHECK: fadd <4 x float>
++; XFAIL: *
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/strip_names.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/strip_names.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/strip_names.ll
+@@ -25,6 +25,7 @@
+ ; NONAME:  %2 = load i32, i32* @GlobalValueName
+ ; NONAME:  %3 = add i32 %0, %2
+ ; NONAME:  ret i32 %3
++; XFAIL: *
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/thinlto.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto.ll
+@@ -127,6 +127,8 @@
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
++; XFAIL: i686, i386
++
+ declare void @g(...)
+ define void @f() {
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_archive.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/thinlto_archive.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_archive.ll
+@@ -15,6 +15,7 @@
+ ; RUN:    --plugin-opt=jobs=1 \
+ ; RUN:    -shared %t.o %t.a -o %t4 2>&1 | FileCheck %s
+ ; RUN: llvm-nm %t4 | FileCheck %s --check-prefix=NM
++; XFAIL: i686, i386
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_internalize.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/thinlto_internalize.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_internalize.ll
+@@ -14,6 +14,8 @@
+ ; h() should be internalized after promotion, and eliminated after inlining
+ ; CHECK-NOT: @h.llvm.
++; XFAIL: i686, i386
++
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+ define i32 @g() {
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_linkonceresolution.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/thinlto_linkonceresolution.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_linkonceresolution.ll
+@@ -23,6 +23,8 @@
+ ; OPT-NOT: @f()
+ ; OPT2: define weak_odr hidden void @f()
++; XFAIL: i686, i386
++
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+ define i32 @g() {
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_weak_resolution.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/thinlto_weak_resolution.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/thinlto_weak_resolution.ll
+@@ -9,6 +9,7 @@
+ ; RUN:     --plugin-opt=save-temps \
+ ; RUN:     -shared \
+ ; RUN:     -o %t3.o %t.o %t2.o
++; XFAIL: i686, i386
+ ; RUN: llvm-nm %t3.o | FileCheck %s
+ ; CHECK: weakfunc
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/type-merge2.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/type-merge2.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/type-merge2.ll
+@@ -6,6 +6,8 @@
+ ; RUN:    -shared %t.o %t2.o -o %t3.o
+ ; RUN: llvm-dis %t3.o.0.2.internalize.bc -o - | FileCheck %s
++; XFAIL: *
++
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/vectorize.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/vectorize.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/vectorize.ll
+@@ -7,6 +7,7 @@
+ ; test that the vectorizer is run.
+ ; CHECK: fadd <4 x float>
++; XFAIL: *
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-unknown-linux-gnu"
+Index: llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/visibility.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn322880.orig/test/tools/gold/X86/visibility.ll
++++ llvm-toolchain-snapshot_7~svn322880/test/tools/gold/X86/visibility.ll
+@@ -16,6 +16,7 @@
+ ; CHECK-NEXT: Other [
+ ; CHECK-NEXT:   STV_PROTECTED
+ ; CHECK-NEXT: ]
++; XFAIL: *
+ ; IR: define dso_local void @foo
diff --git a/patches/silent-llvm-isel-fuzzer.diff b/patches/silent-llvm-isel-fuzzer.diff
new file mode 100644 (file)
index 0000000..538f67b
--- /dev/null
@@ -0,0 +1,24 @@
+Index: llvm-toolchain-snapshot_6.0~svn315736/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn315736.orig/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
++++ llvm-toolchain-snapshot_6.0~svn315736/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
+@@ -2,6 +2,7 @@
+ ; without copying the whole lib dir or polluting the build dir.
+ ; REQUIRES: static-libs
+ ; REQUIRES: aarch64-registered-target
++: XFAIL: *
+ ; RUN: echo > %t.input
+Index: llvm-toolchain-snapshot_6.0~svn315736/test/tools/llvm-isel-fuzzer/execname-options.ll
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn315736.orig/test/tools/llvm-isel-fuzzer/execname-options.ll
++++ llvm-toolchain-snapshot_6.0~svn315736/test/tools/llvm-isel-fuzzer/execname-options.ll
+@@ -1,6 +1,7 @@
+ ; If the binary looks up libraries using an rpath, we can't test this
+ ; without copying the whole lib dir or polluting the build dir.
+ ; REQUIRES: static-libs
++: XFAIL: *
+ ; RUN: echo > %t.input
diff --git a/patches/silent-more-tests.diff b/patches/silent-more-tests.diff
new file mode 100644 (file)
index 0000000..35e303f
--- /dev/null
@@ -0,0 +1,60 @@
+# Comment the tests for the code coverage (fails otherwise)
+
+
+---
+ test/BugPoint/crash-narrowfunctiontest.ll |    1 +
+ test/BugPoint/metadata.ll                 |    3 ++-
+ test/BugPoint/remove_arguments_test.ll    |    1 +
+ test/Feature/load_module.ll               |    1 +
+ 4 files changed, 5 insertions(+), 1 deletion(-)
+
+Index: llvm-toolchain-snapshot_7~svn324807/test/BugPoint/crash-narrowfunctiontest.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn324807.orig/test/BugPoint/crash-narrowfunctiontest.ll
++++ llvm-toolchain-snapshot_7~svn324807/test/BugPoint/crash-narrowfunctiontest.ll
+@@ -2,6 +2,7 @@
+ ;
+ ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls --opt-command opt -silence-passes > /dev/null
+ ; REQUIRES: loadable_module
++; XFAIL: *
+ define i32 @foo() { ret i32 1 }
+Index: llvm-toolchain-snapshot_7~svn324807/test/BugPoint/metadata.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn324807.orig/test/BugPoint/metadata.ll
++++ llvm-toolchain-snapshot_7~svn324807/test/BugPoint/metadata.ll
+@@ -7,7 +7,8 @@
+ ;
+ ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t-notype -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo --opt-command opt > /dev/null
+ ; RUN: llvm-dis %t-notype-reduced-simplified.bc -o - | FileCheck %s --check-prefix=NOTYPE
+-;
++; XFAIL: *
++
+ ; Bugpoint should keep the call's metadata attached to the call.
+ ; CHECK: call void @foo(), !dbg ![[LOC:[0-9]+]], !attach ![[CALL:[0-9]+]]
+Index: llvm-toolchain-snapshot_7~svn324807/test/BugPoint/remove_arguments_test.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn324807.orig/test/BugPoint/remove_arguments_test.ll
++++ llvm-toolchain-snapshot_7~svn324807/test/BugPoint/remove_arguments_test.ll
+@@ -1,6 +1,7 @@
+ ; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes --opt-command opt
+ ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
+ ; REQUIRES: loadable_module
++; XFAIL: *
+ ; Test to make sure that arguments are removed from the function if they are
+ ; unnecessary. And clean up any types that frees up too.
+Index: llvm-toolchain-snapshot_7~svn324807/test/Feature/load_module.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn324807.orig/test/Feature/load_module.ll
++++ llvm-toolchain-snapshot_7~svn324807/test/Feature/load_module.ll
+@@ -3,6 +3,7 @@
+ ; RUN:   -disable-output 2>&1 | grep Hello
+ ; REQUIRES: loadable_module
+ ; FIXME: On Cygming, it might fail without building LLVMHello manually.
++; XFAIL: *
+ @junk = global i32 0
diff --git a/patches/silent-test-failing-codeverage.diff b/patches/silent-test-failing-codeverage.diff
new file mode 100644 (file)
index 0000000..0fadd89
--- /dev/null
@@ -0,0 +1,13 @@
+Index: llvm-toolchain-snapshot_7~svn335581/test/ThinLTO/X86/autoupgrade.ll
+===================================================================
+--- llvm-toolchain-snapshot_7~svn335581.orig/test/ThinLTO/X86/autoupgrade.ll
++++ llvm-toolchain-snapshot_7~svn335581/test/ThinLTO/X86/autoupgrade.ll
+@@ -19,6 +19,8 @@
+ ; SUMMARYNAMES: ^2 = gv: (name: "globalfunc2",
+ ; SUMMARYNAMES: ^3 = gv: (name: "globalfunc1"
++; XFAIL: *
++
+ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+ target triple = "x86_64-apple-macosx10.11.0"
diff --git a/patches/silent-test-macho.diff b/patches/silent-test-macho.diff
new file mode 100644 (file)
index 0000000..569aea0
--- /dev/null
@@ -0,0 +1,14 @@
+Index: llvm-toolchain-snapshot_6.0~svn314668/test/Object/macho-invalid.test
+===================================================================
+--- llvm-toolchain-snapshot_6.0~svn314668.orig/test/Object/macho-invalid.test
++++ llvm-toolchain-snapshot_6.0~svn314668/test/Object/macho-invalid.test
+@@ -284,9 +284,6 @@ INVALID-DYLIB-WRONG-FILETYPE: macho-inva
+ RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dylib-no-id  2>&1 | FileCheck -check-prefix INVALID-DYLIB-NO-ID %s
+ INVALID-DYLIB-NO-ID: macho-invalid-dylib-no-id': truncated or malformed object (no LC_ID_DYLIB load command in dynamic library filetype)
+-RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dylib-cmdsize-past-eof 2>&1 | FileCheck -check-prefix INVALID-DYLIB-CMDSIZE %s
+-INVALID-DYLIB-CMDSIZE: macho-invalid-dylib-cmdsize-past-eof': truncated or malformed object (load command 0 extends past end of file)
+-
+ RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-uuid-more-than-one  2>&1 | FileCheck -check-prefix INVALID-UUID-MORE-THAN-ONE %s
+ INVALID-UUID-MORE-THAN-ONE: macho-invalid-uuid-more-than-one': truncated or malformed object (more than one LC_UUID command)
diff --git a/patches/strip-ignore-deterministic-archives.diff b/patches/strip-ignore-deterministic-archives.diff
new file mode 100644 (file)
index 0000000..10b0585
--- /dev/null
@@ -0,0 +1,10 @@
+Index: llvm-toolchain-7-7.0.1~+rc2/tools/llvm-objcopy/StripOpts.td
+===================================================================
+--- llvm-toolchain-7-7.0.1~+rc2.orig/tools/llvm-objcopy/StripOpts.td
++++ llvm-toolchain-7-7.0.1~+rc2/tools/llvm-objcopy/StripOpts.td
+@@ -47,3 +47,5 @@ def x : Flag<["-"], "x">,
+ def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
+                       HelpText<"Remove all symbols not needed by relocations">;
++
++def deterministic : Flag<["--"], "enable-deterministic-archives">;
diff --git a/patches/symbolizer-path.diff b/patches/symbolizer-path.diff
new file mode 100644 (file)
index 0000000..d431584
--- /dev/null
@@ -0,0 +1,24 @@
+Index: llvm-toolchain-7-7/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
+===================================================================
+--- llvm-toolchain-7-7.orig/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
++++ llvm-toolchain-7-7/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
+@@ -26,6 +26,10 @@
+ #include "sanitizer_symbolizer_internal.h"
+ #include "sanitizer_symbolizer_libbacktrace.h"
+ #include "sanitizer_symbolizer_mac.h"
++#include "llvm/Config/llvm-config.h" // for LLVM_VERSION_MAJOR
++
++#define TOSTR2(X) #X
++#define TOSTR(X) TOSTR2(X)
+ #include <dlfcn.h>   // for dlsym()
+ #include <errno.h>
+@@ -481,7 +485,7 @@ static SymbolizerTool *ChooseExternalSym
+     return new(*allocator) AtosSymbolizer(found_path, allocator);
+   }
+ #endif  // SANITIZER_MAC
+-  if (const char *found_path = FindPathToBinary("llvm-symbolizer")) {
++  if (const char *found_path = "/usr/bin/llvm-symbolizer-" TOSTR(LLVM_VERSION_MAJOR)) {
+     VReport(2, "Using llvm-symbolizer found at: %s\n", found_path);
+     return new(*allocator) LLVMSymbolizer(found_path, allocator);
+   }
diff --git a/patches/test-keep-alive.diff b/patches/test-keep-alive.diff
new file mode 100644 (file)
index 0000000..f22c66f
--- /dev/null
@@ -0,0 +1,21 @@
+Index: llvm-toolchain-5.0-5.0.1~+rc1/utils/lit/lit/ProgressBar.py
+===================================================================
+--- llvm-toolchain-5.0-5.0.1~+rc1.orig/utils/lit/lit/ProgressBar.py
++++ llvm-toolchain-5.0-5.0.1~+rc1/utils/lit/lit/ProgressBar.py
+@@ -189,15 +189,7 @@ class SimpleProgressBar:
+             return
+         for i in range(self.atIndex, next):
+-            idx = i % 5
+-            if idx == 0:
+-                sys.stdout.write('%-2d' % (i*2))
+-            elif idx == 1:
+-                pass # Skip second char
+-            elif idx < 4:
+-                sys.stdout.write('.')
+-            else:
+-                sys.stdout.write(' ')
++            sys.stdout.write('%-2d ' % (i*2))
+         sys.stdout.flush()
+         self.atIndex = next
diff --git a/patches/unwind-chain-inclusion.diff b/patches/unwind-chain-inclusion.diff
new file mode 100644 (file)
index 0000000..0a7468e
--- /dev/null
@@ -0,0 +1,41 @@
+# Without this patch, the first local include of unwind.h might, with the 
+# __has_include_next, try to include the one from the system.
+# It might be /usr/include/clang/3.4/include/unwind.h
+# Because of the #ifndef __CLANG_UNWIND_H, it might never include any declaration
+# from the system. 
+
+---
+ clang/lib/Headers/unwind.h |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -23,9 +23,6 @@
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -53,6 +50,9 @@
+ # endif
+ #else
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ #ifdef __cplusplus
+@@ -294,6 +294,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struc
+ }
+ #endif
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+-#endif /* __CLANG_UNWIND_H */
diff --git a/patches/x32-fix-driver-search-paths.diff b/patches/x32-fix-driver-search-paths.diff
new file mode 100644 (file)
index 0000000..2e1da94
--- /dev/null
@@ -0,0 +1,80 @@
+Description: Fix missing include and library paths on x32
+Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Forwarded: https://reviews.llvm.org/D52050
+Last-Update: 2018-09-14
+
+--- llvm-toolchain-7-7~+rc3.orig/clang/lib/Driver/ToolChains/Gnu.cpp
++++ llvm-toolchain-7-7~+rc3/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -1837,7 +1837,10 @@ void Generic_GCC::GCCInstallationDetecto
+       "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
+       "x86_64-slackware-linux", "x86_64-unknown-linux",
+       "x86_64-amazon-linux"};
+-  static const char *const X32LibDirs[] = {"/libx32"};
++  static const char *const X32LibDirs[] = {"/libx32", "/lib"};
++  static const char *const X32Triples[] = {
++      "x86_64-linux-gnux32",    "x86_64-unknown-linux-gnux32",
++      "x86_64-pc-linux-gnux32"};
+   static const char *const X86LibDirs[] = {"/lib32", "/lib"};
+   static const char *const X86Triples[] = {
+       "i686-linux-gnu",       "i686-pc-linux-gnu",     "i486-linux-gnu",
+@@ -2031,14 +2034,16 @@ void Generic_GCC::GCCInstallationDetecto
+     }
+     break;
+   case llvm::Triple::x86_64:
+-    LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+-    TripleAliases.append(begin(X86_64Triples), end(X86_64Triples));
+     // x32 is always available when x86_64 is available, so adding it as
+     // secondary arch with x86_64 triples
+     if (TargetTriple.getEnvironment() == llvm::Triple::GNUX32) {
+-      BiarchLibDirs.append(begin(X32LibDirs), end(X32LibDirs));
++      LibDirs.append(begin(X32LibDirs), end(X32LibDirs));
++      TripleAliases.append(begin(X32Triples), end(X32Triples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+       BiarchTripleAliases.append(begin(X86_64Triples), end(X86_64Triples));
+     } else {
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64Triples), end(X86_64Triples));
+       BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
+       BiarchTripleAliases.append(begin(X86Triples), end(X86Triples));
+     }
+--- llvm-toolchain-7-7~+rc3.orig/clang/lib/Driver/ToolChains/Linux.cpp
++++ llvm-toolchain-7-7~+rc3/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -86,10 +86,13 @@ static std::string getMultiarchTriple(co
+   case llvm::Triple::x86_64:
+     if (IsAndroid)
+       return "x86_64-linux-android";
+-    // We don't want this for x32, otherwise it will match x86_64 libs
+-    if (TargetEnvironment != llvm::Triple::GNUX32 &&
+-        D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu"))
+-      return "x86_64-linux-gnu";
++    if (TargetEnvironment == llvm::Triple::GNUX32) {
++      if (D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnux32"))
++        return "x86_64-linux-gnux32";
++    } else {
++      if (D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu"))
++        return "x86_64-linux-gnu";
++    }
+     break;
+   case llvm::Triple::aarch64:
+     if (IsAndroid)
+@@ -673,6 +676,8 @@ void Linux::AddClangSystemIncludeArgs(co
+       // in use in any released version of Debian, so we should consider
+       // removing them.
+       "/usr/include/i686-linux-gnu/64", "/usr/include/i486-linux-gnu/64"};
++  const StringRef X32MultiarchIncludeDirs[] = {
++      "/usr/include/x86_64-linux-gnux32"};
+   const StringRef X86MultiarchIncludeDirs[] = {
+       "/usr/include/i386-linux-gnu",
+@@ -715,7 +720,10 @@ void Linux::AddClangSystemIncludeArgs(co
+   ArrayRef<StringRef> MultiarchIncludeDirs;
+   switch (getTriple().getArch()) {
+   case llvm::Triple::x86_64:
+-    MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
++    if (getTriple().getEnvironment() == llvm::Triple::GNUX32)
++      MultiarchIncludeDirs = X32MultiarchIncludeDirs;
++    else
++      MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
+     break;
+   case llvm::Triple::x86:
+     MultiarchIncludeDirs = X86MultiarchIncludeDirs;
diff --git a/pollycc.in b/pollycc.in
new file mode 100755 (executable)
index 0000000..f063818
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+clang -Xclang -load -Xclang /usr/lib/llvm-@LLVM_VERSION@/lib/LLVMPolly.so $@
diff --git a/prepare-new-release.sh b/prepare-new-release.sh
new file mode 100644 (file)
index 0000000..a0db4e9
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+ORIG_VERSION=6.0
+TARGET_VERSION=7.0
+ORIG_VERSION_2=6_0
+TARGET_VERSION_2=7_0
+ORIG_VERSION_3=60
+TARGET_VERSION_3=70
+
+LIST=`ls debian/control debian/orig-tar.sh debian/rules debian/patches/clang-analyzer-force-version.diff debian/patches/clang-format-version.diff debian/patches/python-clangpath.diff debian/patches/scan-build-clang-path.diff debian/patches/lldb-libname.diff debian/patches/fix-scan-view-path.diff debian/patches/lldb-addversion-suffix-to-llvm-server-exec.patch debian/patches/clang-tidy-run-bin.diff debian/patches/clang-apply-replacements.diff debian/patches/fix-scan-view-path.diff debian/qualify-clang.sh debian/README debian/tests/control`
+for F in $LIST; do
+    sed -i -e "s|$ORIG_VERSION_3|$TARGET_VERSION_3|g" $F
+    sed -i -e "s|$ORIG_VERSION_2|$TARGET_VERSION_2|g" $F
+    sed -i -e "s|$ORIG_VERSION|$TARGET_VERSION|g" $F
+done
+
+echo "once you copy the old version into a new branch"
+echo "edit debian/control, update the VCS links"
+echo "edit debian/control, update the source pkg name"
+echo "edit debian/changelog, update the source pkg name"
diff --git a/python-clang-X.Y.install.in b/python-clang-X.Y.install.in
new file mode 100644 (file)
index 0000000..b549421
--- /dev/null
@@ -0,0 +1 @@
+tools/clang/bindings/python/clang/ /usr/lib/python2.7/dist-packages/
diff --git a/python-lldb-X.Y.install.in b/python-lldb-X.Y.install.in
new file mode 100644 (file)
index 0000000..3e2c69e
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/llvm-@LLVM_VERSION@/lib/python2.7/site-packages/lldb/
diff --git a/python-lldb-X.Y.links.in b/python-lldb-X.Y.links.in
new file mode 100644 (file)
index 0000000..bce077f
--- /dev/null
@@ -0,0 +1,6 @@
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION_FULL@.so.1 usr/lib/llvm-@LLVM_VERSION@/lib/python2.7/site-packages/lldb/libLLVM-@LLVM_VERSION_FULL@.so.1
+usr/lib/@DEB_HOST_MULTIARCH@/libLLVM-@LLVM_VERSION_FULL@.so.1 usr/lib/llvm-@LLVM_VERSION@/lib/python2.7/site-packages/lldb/libLLVM-@LLVM_VERSION@.so.1
+usr/lib/@DEB_HOST_MULTIARCH@/liblldb-@LLVM_VERSION@.so.1      usr/lib/llvm-@LLVM_VERSION@/lib/python2.7/site-packages/lldb/_lldb.so
+usr/lib/llvm-@LLVM_VERSION@/lib/python2.7/site-packages/lldb/ usr/lib/python2.7/dist-packages/lldb
+
+
diff --git a/qualify-clang.sh b/qualify-clang.sh
new file mode 100755 (executable)
index 0000000..aa433d9
--- /dev/null
@@ -0,0 +1,782 @@
+#!/bin/bash
+# Stop at the first error
+set -e
+if ! test -d debian/; then
+    echo "$0: Could not find the debian/ directory"
+    exit 1
+fi
+VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p")
+DETAILED_VERSION=$(dpkg-parsechangelog |  sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1\2\3,p")
+DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
+
+LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm7_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb  libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb  libclang-common-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb  llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb  liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb  llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}-dbgsym_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}-dbgsym_${DETAILED_VERSION}_amd64.deb"
+echo "To install everything:"
+echo "sudo dpkg -i $LIST"
+L=""
+for f in $LIST; do
+    L="$L $(echo $f|cut -d_ -f1)"
+done
+echo "or"
+echo "apt-get install $L"
+
+if test ! -f /usr/bin/llvm-config-$VERSION; then
+    echo "Install llvm-$VERSION & llvm-$VERSION-dev"
+    exit 1
+fi
+if test ! -f /usr/lib/llvm-$VERSION/lib/libLLVM-$VERSION.so; then
+    echo "Install llvm-$VERSION-dev"
+    exit 1
+fi
+llvm-config-$VERSION --link-shared --libs &> /dev/null
+
+if llvm-config-$VERSION --cxxflags | grep " \-W"; then
+    echo "llvm-config should not export -W warnings"
+    exit 1
+fi
+
+# Test https://bugs.llvm.org/show_bug.cgi?id=40059
+nm /usr/lib/llvm-$VERSION/lib/libLLVMBitWriter.a &> foo.log
+if grep "File format not recognized" foo.log; then
+    echo "nm libLLVMBitWriter.a contains 'File format not recognized'"
+    exit 1
+fi
+
+echo '#include <stdlib.h>
+int main() {
+  char *x = (char*)malloc(10 * sizeof(char*));
+  free(x);
+  return x[5];
+}
+' > foo.c
+clang-$VERSION -o foo -fsanitize=address -O1 -fno-omit-frame-pointer -g  foo.c
+if ! ./foo 2>&1 | grep -q heap-use-after-free ; then
+    echo "sanitize=address is failing"
+    exit 42
+fi
+
+if test ! -f /usr/bin/scan-build-$VERSION; then
+    echo "Install clang-tools-$VERSION"
+    exit 1
+fi
+
+echo '
+void test() {
+  int x;
+  x = 1; // warn
+}
+'> foo.c
+
+scan-build-$VERSION -o scan-build gcc -c foo.c &> /dev/null || true
+scan-build-$VERSION -o scan-build clang-$VERSION -c foo.c &> /dev/null
+rm -rf scan-build
+
+echo 'int main() {return 0;}' > foo.c
+clang-$VERSION foo.c
+
+echo '#include <stddef.h>' > foo.c
+clang-$VERSION -c foo.c
+
+# https://bugs.launchpad.net/bugs/1810860
+clang-$VERSION -dumpversion &> foo.log
+if grep 4.2.1 foo.log; then
+    echo "dumpversion still returns 4.2.1"
+#    exit 1
+fi
+
+# bug 903709
+echo '#include <stdatomic.h>
+void increment(atomic_size_t *arg) {
+    atomic_fetch_add(arg, 1);
+} ' > foo.c
+
+clang-$VERSION -v -c foo.c
+
+echo "#include <fenv.h>" > foo.cc
+NBLINES=$(clang++-$VERSION -P -E foo.cc|wc -l)
+if test $NBLINES -lt 100; then
+    echo "Error: more than 100 lines should be returned"
+    exit 42
+fi
+
+echo '#include <emmintrin.h>' > foo.cc
+clang++-$VERSION -c foo.cc
+
+# Bug 913213
+echo '#include <limits.h>' | clang-$VERSION -E - > /dev/null
+
+# Bug launchpad #1488254
+echo '
+#include <string>
+std::string hello = "Hello, world!\n";
+' > foo.cc
+
+echo '
+#include <string>
+#include <iostream>
+extern std::string hello;
+int main() {
+    std::cout << hello;
+    return 0;
+} ' > bar.cc
+
+g++ -c foo.cc && g++ foo.o bar.cc && ./a.out  > /dev/null || true
+clang++-$VERSION -c foo.cc && clang++-$VERSION foo.o bar.cc && ./a.out  > /dev/null
+g++ -c foo.cc && clang++-$VERSION foo.o bar.cc && ./a.out  > /dev/null || true
+clang++-$VERSION -c foo.cc -fPIC && g++ foo.o bar.cc && ./a.out > /dev/null || true
+
+# bug 827866
+echo 'bool testAndSet(void *atomic) {
+    return __atomic_test_and_set(atomic, __ATOMIC_SEQ_CST);
+}'> foo.cpp
+clang++-$VERSION -c -target aarch64-linux-gnu foo.cpp
+if ! file foo.o 2>&1 | grep -i -q "aarch64"; then
+    echo "Could not find the string 'aarch64' in the output of file. Output:"
+    file foo.o
+    exit 42
+fi
+echo '
+#include <string.h>
+int
+main ()
+{
+  (void) strcat;
+  return 0;
+}' > foo.c
+clang-$VERSION -c foo.c
+
+echo '#include <errno.h>
+int main() {} ' > foo.c
+clang-$VERSION foo.c
+
+echo '#include <chrono>
+int main() { }' > foo.cpp
+clang++-$VERSION -std=c++11 foo.cpp
+
+echo '#include <stdio.h>
+int main() {
+if (1==1) {
+       printf("true");
+}else{
+       printf("false");
+       return 42;
+}
+return 0;}' > foo.c
+clang-$VERSION --coverage foo.c -o foo
+./foo > /dev/null
+if test ! -f foo.gcno; then
+    echo "Coverage failed";
+fi
+
+echo "#include <iterator>" > foo.cpp
+clang++-$VERSION -c foo.cpp
+
+
+echo '#include <stdio.h>
+int main() {
+if (1==1) {
+  printf("true");
+}else{
+  printf("false");
+  return 42;
+}
+return 0;}' > foo.c
+rm foo bar.cc
+
+if test ! -f /usr/lib/llvm-$VERSION/bin/../lib/LLVMgold.so; then
+    echo "Install llvm-$VERSION-dev"
+    exit 1
+fi
+
+clang-$VERSION -flto foo.c -o foo
+./foo > /dev/null
+
+clang-$VERSION -fuse-ld=gold foo.c -o foo
+./foo > /dev/null
+
+# test thinlto
+echo "int foo(void) {  return 0; }"> foo.c
+echo "int foo(void); int main() {foo();        return 0;}">main.c
+clang-$VERSION -flto=thin -O2 foo.c main.c -o foo
+./foo > /dev/null
+clang-$VERSION -flto=thin -O2 foo.c main.c -c
+
+if test ! -f /usr/bin/lld-$VERSION; then
+    echo "Install lld-$VERSION"
+    exit 1
+fi
+clang-$VERSION -fuse-ld=lld -O2 foo.c main.c -o foo
+./foo > /dev/null
+
+clang-$VERSION -fuse-ld=lld -flto -O2 foo.c main.c -o foo
+./foo > /dev/null
+
+clang-$VERSION -fuse-ld=lld-$VERSION -O2 foo.c main.c -o foo
+./foo > /dev/null
+
+# Bug 916975
+file foo &> foo.log
+if ! grep -q "BuildID" foo.log; then
+    echo "BuildID isn't part of the generated binary (lld generation)"
+    exit 1
+fi
+# Bug 916975
+clang-$VERSION -O2 foo.c main.c -o foo2
+file foo2 &> foo2.log
+if ! grep "BuildID" foo2.log; then
+    echo "BuildID isn't part of the generated binary (ld generation)"
+    exit 1
+fi
+
+strip foo2
+file foo2 &> foo2.log
+if ! grep "BuildID" foo2.log; then
+    echo "BuildID isn't part of the generated binary (stripped)"
+    exit 1
+fi
+rm foo2 foo2.log
+
+cat << EOF > test_fuzzer.cc
+#include <stdint.h>
+#include <stddef.h>
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+  if (size > 0 && data[0] == 'H')
+    if (size > 1 && data[1] == 'I')
+       if (size > 2 && data[2] == '!')
+       __builtin_trap();
+  return 0;
+}
+EOF
+
+echo 'int main(int argc, char **argv) {
+  int *array = new int[100];
+  delete [] array;
+  return array[argc];  // BOOM
+}' > foo.cpp
+clang++-$VERSION -O1 -g -fsanitize=address -fno-omit-frame-pointer foo.cpp
+ASAN_OPTIONS=verbosity=1 ./a.out &> foo.log || true
+if ! grep "Init done" foo.log; then
+    echo "asan verbose mode failed"
+    cat foo.log
+    exit 42
+fi
+
+if test ! -f /usr/lib/llvm-$VERSION/bin/llvm-symbolizer; then
+    echo "Install llvm-$VERSION"
+    exit 1
+fi
+
+# See also https://bugs.llvm.org/show_bug.cgi?id=39514 why
+# /usr/bin/llvm-symbolizer-7 doesn't work
+ASAN_OPTIONS=verbosity=2:external_symbolizer_path=/usr/lib/llvm-$VERSION/bin/llvm-symbolizer ./a.out &> foo.log || true
+if ! grep "Using llvm-symbolizer" foo.log; then
+    echo "could not find llvm-symbolizer path"
+    cat foo.log
+    exit 42
+fi
+if ! grep "new\[\](unsigned" foo.log; then
+    echo "could not symbolize correctly"
+    cat foo.log
+    exit 42
+fi
+
+if ! grep "foo.cpp:3:3" foo.log; then
+    echo "could not symbolize correctly"
+    cat foo.log
+    exit 42
+fi
+./a.out &> foo.log || true
+if ! grep "new\[\](unsigned" foo.log; then
+    echo "could not symbolize correctly"
+    cat foo.log
+    exit 42
+fi
+
+if ! grep "foo.cpp:3:3" foo.log; then
+    echo "could not symbolize correctly"
+    cat foo.log
+    exit 42
+fi
+
+if test ! -f /usr/lib/llvm-$VERSION/lib/libFuzzer.a; then
+    echo "Install libfuzzer-$VERSION-dev";
+    exit -1;
+fi
+
+clang++-$VERSION -fsanitize=address -fsanitize-coverage=edge,trace-pc test_fuzzer.cc /usr/lib/llvm-$VERSION/lib/libFuzzer.a
+if ! ./a.out 2>&1 | grep -q -E "(Test unit written|PreferSmall)"; then
+    echo "fuzzer"
+    exit 42
+fi
+
+# Bug #876973
+echo '
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+   printf("Hello world!\n");
+   return 0;
+}' > foo.c
+
+# segfaults on 32bit with "-lc" library (also 6.0 does segfault)
+clang-$VERSION -fsanitize=address foo.c -o foo -lc
+./foo &> /dev/null || true
+
+# fails on 32 bit, seems a real BUG in the package, using 64bit static libs?
+LANG=C clang-$VERSION -fsanitize=fuzzer test_fuzzer.cc &> foo.log || true
+if ! grep "No such file or directory" foo.log; then
+    # This isn't failing on 64, so, look at the results
+    if ! ./a.out 2>&1 | grep -q -E "(Test unit written|PreferSmall)"; then
+        echo "fuzzer"
+        exit 42
+    fi
+fi
+
+echo 'int main() {
+       int a=0;
+       return a;
+}
+' > foo.c
+clang-$VERSION -g -o bar foo.c
+
+# ABI issue between gcc & clang
+# https://bugs.llvm.org/show_bug.cgi?id=39427
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913271
+echo '
+#include <llvm/ADT/ArrayRef.h>
+#include <llvm/ADT/Optional.h>
+namespace llvm { class Constant{}; class Type; class Value; }
+extern llvm::Constant* bar (llvm::Type*, llvm::Constant*, llvm::ArrayRef<llvm::Value*>, bool, llvm::Optional<unsigned> o, llvm::Type*);
+#ifdef PART2
+llvm::Constant* bar (llvm::Type*, llvm::Constant*, llvm::ArrayRef<llvm::Value*>, bool, llvm::Optional<unsigned> o, llvm::Type*)
+{
+   return o.hasValue()?static_cast<llvm::Constant*>(nullptr)+1:nullptr;
+}
+#endif
+#ifndef PART2
+static llvm::Constant* doConstantRef(llvm::Type* type, llvm::Constant* var, llvm::ArrayRef<llvm::Value*> steps)
+{
+   llvm::Optional<unsigned> inRangeIndex;
+   return bar(type, var, steps, false, inRangeIndex, nullptr);
+}
+bool foo()
+{
+   llvm::Constant* var = nullptr;
+   llvm::Value* zero = nullptr;
+   llvm::Value* indexes[2] = {zero, zero};
+   llvm::ArrayRef<llvm::Value*> steps(indexes, 2);
+   auto result = doConstantRef(nullptr, var, steps);
+   return result;
+}
+int main()
+{
+   return foo();
+}
+#endif
+' > foo.cpp
+FLAGS="-I/usr/lib/llvm-$VERSION/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -ffunction-sections -fdata-sections -O2 -DNDEBUG  -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+
+clang++-$VERSION -c -o part1.o foo.cpp $FLAGS
+if test -f /usr/bin/g++; then
+    g++ -c -o part2.o -DPART2 foo.cpp $FLAGS
+    clang++-$VERSION -o foo part1.o part2.o $FLAGS
+    ./foo
+fi
+rm part1.o part2.o
+
+if test ! -f /usr/lib/llvm-$VERSION/lib/libomp.so; then
+    echo "Install libomp-$VERSION-dev";
+    exit -1;
+fi
+
+# OpenMP
+cat <<EOF > foo.c
+//test.c
+#include "omp.h"
+#include <stdio.h>
+
+int main(void) {
+  #pragma omp parallel
+  printf("thread %d\n", omp_get_thread_num());
+}
+EOF
+clang-$VERSION foo.c -fopenmp -o o
+./o > /dev/null
+
+if test ! -f /usr/lib/llvm-$VERSION/include/c++/v1/vector; then
+    echo "Install libc++-$VERSION-dev";
+    exit -1;
+fi
+
+# libc++
+echo '
+#include <vector>
+#include <string>
+#include <iostream>
+using namespace std;
+int main(void) {
+    vector<string> tab;
+    tab.push_back("the");
+    tab.push_back("world");
+    tab.insert(tab.begin(), "Hello");
+
+    for(vector<string>::iterator it=tab.begin(); it!=tab.end(); ++it)
+    {
+        cout << *it << " ";
+    }
+    return 0;
+}' > foo.cpp
+clang++-$VERSION -stdlib=libc++ foo.cpp -o o
+if ! ldd o 2>&1|grep -q  libc++.so.1; then
+    echo "not linked against libc++.so.1"
+    exit -1
+fi
+if ! ldd o 2>&1|grep -q  libc++abi.so.1; then
+    echo "not linked against libc++abi.so.1"
+    exit -1
+fi
+
+./o > /dev/null
+clang++-$VERSION -std=c++11 -stdlib=libc++ foo.cpp -o o
+./o > /dev/null
+clang++-$VERSION -std=c++14 -stdlib=libc++ foo.cpp -lc++experimental -o o
+./o > /dev/null
+
+# Bug 889832
+echo '#include <iostream>
+int main() {}'  | clang++-$VERSION -std=c++1z  -x c++ -stdlib=libc++ -
+
+if test ! -f /usr/lib/llvm-$VERSION/include/cxxabi.h; then
+    echo "Install libc++abi-$VERSION-dev";
+    exit -1;
+fi
+
+# Force the usage of libc++abi
+clang++-$VERSION -stdlib=libc++ -lc++abi foo.cpp -o o
+./o > /dev/null
+if ! ldd o 2>&1|grep -q  libc++abi.so.1; then
+    echo "not linked against libc++abi.so.1"
+    exit -1
+fi
+
+# Use the libc++abi and uses the libstc++ headers
+clang++-$VERSION -lc++abi foo.cpp -o o
+./o > /dev/null
+if ! ldd o 2>&1|grep -q libstdc++.so.; then
+    echo "not linked against libstdc++"
+    exit -1
+fi
+
+# fs from C++17
+echo '
+#include <filesystem>
+#include <type_traits>
+using namespace std::filesystem;
+int main() {
+  static_assert(std::is_same<
+          path,
+          std::filesystem::path
+      >::value, "");
+}' > foo.cpp
+clang++-$VERSION -std=c++17 -stdlib=libc++ foo.cpp -lc++experimental -lc++fs -o o
+./o > /dev/null
+
+# Bug LP#1586215
+echo '
+#include <string>
+#include <iostream>
+
+int main()
+{
+    try
+    {
+        std::string x;
+        char z = x.at(2);
+        std::cout << z << std::endl;
+    }
+    catch (...)
+    {
+    }
+
+    return 0;
+}' > foo.cpp
+clang++-$VERSION -stdlib=libc++ -Wall -Werror foo.cpp -o foo
+./foo
+
+# Bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914201
+echo '
+#include <math.h>
+int main(void)
+{
+    double f = 2.0;
+    if (isnan(f))
+      return 1;
+    return 0;
+}' > foo.c
+clang-$VERSION -Wconversion -Werror foo.c || true
+
+if test -f /usr/bin/g++; then
+g++ -nostdinc++ -I/usr/lib/llvm-$VERSION/bin/../include/c++/v1/ -L/usr/lib/llvm-$VERSION/lib/ \
+    foo.cpp -nodefaultlibs -std=c++17 -lc++ -lc++abi -lm -lc -lgcc_s -lgcc|| true
+./o > /dev/null
+fi
+
+
+if test ! -f /usr/lib/llvm-$VERSION/include/polly/LinkAllPasses.h; then
+    echo "Install libclang-common-$VERSION-dev for polly";
+    exit -1;
+fi
+
+# Polly
+echo "
+#define N 1536
+float A[N][N];
+float B[N][N];
+float C[N][N];
+
+void init_array()
+{
+    int i, j;
+    for (i = 0; i < N; i++) {
+        for (j = 0; j < N; j++) {
+            A[i][j] = (1+(i*j)%1024)/2.0;
+            B[i][j] = (1+(i*j)%1024)/2.0;
+        }
+    }
+}
+
+int main()
+{
+    int i, j, k;
+    double t_start, t_end;
+    init_array();
+    for (i = 0; i < N; i++) {
+        for (j = 0; j < N; j++) {
+            C[i][j] = 0;
+            for (k = 0; k < N; k++)
+                C[i][j] = C[i][j] + A[i][k] * B[k][j];
+        }
+    }
+    return 0;
+}
+" > foo.c
+clang-$VERSION -O3 -mllvm -polly foo.c
+clang-$VERSION -O3 -mllvm -polly -mllvm -polly-parallel -lgomp foo.c
+clang-$VERSION -O3 -mllvm -polly -mllvm -polly-vectorizer=stripmine foo.c
+clang-$VERSION -S -fsave-optimization-record -emit-llvm foo.c -o matmul.s
+opt-$VERSION -S -polly-canonicalize matmul.s > matmul.preopt.ll > /dev/null
+opt-$VERSION -basicaa -polly-ast -analyze -q matmul.preopt.ll -polly-process-unprofitable > /dev/null
+if test ! -f /usr/lib/llvm-$VERSION/share/opt-viewer/opt-viewer.py; then
+    echo "Install llvm-$VERSION-tools"
+    exit 42
+fi
+/usr/lib/llvm-$VERSION/share/opt-viewer/opt-viewer.py -source-dir .  matmul.opt.yaml -o ./output > /dev/null
+
+if ! grep "not inlined into" output/foo.c.html 2>&1; then
+    echo "Could not find the output from polly"
+    exit -1
+fi
+
+echo "
+int foo(int x, int y) __attribute__((always_inline));
+int foo(int x, int y) { return x + y; }
+int bar(int j) { return foo(j, j - 2); }" > foo.cc
+clang-$VERSION -O2 -Rpass=inline foo.cc -c &> foo.log
+if ! grep "with cost=always" foo.log; then
+    echo "-Rpass fails"
+    cat foo.log
+    exit 1
+fi
+echo "
+int X = 0;
+
+int main() {
+  int i;
+  for (i = 0; i < 100; i++)
+    X += i;
+  return 0;
+}"> foo.cc
+clang++-$VERSION -O2 -fprofile-instr-generate foo.cc -o foo
+LLVM_PROFILE_FILE="foo-%p.profraw" ./foo
+llvm-profdata-$VERSION merge -output=foo.profdata foo-*.profraw
+clang++-$VERSION -O2 -fprofile-instr-use=foo.profdata foo.cc -o foo
+
+echo "b main
+run
+bt
+quit" > lldb-cmd.txt
+
+if test ! -f /usr/bin/lldb-$VERSION; then
+    echo "Install lldb-$VERSION";
+    exit -1;
+fi
+
+# bug 913946
+lldb-$VERSION -s lldb-cmd.txt bar
+if dpkg -l|grep -q clang-$VERSION-dbgsym; then
+    # Testing if clang dbg symbol are here
+    lldb-$VERSION -s lldb-cmd.txt clang-$VERSION &> foo.log
+    if ! grep "main at driver.cpp" foo.log; then
+        echo "Could not find the debug info"
+        echo "Or the main() of clang isn't in driver.cpp anymore"
+        exit -1
+    fi
+else
+    echo "clang-$VERSION-dbgsym isn't installed"
+fi
+
+echo '
+#include <vector>
+int main (void)
+{  std::vector<int> a;
+  a.push_back (0);
+}
+' > foo.cpp
+clang++-$VERSION -g -o foo foo.cpp
+echo 'target create "./foo"
+b main
+r
+n
+p a
+quit' > lldb-cmd.txt
+lldb-$VERSION -s lldb-cmd.txt ./foo
+
+echo "int main() { return 1; }" > foo.c
+# fails to run on i386 with the following error:
+#clang: error: unsupported option '-fsanitize=efficiency-working-set' for target 'i686-pc-linux-gnu'
+clang-$VERSION -fsanitize=efficiency-working-set -o foo foo.c || true
+./foo > /dev/null || true
+
+
+if test ! -f /usr/lib/llvm-$VERSION/lib/libclangToolingInclusions.a; then
+    echo "Install libclang-$VERSION-dev";
+    exit -1;
+fi
+
+rm -rf cmaketest && mkdir cmaketest
+cat > cmaketest/CMakeLists.txt <<EOF
+cmake_minimum_required(VERSION 2.8.12)
+project(SanityCheck)
+find_package(LLVM $VERSION REQUIRED CONFIG)
+message(STATUS "LLVM_CMAKE_DIR: \${LLVM_CMAKE_DIR}")
+if(NOT EXISTS "\${LLVM_TOOLS_BINARY_DIR}/clang")
+message(FATAL_ERROR "Invalid LLVM_TOOLS_BINARY_DIR: \${LLVM_TOOLS_BINARY_DIR}")
+endif()
+# TODO add version to ClangConfig.cmake and use $VERSION below
+find_package(Clang REQUIRED CONFIG)
+find_file(H clang/AST/ASTConsumer.h PATHS \${CLANG_INCLUDE_DIRS} NO_DEFAULT_PATH)
+message(STATUS "CLANG_INCLUDE_DIRS: \${CLANG_INCLUDE_DIRS}")
+if(NOT H)
+message(FATAL_ERROR "Invalid Clang header path: \${CLANG_INCLUDE_DIRS}")
+endif()
+EOF
+mkdir cmaketest/standard cmaketest/explicit
+echo "Test: CMake find LLVM and Clang in default path"
+(cd cmaketest/standard && CC=clang-$VERSION CXX=clang++-$VERSION cmake .. > /dev/null)
+echo "Test: CMake find LLVM and Clang in explicit prefix path"
+(cd cmaketest/explicit && CC=clang-$VERSION CXX=clang++-$VERSION CMAKE_PREFIX_PATH=/usr/lib/llvm-$VERSION cmake .. > /dev/null)
+rm -rf cmaketest
+
+# Test case for bug #900440
+rm -rf cmaketest && mkdir cmaketest
+cat > cmaketest/CMakeLists.txt <<EOF
+cmake_minimum_required(VERSION 2.8.12)
+project(testllvm)
+
+find_package(LLVM CONFIG REQUIRED)
+find_package(Clang CONFIG REQUIRED)
+
+if(NOT LLVM_VERSION STREQUAL Clang_VERSION)
+    #message(FATAL_ERROR "LLVM ${LLVM_VERSION} not matching to Clang ${Clang_VERSION}")
+endif()
+EOF
+mkdir cmaketest/foo/
+(cd cmaketest/foo && cmake .. > /dev/null)
+rm -rf cmaketest
+
+
+
+
+CLANG=clang-$VERSION
+#command -v "$CLANG" 1>/dev/null 2>/dev/null || { printf "Usage:\n%s CLANGEXE [ARGS]\n" "$0" 1>&2; exit 1; }
+#shift
+
+TEMPDIR=$(mktemp -d); trap "rm -rf \"$TEMPDIR\"" 0
+
+cat > "$TEMPDIR/test.c" <<EOF
+#include <stdlib.h>
+#include <stdio.h>
+int main ()
+{
+#if __has_feature(address_sanitizer)
+  puts("address_sanitizer");
+#endif
+#if __has_feature(thread_sanitizer)
+  puts("thread_sanitizer");
+#endif
+#if __has_feature(memory_sanitizer)
+  puts("memory_sanitizer");
+#endif
+#if __has_feature(undefined_sanitizer)
+  puts("undefined_sanitizer");
+#endif
+#if __has_feature(dataflow_sanitizer)
+  puts("dataflow_sanitizer");
+#endif
+#if __has_feature(efficiency_sanitizer)
+  puts("efficiency_sanitizer");
+#endif
+  printf("Ok\n");
+  return EXIT_SUCCESS;
+}
+EOF
+
+# only for AMD64 for now
+# many sanitizers only work on AMD64
+# x32 programs need to be enabled in the kernel bootparams for debian
+# (https://wiki.debian.org/X32Port)
+#
+# SYSTEM should iterate multiple targets (eg. x86_64-unknown-none-gnu for embedded)
+# MARCH should iterate the library architectures via flags
+# LIB should iterate the different libraries
+echo "if it fails, please run"
+echo "apt-get install libc6-dev:i386 libgcc-5-dev:i386 libc6-dev-x32 libx32gcc-5-dev libx32gcc-8-dev"
+for SYSTEM in ""; do
+    for MARCH in -m64 -m32 -mx32 "-m32 -march=i686"; do
+        for LIB in --rtlib=compiler-rt -fsanitize=address -fsanitize=thread -fsanitize=memory -fsanitize=undefined -fsanitize=dataflow; do # -fsanitize=efficiency-working-set; do
+            if test "$MARCH" == "-m32" -o "$MARCH" == "-mx32"; then
+                if test $LIB == "-fsanitize=thread" -o $LIB == "-fsanitize=memory" -o $LIB == "-fsanitize=dataflow" -o $LIB == "-fsanitize=address" -o $LIB == "-fsanitize=undefined"; then
+                    echo "Skip $MARCH / $LIB";
+                    continue
+                fi
+            fi
+            if test "$MARCH" == "-m32 -march=i686"; then
+                if test $LIB == "-fsanitize=memory" -o $LIB == "-fsanitize=thread" -o $LIB == "-fsanitize=dataflow"; then
+                     echo "Skip $MARCH / $LIB";
+                     continue
+                fi
+            fi
+            XARGS="$SYSTEM $MARCH $LIB"
+            printf "\nTest: clang %s\n" "$XARGS"
+            rm -f "$TEMPDIR/test"
+            "$CLANG" $XARGS -o "$TEMPDIR/test" "$@" "$TEMPDIR/test.c" || true
+            [ ! -e "$TEMPDIR/test" ] || { "$TEMPDIR/test" || printf 'Error\n'; }
+        done
+    done
+done
+
+echo "If the following fails, try setting an environment variable such as:"
+echo "OBJC_INCLUDE_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/include"
+echo "libobjc-7-dev should be also installed"
+echo "#include <objc/objc.h>" > foo.m
+#clang-$VERSION -c foo.m
+
+if test ! -f /usr/lib/llvm-$VERSION/lib/libclangBasic.a; then
+    echo "Install libclang-$VERSION-dev"
+    exit 1
+fi
+
+#clean up
+rm -f a.out bar crash-* foo foo.* lldb-cmd.txt main.* test_fuzzer.cc foo.* o
+rm -rf output matmul.* *profraw
+
+echo "Completed"
diff --git a/rules b/rules
new file mode 100755 (executable)
index 0000000..53e2296
--- /dev/null
+++ b/rules
@@ -0,0 +1,843 @@
+#!/usr/bin/make -f
+
+TARGET_BUILD   := build-llvm
+TARGET_BUILD_STAGE2    := $(TARGET_BUILD)/tools/clang/stage2-bins
+DEB_INST               := $(CURDIR)/debian/tmp/
+
+# Disable to move the previous method
+BUILD_METHOD := stage2
+
+GXX_VERSIONED_PACKAGE    := $(shell dpkg-query -W -f '$${Depends}' g++ | grep -o 'g++-[0-9][0-9.]*' | tail -n1 )
+GXX_VERSIONED_EXECUTABLE := $(shell dpkg -L $(GXX_VERSIONED_PACKAGE) | grep '/usr/bin/g++-[0-9][0-9.]*' | xargs ls -d | tail -n1 )
+GCC_VERSION              := $(subst /usr/bin/g++-,,$(GXX_VERSIONED_EXECUTABLE))
+
+LLVM_VERSION   := $(shell dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p")
+LLVM_VERSION_FULL := $(shell dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1,p")
+ifeq ($(LLVM_VERSION),$(LLVM_VERSION_FULL))
+       LLVM_VERSION_FULL := $(LLVM_VERSION).0.0
+endif
+
+SONAME_EXT      := 1
+SONAME_OPENMP  := 5
+# Manage the case when the version is 3.5~svn213052-1~exp1 or 3.4.2-1
+DEBIAN_REVISION := $(shell dpkg-parsechangelog |  sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\3,p")
+ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+  NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+endif
+
+VENDOR=$(shell lsb_release -is)
+DH_VERSION := $(shell dpkg -s debhelper | grep '^Version' | awk '{print $$2}')
+
+DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_HOST_ARCH_BITS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
+DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+
+LDFLAGS_EXTRA =
+CXXFLAGS_EXTRA =
+CFLAGS_EXTRA =
+CONFIGURE_EXTRA =
+CMAKE_EXTRA =
+
+BASE_PATH      := $(CURDIR)
+LIBCXX_EXCEPTIONS :=ON
+
+ifneq (,$(filter $(DEB_HOST_ARCH),s390x))
+       LIBCXX_EXCEPTIONS :=OFF
+endif
+
+ifneq (,$(filter $(DEB_HOST_ARCH),i386 armel mips mipsel powerpc powerpcspe riscv64))
+CMAKE_EXTRA += -DLIBOMP_LIBFLAGS="-latomic" -DCMAKE_SHARED_LINKER_FLAGS="-latomic"
+endif
+
+ifneq (,$(filter $(DEB_HOST_ARCH),armel))
+# For some reason, in the stage2 build, when clang is used to compile
+# itself. The atomic detection is failing on armel. Forcing the inclusion everywhere.
+LDFLAGS_EXTRA += -latomic
+endif
+
+# Cxx flags for building libcxx and libcxxabi
+LIBCXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
+
+ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 4.9-20140411-1~ ; echo $$?),0)
+# Too old version of gcc. Force 4.9
+       GCC_VERSION := 4.9
+endif
+
+export CC=gcc-$(GCC_VERSION)
+export CXX=g++-$(GCC_VERSION)
+
+opt_flags = -O2 -DNDEBUG
+
+# Only enable g1 on archs which needs it (it fixes an OOM during dh_strip due to huge symbols)
+ifeq ($(DEB_HOST_ARCH_BITS),32)
+opt_flags += -g1
+else
+# Should be -g, but this causes buildd disk space issues
+opt_flags += -g1
+endif
+
+ifneq (,$(findstring $(DEB_HOST_ARCH),armel))
+  opt_flags += -marm
+  # 3.8 fails to build, disable the compiler_rt builtins
+  # See http://lists.llvm.org/pipermail/llvm-dev/2016-May/099761.html
+  CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF
+  # Check for ancient libstdc++ fails due to atomics usage
+  CMAKE_EXTRA_LIBCXX += -DLLVM_COMPILER_CHECKED=ON
+  # Prevent clang from getting a > v4t default
+  # See bug #868779
+  CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=arm-linux-gnueabi
+endif
+
+
+ifneq (,$(findstring $(DEB_HOST_ARCH),armhf))
+# avoid an issue with openmp on armhf
+  CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=armv7l-unknown-linux-gnueabihf
+endif
+
+ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) ge 4.8-20121128-1~ ; echo $$?),0)
+       control_vars = '-Vdep:devlibs=libstdc++-$(GCC_VERSION)-dev, libgcc-$(GCC_VERSION)-dev' \
+               '-Vdep:devlibs-objc=libobjc-$(GCC_VERSION)-dev'
+else ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) ge 4.7.2-10~ ; echo $$?),0)
+       control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev, libgcc-$(GCC_VERSION)-dev' \
+               '-Vdep:devlibs-objc=libobjc-$(GCC_VERSION)-dev'
+else
+       control_vars = '-Vdep:devlibs=libstdc++6-$(GCC_VERSION)-dev'
+endif
+
+# Disabled:
+#  Host compiler does not support '-fuse-ld=lld'
+# USE_LLD_ARCHS := amd64
+# ifneq (,$(filter $(DEB_HOST_ARCH),$(USE_LLD_ARCHS)))
+#      CMAKE_EXTRA += -DLLVM_ENABLE_LLD=ON
+# endif
+
+BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el x32 s390x hurd-i386 kfreebsd-amd64 kfreebsd-i386
+ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.23.1-1~exp3 ; echo $$?),0)
+ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_GOLD_ARCHS)))
+# -fused-ld=gold enables the gold linker (but is not supported by all archs / distro)
+       LDFLAGS_EXTRA += -fuse-ld=gold
+#--no-keep-files-mapped --no-map-whole-files
+       CXXFLAGS_EXTRA += -fuse-ld=gold
+       CFLAGS_EXTRA += -fuse-ld=gold
+#-Wl,--no-keep-files-mapped -Wl,--no-map-whole-files
+       CMAKE_EXTRA += -DLLVM_BINUTILS_INCDIR=/usr/include/
+endif
+endif
+
+CODECOVERAGE=no
+ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS)))
+# enable the code coverage
+       CODECOVERAGE=yes
+# for -fvisibility-inlines-hidden see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130729/183016.html
+       CXXFLAGS_EXTRA += -fprofile-arcs -ftest-coverage
+       LDFLAGS_EXTRA += -coverage -lgcov
+       RUN_TEST=yes
+endif
+
+# Enable for bootstrap
+LDFLAGS_EXTRA            += -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wl,--build-id
+CXXFLAGS_EXTRA           += -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option
+BOOTSTRAP_CXXFLAGS_EXTRA  = $(CXXFLAGS_EXTRA) # Nothing for now. Keeping in case we need it
+CFLAGS_EXTRA             += -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option
+BOOTSTRAP_CFLAGS_EXTRA    = $(CFLAGS_EXTRA) # Nothing for now. Keeping in case we need it
+
+# Enable polly (or not)
+POLLY_ENABLE=yes
+ifneq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe))
+  POLLY_ENABLE=no
+endif
+
+# Enable openmp (or not)
+OPENMP_ENABLE=yes
+ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel powerpc powerpcspe riscv64 sparc64 s390x x32))
+  OPENMP_ENABLE=no
+endif
+
+RUN_TEST=yes
+ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+       RUN_TEST=no
+endif
+
+ifneq (,$(filter scan-build,$(DEB_BUILD_OPTIONS)))
+# enable the build using scan-build
+# The package are installed through the variable declarations:
+# OTHERMIRROR="deb http://llvm.org/apt/unstable/ llvm-toolchain main"
+# EXTRAPACKAGES="clang-X"
+       PRE_PROCESS=scan-build-$(LLVM_VERSION) --show-description -analyzer-config stable-report-filename=true
+# -enable-checker optin.performance.Padding
+       PRE_PROCESS_CONF=scan-build-$(LLVM_VERSION)
+# no need to run tests in this case
+       RUN_TEST=no
+       CONFIGURE_EXTRA += --enable-assertions
+       CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON
+endif
+
+ifneq (,$(filter coverity,$(DEB_BUILD_OPTIONS)))
+# enable the build using coverity
+# pbuilder contains BINDMOUNTS="/opt/cov-analysis/"
+# And we have some pbuilder hooks to configure and pack the result
+# Where the binaries are installed on the jenkins instance
+       PRE_PROCESS=PATH=$$PATH:/opt/cov-analysis/bin/ cov-build --dir cov-int
+# We don't want to check the temporary files produced by the configure
+       PRE_PROCESS_CONF=
+       COVERITY_ENABLE=1
+       CONFIGURE_EXTRA += --enable-assertions
+       CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON
+# no need to run tests in this case
+       RUN_TEST=no
+else
+       COVERITY_ENABLE=0
+endif
+
+LLDB_ENABLE=yes
+LLDB_DISABLE_ARCHS := hurd-i386 ia64 powerpc powerpcspe ppc64 riscv64 s390x sparc64
+# hurd has threading issues
+ifeq (,$(filter-out $(LLDB_DISABLE_ARCHS), $(DEB_HOST_ARCH)))
+# Disable LLDB for this arch.
+               LLDB_ENABLE=no
+else
+# See https://llvm.org/bugs/show_bug.cgi?id=28898
+# Enable it again as it seems it is fixed upstream https://bugs.llvm.org/show_bug.cgi?id=35291
+#      CMAKE_EXTRA += -DLLDB_DISABLE_LIBEDIT=ON
+endif
+
+LLD_ENABLE=yes
+
+ifneq (,$(filter $(DEB_HOST_ARCH_OS),linux))
+# only for linux
+       CMAKE_EXTRA += -DLLVM_USE_PERF=yes
+endif
+
+DH_OPTIONS=
+OCAML_ENABLE= no
+OCAML_ARCHS := amd64 arm64 armhf i386 ppc64el s390x
+ifneq (,$(filter $(DEB_HOST_ARCH),$(OCAML_ARCHS)))
+# Enable OCAML for this arch.
+       OCAML_ENABLE=yes
+       OCAML_STDLIB_DIR    ?= $(shell ocamlc -where)
+       DH_OPTIONS=--with ocaml
+endif
+# Force the deactivation of ocaml until the transition is done
+#OCAML_ENABLE=no
+
+LIBFUZZER_ENABLE=yes
+ifeq (,$(filter $(DEB_HOST_ARCH_OS),linux))
+       LIBFUZZER_ENABLE=no
+endif
+
+ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
+       LIBOMP_ARCH = mips
+endif
+
+ifneq (,$(filter $(DEB_HOST_ARCH), mips64 mips64el))
+       LIBOMP_ARCH = mips64
+endif
+
+
+%:
+       dh $@ $(DH_OPTIONS)
+
+
+preconfigure:
+       for f in debian/*.in; do \
+               f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \
+               echo "$$f => $$f2"; \
+               sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' \
+                       -e "s|@OCAML_STDLIB_DIR@|$(OCAML_STDLIB_DIR)|g" \
+                       -e "s|@LLVM_VERSION_FULL@|$(LLVM_VERSION_FULL)|g" \
+                       -e "s|@LLVM_VERSION@|$(LLVM_VERSION)|g" $$f > $$f2; \
+       done
+
+# Override this two targets. They are trying to manage the .in conversion for me
+override_dh_ocamlinit:
+override_dh_ocamlclean:
+
+override_dh_auto_configure: preconfigure
+       echo "Using gcc: "
+       $(CC) -v
+       mkdir -p $(TARGET_BUILD)
+       mkdir -p clang/include/clang/Debian
+       sed -e "s|@DEB_PATCHSETVERSION@|$(DEBIAN_REVISION)|" \
+               debian/debian_path.h > clang/include/clang/Debian/debian_path.h
+
+# Remove some old symlinks
+       cd tools/ && \
+               if test -h clang; then \
+                       rm clang; \
+               fi; \
+               ln -s ../clang .; \
+       readlink clang
+
+       if test "$(POLLY_ENABLE)" = yes; then \
+               cd tools/ && \
+               if test -h polly; then \
+                       rm polly; \
+               fi; \
+               ln -s ../polly .; \
+       fi
+
+       if test "$(LLD_ENABLE)" = yes; then \
+       cd tools/ && \
+               if test -h lld; then \
+                       rm lld; \
+               fi; \
+               ln -s ../lld .; \
+       readlink lld; \
+       fi
+
+       if test "$(LLDB_ENABLE)" = yes; then \
+               cd tools/ && \
+               if test -h lldb; then \
+                  rm lldb; \
+               fi; \
+               ln -s ../lldb .; \
+       fi
+
+       cd projects/ && \
+       if test -h compiler-rt; then \
+               rm compiler-rt; \
+       fi; \
+       ln -s ../compiler-rt .; \
+       readlink compiler-rt
+
+       if test "$(OPENMP_ENABLE)" = yes; then \
+               cd projects/ && \
+               if test -h openmp; then \
+                       rm openmp; \
+               fi; \
+               ln -s ../openmp .; \
+               readlink openmp; \
+       fi
+
+       # Configure coverity (we need the compilers) + work around perf issues
+       -(if test $(COVERITY_ENABLE) -eq 1; then \
+               export PATH=$$PATH:/opt/cov-analysis/bin/; \
+               cov-configure --compiler clang --comptype clang; \
+               cov-configure --compiler gcc-$(GCC_VERSION) --comptype gcc; \
+               cov-configure --compiler g++-$(GCC_VERSION) --comptype gcc; \
+               cov-configure -co /usr/bin/g++-$(GCC_VERSION) --comptype gcc -- -fPIC -std=c++11; \
+               cov-configure -co /usr/bin/gcc-$(GCC_VERSION) --comptype gcc -- -fPIC; \
+               cov-configure -co /usr/bin/g++-$(GCC_VERSION) --comptype gcc -- -fPIC -std=c++11 -fno-exceptions; \
+               cov-configure -co /usr/bin/g++-$(GCC_VERSION) --comptype gcc --template \
+                       --xml-option append_arg:"--ppp_translator" \
+                       --xml-option append_arg:"replace/llvm::AlignOf<PrevTy>::Alignment/(llvm::AlignOf<PrevTy>::Alignment)" \
+                       --xml-option append_arg:"--ppp_translator" \
+                       --xml-option append_arg:"replace/llvm::AlignOf<NextTy>::Alignment/(llvm::AlignOf<NextTy>::Alignment)"; \
+               cov-configure --compiler c++ --comptype g++ --template \
+                       --xml-option append_arg:"--ppp_translator" \
+                       --xml-option append_arg:"replace/llvm::AlignOf<PrevTy>::Alignment/(llvm::AlignOf<PrevTy>::Alignment)" \
+                       --xml-option append_arg:"--ppp_translator" \
+                       --xml-option append_arg:"replace/llvm::AlignOf<NextTy>::Alignment/(llvm::AlignOf<NextTy>::Alignment)"; \
+       fi)
+
+       # Due to bug upstream, no symlink here
+       rm -fr tools/clang/tools/extra
+       cp -R -H clang-tools-extra tools/clang/tools/extra
+
+       echo "Running tests: $(RUN_TEST)"
+
+       # if cmake is installed in /tmp/cmake/ uses it
+       # Used to build llvm on old ubuntu (precise) on the llvm.org/apt/ ci
+       CMAKE_BIN=cmake; \
+       if test -f /tmp/cmake/bin/cmake; then \
+               CMAKE_BIN=/tmp/cmake/bin/cmake; \
+       fi; \
+       echo "Using cmake: $$CMAKE_BIN"; \
+       cd $(TARGET_BUILD) && \
+       $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \
+       -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \
+       -DCMAKE_VERBOSE_MAKEFILE=ON \
+       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+       -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(opt_flags)" \
+       -DBOOTSTRAP_CMAKE_CXX_FLAGS='$(BOOTSTRAP_CXXFLAGS_EXTRA)' \
+       -DBOOTSTRAP_CMAKE_C_FLAGS='$(BOOTSTRAP_CFLAGS_EXTRA)' \
+       -DLLVM_LINK_LLVM_DYLIB=ON \
+       -DLLVM_INSTALL_UTILS=ON \
+       -DLLVM_VERSION_SUFFIX= \
+       -DLLVM_ENABLE_SPHINX=ON \
+       -DSPHINX_WARNINGS_AS_ERRORS=OFF \
+       -DLLVM_BUILD_LLVM_DYLIB=ON \
+       -DLLVM_ENABLE_RTTI=ON \
+       -DLLVM_ENABLE_FFI=ON \
+       $(CMAKE_EXTRA) \
+       -DLIBCLANG_LIBRARY_VERSION=$(SONAME_EXT) \
+       -DENABLE_LINKER_BUILD_ID=ON \
+       -DPOLLY_BUNDLED_JSONCPP=OFF \
+       -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="WebAssembly;AVR" \
+       -DCLANG_ENABLE_BOOTSTRAP=ON \
+       -DCLANG_VENDOR=$(VENDOR) \
+       -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_INSTALL_PREFIX;CMAKE_VERBOSE_MAKEFILE;CMAKE_BUILD_TYPE;CMAKE_CXX_FLAGS_RELWITHDEBINFO;LLVM_LINK_LLVM_DYLIB;LLVM_INSTALL_UTILS;LLVM_VERSION_SUFFIX;LLVM_ENABLE_SPHINX;SPHINX_WARNINGS_AS_ERRORS;LLVM_BUILD_LLVM_DYLIB;LLVM_ENABLE_RTTI;LLVM_ENABLE_FFI;LIBCLANG_LIBRARY_VERSION;ENABLE_LINKER_BUILD_ID;POLLY_BUNDLED_JSONCPP;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;LLVM_USE_PERF;LLVM_ENABLE_ASSERTIONS;LLVM_BINUTILS_INCDIR;LLVM_HOST_TRIPLE;;LLVM_COMPILER_CHECKED;COMPILER_RT_BUILD_BUILTINS;LIBOMP_LIBFLAGS;CMAKE_SHARED_LINKER_FLAGS"
+
+
+# make
+VERBOSE=VERBOSE=1
+# ninja
+#VERBOSE=-v
+
+debian-full-build:
+       $(PRE_PROCESS) make $(NJOBS) -C $(TARGET_BUILD) $(VERBOSE) CFLAGS="$(CFLAGS_EXTRA)" CXXFLAGS="$(CXXFLAGS_EXTRA)"  LDFLAGS="$(LDFLAGS_EXTRA)" REQUIRES_RTTI=1 DEBUGMAKE=1 $(BUILD_METHOD)
+
+# Check the stage 2 build worked
+       if test "$(BUILD_METHOD)" = "stage2"; then \
+       if ! readelf --string-dump .comment  $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \
+               echo "clang hasn't been built using clang. Bye bye. Check that the stage2 build has been done."; \
+       fi; \
+       fi
+
+       touch $@
+
+debian-libfuzzer-build:
+ifeq (${LIBFUZZER_ENABLE},yes)
+       cd $(TARGET_BUILD) \
+       CFLAGS=`dpkg-buildflags --get CFLAGS`; \
+       CFLAGS="$$CFLAGS `dpkg-buildflags --get CPPFLAGS`"; \
+       echo $$CFLAGS; \
+       $(BASE_PATH)/$(TARGET_BUILD_STAGE2)/bin/clang++ -c $$CFLAGS -std=c++11 $(BASE_PATH)/compiler-rt/lib/fuzzer/*.cpp -IFuzzer; \
+       ar ruv libFuzzer.a Fuzzer*.o
+endif
+       touch $@
+
+
+LIBCXX_CMAKE_OPTIONS := \
+       -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \
+       -DLLVM_CONFIG_PATH=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/llvm-config \
+       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+       -DCMAKE_CXX_COMPILER=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/clang++ \
+       -DCMAKE_C_COMPILER=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/clang \
+       -DCMAKE_CXX_FLAGS="$(LIBCXXFLAGS)" \
+       -DCMAKE_EXE_LINKER_FLAGS="" \
+       -DCMAKE_SHARED_LINKER_FLAGS="" \
+       -DCMAKE_MODULE_LINKER_FLAGS="" \
+       -DCMAKE_AR=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/llvm-ar \
+       -DCMAKE_RANLIB=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/llvm-ranlib \
+       -DLLVM_EXTERNAL_LIT=$(BASE_PATH)/utils/lit/lit.py \
+       $(CMAKE_EXTRA) \
+       $(CMAKE_EXTRA_LIBCXX)
+
+debian-libcxx-build:
+# Builds libcxx
+
+       mkdir -p libcxx/build
+       mkdir -p libcxxabi/build
+
+       CMAKE_BIN=cmake; \
+       if test -f /tmp/cmake/bin/cmake; then \
+               CMAKE_BIN=/tmp/cmake/bin/cmake; \
+       fi; \
+       echo "Using cmake: $$CMAKE_BIN"; \
+       cd libcxxabi/build && \
+       $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \
+       $(LIBCXX_CMAKE_OPTIONS) \
+       -DLIBCXXABI_LIBCXX_PATH=$(BASE_PATH)/libcxx \
+       -DLIBCXXABI_LIBCXX_LIBRARY_PATH=$(BASE_PATH)/libcxx/build/lib \
+       -DLIBCXXABI_LIBCXX_INCLUDES=$(BASE_PATH)/libcxx/include \
+       -DLIBCXXABI_ENABLE_EXCEPTIONS=$(LIBCXX_EXCEPTIONS) \
+       -DLLVM_ENABLE_RTTI=ON && \
+       $(PRE_PROCESS_CONF) make $(NJOBS) $(VERBOSE) CXXFLAGS="$(CXXFLAGS_EXTRA)" LDFLAGS="$(LDFLAGS_EXTRA)"
+       touch $@
+
+debian-libcxxabi-build:
+# Builds libcxxabi
+
+       mkdir -p libcxxabi/build
+
+       CMAKE_BIN=cmake; \
+       if test -f /tmp/cmake/bin/cmake; then \
+               CMAKE_BIN=/tmp/cmake/bin/cmake; \
+       fi; \
+       echo "Using cmake: $$CMAKE_BIN"; \
+       cd libcxx/build && \
+       $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \
+       $(LIBCXX_CMAKE_OPTIONS) \
+       -DLIBCXX_CXX_ABI=libcxxabi \
+       -DLIBCXX_CXX_ABI_INCLUDE_PATHS=$(BASE_PATH)/libcxxabi/include \
+       -DLIBCXX_CXX_ABI_LIBRARY_PATH=$(BASE_PATH)/libcxxabi/build/lib \
+       -DLIBCXX_ENABLE_EXCEPTIONS=$(LIBCXX_EXCEPTIONS) \
+       -DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON && \
+       $(PRE_PROCESS_CONF) make $(NJOBS) $(VERBOSE) CXXFLAGS="$(CXXFLAGS_EXTRA)" LDFLAGS="$(LDFLAGS_EXTRA)"
+       touch $@
+
+override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libcxx-build debian-libcxxabi-build
+
+override_dh_prep: build_doc
+       dh_prep
+
+build_doc:
+       cd $(CURDIR)/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man
+       cd $(CURDIR)/clang/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man
+       -(if test "$(OCAML_ENABLE)" = yes; then \
+       make $(NJOBS) -C "$(TARGET_BUILD_STAGE2)/docs" ocaml_doc; \
+       fi)
+
+# Continue if failing, Ubuntu precise cannot generate manpages as sphinx is too old
+       -(cd $(TARGET_BUILD) && make $(NJOBS) docs-llvm-html docs-clang-html docs-clang-tools-html docs-polly-html docs-polly-man docs-clang-tools-man docs-clang-man docs-llvm-man)
+
+# Rename manpages
+       d=$(CURDIR)/docs/_build/man/; \
+       if test -d $$d; then \
+               cd $$d; \
+               for f in *.1; do \
+                       echo "$$f"|grep $(LLVM_VERSION) || mv $$f `echo $$f|sed "s|\.1|-$(LLVM_VERSION).1|"`; \
+               done; \
+       else \
+               echo "could not find $$d"; \
+       fi
+# the clang doc generation only generates clang manpage
+# When it will do more, we should move that in the loop above
+       cd $(CURDIR)/clang/docs/_build/man/; mv clang.1 clang-$(LLVM_VERSION).1
+
+# Remove the copy of jquery. See bug #701087
+       for d in $(TARGET_BUILD)/docs/html/_static/ $(TARGET_BUILD)/tools/clang/docs/html/_static/ $(TARGET_BUILD)/tools/clang/tools/extra/docs/html/_static/; do \
+               cd $$d && rm -f jquery.js && ln -s /usr/share/javascript/jquery/jquery.js && cd -; \
+               cd $$d && rm -f underscore.js && ln -s /usr/share/javascript/underscore/underscore.js && cd -; \
+       done
+
+       mkdir -p debian/man/
+       help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/scan-view/bin/scan-view > debian/man/scan-view-$(LLVM_VERSION).1
+       help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/clang-format/clang-format-diff.py > debian/man/clang-format-diff-$(LLVM_VERSION).1
+
+       CMDS="llvm-dwarfdump llvm-mc llvm-mcmarkup llvm-objdump llvm-rtdyld llvm-size llvm-ranlib lldb lldb-mi clang-format clang clang++ clang-tblgen clang-check clang-cpp clang-import-test clang-tidy clang-apply-replacements clang-rename clang-query pp-trace sancov lli modularize clang-include-fixer find-all-symbols clang-reorder-fields ld.lld llvm-tblgen clang-change-namespace clang-offload-bundler"; \
+       for f in $$CMDS; do \
+               echo "Generating manpage of $$f"; \
+               LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1; \
+       done
+       if test "$(OPENMP_ENABLE)" = yes; then \
+               cd openmp/runtime && doxygen doc/doxygen/config; cd -; \
+               cd openmp/runtime/doc/doxygen/generated/html/ && rm jquery.js && ln -s /usr/share/javascript/jquery/jquery.js; \
+       fi
+
+override_dh_auto_install:
+       # Clean up temporary files to make sure the install works
+       rm -rf $(find $(TARGET_BUILD) -wholename '*CMakeFiles*' -not -name CMakeLists.txt -a -name "*.dir" -type d)
+       # install/fast enables a make install without recompiling temporary files
+       if test "$(BUILD_METHOD)" = "stage2"; then \
+               $(MAKE) -C $(TARGET_BUILD) $(VERBOSE) stage2-install DESTDIR=$(DEB_INST)/; \
+       else \
+               $(MAKE) -C $(TARGET_BUILD) $(VERBOSE) install DESTDIR=$(DEB_INST)/; \
+       fi
+       # Not used on Linux.
+       rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/argdumper
+       rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/share/clang/clang-format-bbedit.applescript
+       # Remove bat files https://bugs.llvm.org/show_bug.cgi?id=30755
+       rm -f $(DEB_INST)/usr/share/clang/scan-build-$(LLVM_VERSION)/libexec/*.bat $(DEB_INST)/usr/share/clang/scan-build-$(LLVM_VERSION)/bin/*.bat
+
+       cp $(TARGET_BUILD_STAGE2)/bin/clang-query $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin
+
+       # Only run on executable, not script
+       chrpath -d `find $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable -exec file -i '{}' \; | grep 'x-executable; charset=binary'|cut -d: -f1`
+       chrpath -d libcxxabi/build/lib/libc++abi.so.1.0
+       chrpath -d libcxx/build/lib/libc++.so.1.0
+
+       cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/ && rm -f libclang.so.$(SONAME_EXT) libclang-$(LLVM_VERSION).so; \
+       ln -s libclang-$(LLVM_VERSION).so.$(SONAME_EXT) libclang.so.$(SONAME_EXT)
+
+       cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && rm -f libomp.so; \
+       ln -s libomp.so.$(SONAME_OPENMP) libomp.so
+
+       if test "$(OPENMP_ENABLE)" = yes; then \
+               mkdir -p debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \
+               cp -f openmp/runtime/exports/common*/include/* debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \
+               cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && cp libomp.so.$(SONAME_OPENMP) libomp-$(LLVM_VERSION).so.$(SONAME_OPENMP); \
+       fi
+
+# Remove artifact (where compiler-rt is built)
+#      if test -d $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux; then \
+#      cd $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux && rm -rf $$(find . -mindepth 2 -maxdepth 2 -type d) && rm -rf $$(find -empty) && rm -rf */.dir; \
+#      fi
+
+       mkdir -p $(CURDIR)/debian/clang-$(LLVM_VERSION)/usr/bin/
+       cp compiler-rt/lib/asan/scripts/asan_symbolize.py $(CURDIR)/debian/clang-$(LLVM_VERSION)/usr/bin/asan_symbolize-$(LLVM_VERSION)
+
+ifeq (${LIBFUZZER_ENABLE},yes)
+       mkdir -p $(CURDIR)/debian/libfuzzer-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/
+       cp -v $(TARGET_BUILD)/libFuzzer.a $(CURDIR)/debian/libfuzzer-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/
+endif
+
+# Create this fake directory to make the install libclang-common-dev happy
+# under the unsupported archs of compiler-rt
+       mkdir -p $(DEB_INST)/usr/lib/clang/$(LLVM_VERSION)/lib
+       mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/lib/
+       mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)/lib/clang_linux/
+       mkdir -p $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux/
+       mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/share/
+# On some archs, the sanatizers are not built. As we explicitly includes some txt files, create
+# a fake txt to make sure it doesn't fail
+       echo "The *.txt files, if available, contain helper to override some of the errors messages." > $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/README.txt
+       echo "Please visit https://github.com/google/sanitizers/wiki/AddressSanitizer for help" >> $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/README.txt
+# Path changed. Make a copy of it
+       cp $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/README.txt $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/share/README.txt
+
+# idem for the lldb python binding
+       mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/python2.7/site-packages/lldb/
+
+# Remove things that CMake  install but which aren't packaged yet,
+# or are packaged from the source or build tree.
+       mv $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/clang-$(LLVM_VERSION) \
+          $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/clang
+
+# Don't think it is used
+       rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/libPolly*a
+# Probably useless
+       rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/python2.7/site-packages/six.py
+
+       $(MAKE) -C libcxxabi/build install DESTDIR=$(DEB_INST)
+       $(MAKE) -C libcxx/build install DESTDIR=$(DEB_INST)
+
+# Rename binaries
+       mkdir -p $(DEB_INST)/usr/bin/
+       cd $(DEB_INST)/usr/bin/; \
+       rm -f *; \
+       for f in ../lib/llvm-$(LLVM_VERSION)/bin/*; do \
+               ln -s $$f `basename $$f`-$(LLVM_VERSION); \
+               echo "Link $$f to `basename $$f`-$(LLVM_VERSION)"; \
+       done
+
+# Rename some stuff with the version name
+       cp $(CURDIR)/clang/tools/scan-build/man/scan-build.1 $(CURDIR)/clang/tools/scan-build/man/scan-build-$(LLVM_VERSION).1
+
+       # copy the vim files (except that tablegen does not exist for indent
+       VIM_DIRS="ftdetect ftplugin syntax indent"; \
+       for dir in $$VIM_DIRS; do \
+               cp -f $(CURDIR)/utils/vim/$$dir/llvm.vim $(CURDIR)/utils/vim/$$dir/llvm-$(LLVM_VERSION).vim; \
+               if test -f $(CURDIR)/utils/vim/$$dir/tablegen.vim; then \
+                       cp -f $(CURDIR)/utils/vim/$$dir/tablegen.vim $(CURDIR)/utils/vim/$$dir/tablegen-$(LLVM_VERSION).vim; \
+               fi; \
+       done
+       cp -f $(CURDIR)/utils/vim/vimrc $(CURDIR)/utils/vim/llvm-$(LLVM_VERSION)-vimrc
+
+       cp -f $(CURDIR)/clang/tools/clang-format/clang-format-diff.py $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION)
+
+       cp -f $(CURDIR)/clang/tools/clang-format/clang-format.py clang/tools/clang-format/clang-format-$(LLVM_VERSION).py
+
+       rm -rf clang/tools/scan-build-$(LLVM_VERSION)
+       cp -fR $(CURDIR)/clang/tools/scan-build clang/tools/scan-build-$(LLVM_VERSION)
+
+       rm -rf clang/tools/scan-build-py-$(LLVM_VERSION)
+       cp -fR $(CURDIR)/clang/tools/scan-build-py clang/tools/scan-build-py-$(LLVM_VERSION)
+       chmod +x clang/tools/scan-build-py-$(LLVM_VERSION)/bin/*
+
+       rm -rf clang/tools/scan-view-$(LLVM_VERSION)
+       cp -fR $(CURDIR)/clang/tools/scan-view clang/tools/scan-view-$(LLVM_VERSION)
+
+# Remove some license files
+       rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/include/llvm/Support/LICENSE.TXT
+
+# Disable CMake's package validation checks for target files that we may remove.
+       sed -i '/_IMPORT_CHECK_TARGETS \(Polly\|sancov\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake
+
+# Disable CMake's package validation checks for binaries that may not be installed
+       sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake
+
+# Managed in python-lldb-X.Y.links.in
+       rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/python*/site-packages/lldb/_lldb.so
+
+# Manage the polly files. Sometimes, we build them. Sometimes not.
+       if test "$(POLLY_ENABLE)" = yes; then \
+               mkdir -p $(CURDIR)/debian/libclang-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/ $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/polly/; \
+               mv -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/libpolly* \
+               $(CURDIR)/debian/libclang-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/; \
+               rm -rf $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/polly; \
+               mv -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/include/polly/ \
+               $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/; \
+       fi
+
+       mkdir -p $(CURDIR)/debian/usr/share/doc/llvm-$(LLVM_VERSION)-doc/ $(CURDIR)/debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/
+       cp -R $(TARGET_BUILD)/docs/html $(CURDIR)/debian/usr/share/doc/llvm-$(LLVM_VERSION)-doc/
+       cp -R $(TARGET_BUILD)/tools/clang/docs/html $(CURDIR)/debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/
+       cp -R $(TARGET_BUILD)/tools/clang/tools/extra/docs/html $(CURDIR)/debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/clang-extra
+
+# Rename OCaml bindings
+       if test "$(OCAML_ENABLE)" = yes; then \
+               mkdir -p "$(DEB_INST)$(OCAML_STDLIB_DIR)"; \
+               mkdir -p "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/docs/ocaml/html/html"; \
+               mkdir -p "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/share/doc/llvm/ocaml-html/"; \
+               if test -d "$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ocaml"; then \
+                       mv -f "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/lib/ocaml" \
+                       "$(DEB_INST)$(OCAML_STDLIB_DIR)/llvm-$(LLVM_VERSION)"; \
+               fi; \
+       fi
+
+# Delete the target build directory to save some space on the build systems
+# All the files have been installed in $(CURDIR)/debian/tmp/ already
+       rm -rf $(TARGET_BUILD)
+
+
+override_dh_makeshlibs:
+       dh_makeshlibs -plibclang$(SONAME_EXT)-$(LLVM_VERSION) -V"libclang$(SONAME_EXT)-$(LLVM_VERSION) (>= 1:7~svn298832-1~)" -- -c4
+       dh_makeshlibs -pliblldb-$(LLVM_VERSION) -V"liblldb-$(LLVM_VERSION) (>= 1:7~svn298832-1~)"
+       dh_makeshlibs -plibllvm$(LLVM_VERSION) -V"libllvm$(LLVM_VERSION) (>= 1:7~svn298832-1~)"
+       dh_makeshlibs -plibomp$(SONAME_OPENMP)-$(LLVM_VERSION) -V"libomp$(SONAME_OPENMP)-$(LLVM_VERSION)) (>= 1:7~svn298832-1~)"
+       dh_makeshlibs --remaining-packages
+
+override_dh_shlibdeps:
+# Ignore asan libraries. They would trigger dependencies to multiarch libraries
+       dh_shlibdeps -l$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ -Xlibclang_rt.asan -Xlibclang_rt.asan -Xlibclang_rt.asan-*.so -Xlibclang_rt.asan-*.so
+
+override_dh_installman:
+       if test -f lld/docs/ld.lld.1; then \
+       mv lld/docs/ld.lld.1 lld/docs/ld.lld-$(LLVM_VERSION).1; \
+       fi
+       dh_installman
+# Make sure that lli manpage is only in llvm-3.2-runtime (See #697117)
+       rm -f $(CURDIR)/debian/llvm-$(LLVM_VERSION)/usr/share/man/man1/lli*
+
+
+override_dh_strip:
+       : # running out of diskspace on the buildds
+       find $(TARGET_BUILD) -name '*.o' -o -name '*.a' -type f | xargs -r rm -f
+ifeq (0, $(strip $(shell dpkg --compare-versions $(DH_VERSION) ge 9.20160114; echo $$?)))
+       : # If we don't have the right version of debhelper, don't run the option
+       dh_strip -p libclang$(SONAME_EXT)-$(LLVM_VERSION) --dbgsym-migration='libclang$(SONAME_EXT)-$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
+       dh_strip -p libllvm$(LLVM_VERSION) --dbgsym-migration='libllvm$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
+       dh_strip -p liblldb-$(LLVM_VERSION) --dbgsym-migration='liblldb-$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
+       dh_strip -p libomp$(SONAME_OPENMP)-$(LLVM_VERSION) --dbgsym-migration='libomp$(SONAME_OPENMP)-$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
+endif
+# ifeq (${LLD_ENABLE},yes)
+#      PATH=$(CURDIR)/:$$PATH dh_strip -p liblld-$(LLVM_VERSION) --dbg-package=liblld-$(LLVM_VERSION)-dbg
+# endif
+ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) lt 2.31.1-11 ; echo $$?),0)
+       : # building with clang, binutils/strip has hard time stripping some libs because of
+       : # https://sourceware.org/bugzilla/show_bug.cgi?id=23788
+       : # use llvm-strip instead
+       : # Workaround some issues with stripping by using llvm's
+       if test ! -f $(CURDIR)/strip; then \
+               ln -s $(CURDIR)/debian/llvm-$(LLVM_VERSION)/usr/lib/llvm-$(LLVM_VERSION)/bin/llvm-strip $(CURDIR)/strip; \
+       fi
+       ls -al $(CURDIR)/debian/.debhelper/*/dbgsym-root/usr/lib/debug/.build-id/*/*|| true
+       : # On some old version of Debian (stretch) and Ubuntu, Rules-Requires-Root isn't supported
+       : # Sometime, it fails because of chown: changing ownership of 'debian/.debhelper/clang-7/dbgsym-root/usr/lib/debug/.build-id/37/ba506ae9d2f82219bf5c552f7c09853052b2b0.debug': Operation not permitted
+       : # Therefor, continue when we encounter an error
+       PATH=$(CURDIR)/:$$PATH LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot dh_strip -a -v || true
+       : # Remove the workaround
+       rm $(CURDIR)/strip
+       : # for some reasons, the +x might be removed
+       chmod -f +x $(CURDIR)/debian/*/usr/lib/llvm-$(LLVM_VERSION)/bin/* || true
+else
+       dh_strip -a -v
+endif
+
+override_dh_install:
+#      cp $(TARGET_BUILD)/lib/libLLVM-$(LLVM_VERSION).so $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/libLLVM-$(LLVM_VERSION).so.$(SONAME_EXT)
+ifeq (${POLLY_ENABLE},yes)
+# only for arch:any builds
+ifneq (,$(filter libclang-common-$(LLVM_VERSION)-dev, $(shell dh_listpackages)))
+       dh_install -p libclang-common-$(LLVM_VERSION)-dev usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly
+# On old Debian & Ubuntu, removing the files is necessary
+       rm -rf debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake
+else
+       rm -rf $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake
+endif
+endif
+       dh_install --fail-missing
+
+override_dh_installdeb:
+# Managed by the package
+       dh_installdeb -a
+
+       rm -f $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/python*/site-packages/lldb/__init__.pyc $(CURDIR)/debian/python-lldb-$(LLVM_VERSION)/usr/lib/llvm-$(LLVM_VERSION)/lib/python*/site-packages/lldb/__init__.pyc
+       rm -f $(CURDIR)/debian/clang-$(LLVM_VERSION)-examples/usr/share/doc/clang-$(LLVM_VERSION)-examples/examples/*Make*
+
+# Remove auto generated python pyc
+       find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f
+
+ifeq (${RUN_TEST},yes)
+# List of the archs we know we have 100 % tests working
+ARCH_LLVM_TEST_OK := i386 amd64
+
+override_dh_auto_test:
+
+# LLVM tests
+ifneq (,$(findstring $(DEB_HOST_ARCH),$(ARCH_LLVM_TEST_OK)))
+# logs the output to check-llvm_build_log.txt for validation through autopkgtest
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD) stage2-check-llvm | tee check-llvm_build_log.txt
+else
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD) stage2-check-llvm || true
+endif
+
+# Clang tests
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD) stage2-check-clang || true
+
+# Clang extra tests (ex: clang-tidy)
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD_STAGE2) check-clang-tools || true
+
+# LLD tests
+ifeq (${LLD_ENABLE},yes)
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD_STAGE2) check-lld || true
+endif
+
+# Sanitizer
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD_STAGE2) check-sanitizer || true
+
+# Libcxx
+       $(MAKE) $(NJOBS) -C libcxx/build check-libcxx || true
+
+# Libcxxabi
+       $(MAKE) $(MAKE) -C libcxxabi/build check-libcxxabi || true
+
+# LLDB tests
+ifeq (,$(filter $(DEB_HOST_ARCH), $(LLDB_DISABLE_ARCHS) armhf armel))
+ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS)))
+# Create a symlink to run the testsuite: see https://bugs.archlinux.org/task/50759
+       cd $(CURDIR)/$(TARGET_BUILD)/lib/python*/site-packages/; \
+               if test ! -e _lldb.so; then \
+                       ln -s lldb/_lldb.so; \
+               fi
+       LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ $(MAKE) $(NJOBS) -C $(TARGET_BUILD) check-lldb || true
+       # remove the workaround
+       rm $(CURDIR)/$(TARGET_BUILD)/lib/python*/site-packages/_lldb.so
+endif
+endif
+
+# Polly tests
+ifeq (${POLLY_ENABLE},yes)
+       $(MAKE) $(NJOBS) -C $(TARGET_BUILD) check-polly || true
+endif
+
+# Managed by debian build system
+       rm -f $(CURDIR)/$(TARGET_BUILD)/lib/python*/site-packages/lldb/_lldb.so
+
+# polly tests
+       if test "$(POLLY_ENABLE)" = yes; then \
+               cd $(TARGET_BUILD)/ && LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ $(MAKE) -C tools/polly/test/ check-polly || true; \
+       fi
+
+# The compression of the code coverage report is done in the
+# hook B21GetCoverageResults on the server
+       if test "$(CODECOVERAGE)" = "yes"; then \
+               REPORT=reports/llvm-toolchain.info; \
+               mkdir -p reports/; \
+               lcov --directory $(TARGET_BUILD)/ --capture --ignore-errors source --output-file $$REPORT; \
+               lcov --remove $$REPORT "/usr*" -o $$REPORT; \
+               genhtml -o reports/coverage --show-details --highlight --legend $$REPORT; \
+       fi
+override_dh_auto_test:
+endif
+
+
+override_dh_gencontrol:
+       dh_gencontrol -- $(control_vars)
+
+
+override_dh_auto_clean:
+       rm -rf $(TARGET_BUILD) tools/clang/include/clang/Debian/debian_path.h docs/_build/ clang/docs/_build tools/clang/docs/_html/
+# QA tools
+       rm -rf cov-int/ reports/
+       rm -f `ls debian/*.in|sed -e "s|.in$$||g"`
+       find utils -name '*.pyc' | xargs -r rm -f
+       # Use -I because a test has a space in its name
+       find lldb/test -iname '*.pyc' | xargs -I{} -r rm -f {}
+       find test -name '*.pyc' -o -name '*.cm[ix]' | xargs -r rm -f
+       find test/Bindings -name '*.o' | xargs -r rm -f
+       rm -f tools/clang tools/polly tools/lld tools/lldb projects/compiler-rt
+       rm -rf tools/clang/tools/extra clang/tools/extra/
+       rm -f $(CURDIR)/utils/vim/llvm-$(LLVM_VERSION).vim $(CURDIR)/utils/vim/tablegen-$(LLVM_VERSION).vim
+       rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION)
+       rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py
+       rm -rf libcxx/build libcxxabi/build
+       if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \
+               mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \
+       fi
+
+.PHONY: override_dh_strip preconfigure debian-full-build debian-libfuzzer-build debian-libcxx-build debian-libcxxabi-build
diff --git a/source.lintian-overrides b/source.lintian-overrides
new file mode 100644 (file)
index 0000000..feed5ff
--- /dev/null
@@ -0,0 +1,10 @@
+# Removed by patch remove-dbtree.diff
+source: source-is-missing clang/www/analyzer/scripts/dbtree.js
+# No longer used (we are using cmake now)
+source: outdated-autotools-helper-file autoconf/config.guess 2011-08-20
+source: outdated-autotools-helper-file autoconf/config.sub 2011-11-02
+# Reported here https://bugs.llvm.org/show_bug.cgi?id=32962
+# No activity, silent it to avoid false positive in automation
+source: license-problem-convert-utf-code lib/Support/ConvertUTF.cpp
+# A unit test. No big deal
+source: source-is-missing lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
diff --git a/source/format b/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/tests/control b/tests/control
new file mode 100644 (file)
index 0000000..5f3e102
--- /dev/null
@@ -0,0 +1,6 @@
+Test-Command: bash -v ./debian/qualify-clang.sh
+Depends: @, cmake, g++, file, dpkg-dev
+# Comment the dbgsym package because of bug #917528
+# dbgsym packages not being available in testing
+# clang-7-dbgsym, libclang1-7-dbgsym
+Restrictions: allow-stderr
diff --git a/unpack.sh b/unpack.sh
new file mode 100644 (file)
index 0000000..177b4a1
--- /dev/null
+++ b/unpack.sh
@@ -0,0 +1,27 @@
+set -e
+ORIG_VERSION=7
+MAJOR_VERSION=7.0.1
+SVN_REV=`ls -1 *-${ORIG_VERSION}*svn*bz2 | tail -1|perl -ne 'print "$1\n" if /svn(\d+)/;' | sort -ru`
+#SVN_REV=353565
+VERSION=svn$SVN_REV
+#VERSION=+rc3
+LLVM_ARCHIVE=llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig.tar.bz2
+echo "unpack of $LLVM_ARCHIVE"
+tar jxf $LLVM_ARCHIVE
+cd llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION/ || ( echo "Bad SVN_REV:\"$SVN_REV\"" && exit 1 )
+for f in ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-clang.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-clang-tools-extra.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-compiler-rt.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-lldb.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-polly.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-libcxxabi.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-libcxx.tar.bz2 ../llvm-toolchain-${ORIG_VERSION}_$MAJOR_VERSION~$VERSION.orig-openmp.tar.bz2; do
+       echo "Unpack of $f"
+       tar jxf $f
+ done
+
+ln -s clang_$MAJOR_VERSION~$VERSION clang
+ln -s clang-tools-extra_$MAJOR_VERSION~$VERSION clang-tools-extra
+ln -s compiler-rt_$MAJOR_VERSION~$VERSION compiler-rt
+ln -s polly_$MAJOR_VERSION~$VERSION polly
+ln -s lldb_$MAJOR_VERSION~$VERSION lldb
+ln -s openmp_$MAJOR_VERSION~$VERSION openmp
+ln -s libcxx_$MAJOR_VERSION~$VERSION libcxx
+ln -s libcxxabi_$MAJOR_VERSION~$VERSION libcxxabi
+
+cp -R ../$ORIG_VERSION/debian .
+QUILT_PATCHES=debian/patches/ quilt push -a --fuzz=0
diff --git a/watch b/watch
new file mode 100644 (file)
index 0000000..c7e0704
--- /dev/null
+++ b/watch
@@ -0,0 +1,3 @@
+version=3
+http://llvm.org/releases/download.html .*/llvm-(.*).src.tar.xz
+