diff -Nru llvm-toolchain-11-11.0.1/clang/CMakeLists.txt llvm-toolchain-11-11.1.0/clang/CMakeLists.txt --- llvm-toolchain-11-11.0.1/clang/CMakeLists.txt 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/clang/CMakeLists.txt 2021-06-23 16:15:53.000000000 +0000 @@ -509,7 +509,7 @@ "${CLANG_VERSION_MAJOR}" CACHE STRING "Major version number that will be appended to the clang executable name") set(LIBCLANG_LIBRARY_VERSION - "${CLANG_VERSION_MAJOR}" CACHE STRING + "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING "Major version number that will be appended to the libclang library") mark_as_advanced(CLANG_EXECUTABLE_VERSION LIBCLANG_LIBRARY_VERSION) diff -Nru llvm-toolchain-11-11.0.1/clang/include/clang-c/Index.h llvm-toolchain-11-11.1.0/clang/include/clang-c/Index.h --- llvm-toolchain-11-11.0.1/clang/include/clang-c/Index.h 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/clang/include/clang-c/Index.h 2021-06-23 16:15:53.000000000 +0000 @@ -33,7 +33,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 60 +#define CINDEX_VERSION_MINOR 61 #define CINDEX_VERSION_ENCODE(major, minor) (((major)*10000) + ((minor)*1)) @@ -2052,62 +2052,58 @@ */ CXCursor_CXXFunctionalCastExpr = 128, - /** OpenCL's addrspace_cast<> expression. - */ - CXCursor_CXXAddrspaceCastExpr = 129, - /** A C++ typeid expression (C++ [expr.typeid]). */ - CXCursor_CXXTypeidExpr = 130, + CXCursor_CXXTypeidExpr = 129, /** [C++ 2.13.5] C++ Boolean Literal. */ - CXCursor_CXXBoolLiteralExpr = 131, + CXCursor_CXXBoolLiteralExpr = 130, /** [C++0x 2.14.7] C++ Pointer Literal. */ - CXCursor_CXXNullPtrLiteralExpr = 132, + CXCursor_CXXNullPtrLiteralExpr = 131, /** Represents the "this" expression in C++ */ - CXCursor_CXXThisExpr = 133, + CXCursor_CXXThisExpr = 132, /** [C++ 15] C++ Throw Expression. * * This handles 'throw' and 'throw' assignment-expression. When * assignment-expression isn't present, Op will be null. */ - CXCursor_CXXThrowExpr = 134, + CXCursor_CXXThrowExpr = 133, /** A new expression for memory allocation and constructor calls, e.g: * "new CXXNewExpr(foo)". */ - CXCursor_CXXNewExpr = 135, + CXCursor_CXXNewExpr = 134, /** A delete expression for memory deallocation and destructor calls, * e.g. "delete[] pArray". */ - CXCursor_CXXDeleteExpr = 136, + CXCursor_CXXDeleteExpr = 135, /** A unary expression. (noexcept, sizeof, or other traits) */ - CXCursor_UnaryExpr = 137, + CXCursor_UnaryExpr = 136, /** An Objective-C string literal i.e. @"foo". */ - CXCursor_ObjCStringLiteral = 138, + CXCursor_ObjCStringLiteral = 137, /** An Objective-C \@encode expression. */ - CXCursor_ObjCEncodeExpr = 139, + CXCursor_ObjCEncodeExpr = 138, /** An Objective-C \@selector expression. */ - CXCursor_ObjCSelectorExpr = 140, + CXCursor_ObjCSelectorExpr = 139, /** An Objective-C \@protocol expression. */ - CXCursor_ObjCProtocolExpr = 141, + CXCursor_ObjCProtocolExpr = 140, /** An Objective-C "bridged" cast expression, which casts between * Objective-C pointers and C pointers, transferring ownership in the process. @@ -2116,7 +2112,7 @@ * NSString *str = (__bridge_transfer NSString *)CFCreateString(); * \endcode */ - CXCursor_ObjCBridgedCastExpr = 142, + CXCursor_ObjCBridgedCastExpr = 141, /** Represents a C++0x pack expansion that produces a sequence of * expressions. @@ -2131,7 +2127,7 @@ * } * \endcode */ - CXCursor_PackExpansionExpr = 143, + CXCursor_PackExpansionExpr = 142, /** Represents an expression that computes the length of a parameter * pack. @@ -2143,7 +2139,7 @@ * }; * \endcode */ - CXCursor_SizeOfPackExpr = 144, + CXCursor_SizeOfPackExpr = 143, /* Represents a C++ lambda expression that produces a local function * object. @@ -2157,39 +2153,43 @@ * } * \endcode */ - CXCursor_LambdaExpr = 145, + CXCursor_LambdaExpr = 144, /** Objective-c Boolean Literal. */ - CXCursor_ObjCBoolLiteralExpr = 146, + CXCursor_ObjCBoolLiteralExpr = 145, /** Represents the "self" expression in an Objective-C method. */ - CXCursor_ObjCSelfExpr = 147, + CXCursor_ObjCSelfExpr = 146, /** OpenMP 5.0 [2.1.5, Array Section]. */ - CXCursor_OMPArraySectionExpr = 148, + CXCursor_OMPArraySectionExpr = 147, /** Represents an @available(...) check. */ - CXCursor_ObjCAvailabilityCheckExpr = 149, + CXCursor_ObjCAvailabilityCheckExpr = 148, /** * Fixed point literal */ - CXCursor_FixedPointLiteral = 150, + CXCursor_FixedPointLiteral = 149, /** OpenMP 5.0 [2.1.4, Array Shaping]. */ - CXCursor_OMPArrayShapingExpr = 151, + CXCursor_OMPArrayShapingExpr = 150, /** * OpenMP 5.0 [2.1.6 Iterators] */ - CXCursor_OMPIteratorExpr = 152, + CXCursor_OMPIteratorExpr = 151, + + /** OpenCL's addrspace_cast<> expression. + */ + CXCursor_CXXAddrspaceCastExpr = 152, - CXCursor_LastExpr = CXCursor_OMPIteratorExpr, + CXCursor_LastExpr = CXCursor_CXXAddrspaceCastExpr, /* Statements */ CXCursor_FirstStmt = 200, diff -Nru llvm-toolchain-11-11.0.1/clang/tools/clang-shlib/CMakeLists.txt llvm-toolchain-11-11.1.0/clang/tools/clang-shlib/CMakeLists.txt --- llvm-toolchain-11-11.0.1/clang/tools/clang-shlib/CMakeLists.txt 2020-10-16 21:13:07.000000000 +0000 +++ llvm-toolchain-11-11.1.0/clang/tools/clang-shlib/CMakeLists.txt 2021-06-23 16:15:54.000000000 +0000 @@ -48,3 +48,8 @@ ${_OBJECTS} LINK_LIBS ${_DEPS}) + + set_target_properties(clang-cpp + PROPERTIES + VERSION ${LIBCLANG_LIBRARY_VERSION} + SOVERSION ${LIBCLANG_LIBRARY_VERSION}) diff -Nru llvm-toolchain-11-11.0.1/clang/tools/libclang/CMakeLists.txt llvm-toolchain-11-11.1.0/clang/tools/libclang/CMakeLists.txt --- llvm-toolchain-11-11.0.1/clang/tools/libclang/CMakeLists.txt 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/clang/tools/libclang/CMakeLists.txt 2021-06-23 16:15:54.000000000 +0000 @@ -150,6 +150,7 @@ else() set_target_properties(libclang PROPERTIES + SOVERSION ${LIBCLANG_LIBRARY_VERSION} VERSION ${LIBCLANG_LIBRARY_VERSION} DEFINE_SYMBOL _CINDEX_LIB_) # FIXME: _CINDEX_LIB_ affects dllexport/dllimport on Win32. diff -Nru llvm-toolchain-11-11.0.1/debian/changelog llvm-toolchain-11-11.1.0/debian/changelog --- llvm-toolchain-11-11.0.1/debian/changelog 2021-08-10 00:05:15.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/changelog 2022-01-27 21:21:16.000000000 +0000 @@ -1,40 +1,83 @@ -llvm-toolchain-11 (1:11.0.1-2ubuntu5) impish; urgency=medium +llvm-toolchain-11 (1:11.1.0-6) UNRELEASED; urgency=medium - * Fix FTBFS with Linux 5.13 and GCC 11. (LP: #1939424) - - d/p/libsanitizer-remove-cyclades.patch: Fix FTBFS with Linux 5.13, - where the Cyclades TTY code has been removed. For this reason, - libsanitizer's Cyclades support also needs to be removed. - - d/p/fix-missing-include-limit.patch: Fix FTBFS with GCC 11, which now - requires that be included if the source wants to use - std::numeric_limits. + * Do not fail on llvm-mt - -- Sergio Durigan Junior Mon, 09 Aug 2021 20:05:15 -0400 + -- Sylvestre Ledru Thu, 27 Jan 2022 22:21:16 +0100 -llvm-toolchain-11 (1:11.0.1-2ubuntu4) hirsute; urgency=medium +llvm-toolchain-11 (1:11.1.0-5) unstable; urgency=medium - * Fix permission of install file. + * relax the llvm-11-linker-tools dep for apt.llvm.org + * Fix some lintian warnings + * Remove the build conflict on ocaml (Closes: #1002607) - -- Matthias Klose Thu, 15 Apr 2021 11:22:23 +0200 + -- Sylvestre Ledru Mon, 11 Oct 2021 20:36:19 +0200 -llvm-toolchain-11 (1:11.0.1-2ubuntu3.1) hirsute; urgency=medium +llvm-toolchain-11 (1:11.1.0-4) unstable; urgency=medium - * Split out a llvm-11-linker-tools package, and let both clang-12 and - llvm-11 depend on it. - * Clean files generated from *.in files, and clean debian/{man,usr}. + * Force version to 11.1 in another qualify-clang.sh test. - -- Matthias Klose Wed, 14 Apr 2021 15:59:30 +0200 + -- Gianfranco Costamagna Tue, 28 Sep 2021 12:06:50 +0200 -llvm-toolchain-11 (1:11.0.1-2ubuntu2) hirsute; urgency=medium +llvm-toolchain-11 (1:11.1.0-3) unstable; urgency=medium - * Cherry-pick https://reviews.llvm.org/D99501 to allow -flto=auto + * Add two patches from ubuntu to fix lto and gcc-11 build failures + * Use minimum version for cmake-test + * Don't require libclang-11-dev on cmake-test + * Add new llvm-11-linker-tools (from Ubuntu) + * Merge new fixes from branch=9 + * clang-11: Drop Recommends: libomp-11-dev - -- Matthias Klose Wed, 07 Apr 2021 17:30:49 +0200 + -- Gianfranco Costamagna Mon, 27 Sep 2021 15:50:46 +0200 -llvm-toolchain-11 (1:11.0.1-2ubuntu1) hirsute; urgency=medium +llvm-toolchain-11 (1:11.1.0-2) unstable; urgency=medium - * Add optimize=-lto to DEB_BUILD_MAINT_OPTIONS. + * Ajust the cmake test to unbreak autopkgtest - -- Matthias Klose Mon, 22 Mar 2021 14:04:04 +0100 + -- Sylvestre Ledru Sun, 26 Sep 2021 22:02:43 +0200 + +llvm-toolchain-11 (1:11.1.0-1) unstable; urgency=medium + + [ Sylvestre Ledru ] + * Upload to unstable + * bump autopkgtest cmake version (Closes: #994501) + Thanks to Timo Röhling for the patch + + [ Gianfranco Costamagna ] + * Cherry-pick upstream commit to fix a libgl1-mesa-dri texture failure. + (Closes: #989545) + + -- Sylvestre Ledru Fri, 24 Sep 2021 12:54:55 +0200 + +llvm-toolchain-11 (1:11.1.0-1~exp2) experimental; urgency=medium + + * Fix the default binary path for scan-build-py to clang-11 (instead of + clang) - see scan-build-py-fix-default-bin.diff + tested by + https://github.com/opencollab/llvm-toolchain-integration-test-suite/ + + [ Krzysztof Aleksander Pyrkosz ] + * Add libxml2 as a dependency as it is necessary + for llvm manifest tool (llvm-mt) + (Closes: #990537) + - not really working for now + + -- Sylvestre Ledru Sat, 17 Jul 2021 20:13:57 +0200 + +llvm-toolchain-11 (1:11.1.0-1~exp1) experimental; urgency=medium + + * New upstream release + Should be mostly minor fixes + Was driven by https://bugs.llvm.org/show_bug.cgi?id=46526 + but as we are not impacted, I reverted the change in + debian/patches/revert-abi-change-clang.diff + * Also build lld on s390x + * Fix the path to analyze-{cc,c++} for scan-build-py with + --intercept-first (scan-build-py-fix-analyze-path.diff) + * Backport bug #47591 to fix a miscompilation in bpftrace + (Closes: #990220) + * Only enable libomp-11-doc on supported archs + + -- Sylvestre Ledru Mon, 01 Mar 2021 10:50:19 +0100 llvm-toolchain-11 (1:11.0.1-2) unstable; urgency=medium @@ -85,6 +128,41 @@ llvm-toolchain-11 (1:11.0.0-5) unstable; urgency=medium +llvm-toolchain-9 (1:9.0.1-19) unstable; urgency=medium + + * Add two patches from ubuntu to fix lto and gcc-11 build failures + + -- Gianfranco Costamagna Mon, 27 Sep 2021 15:39:19 +0200 + +llvm-toolchain-9 (1:9.0.1-18) unstable; urgency=medium + + [ Gianfranco Costamagna ] + * Cherry-pick nmu again. (version 16.1) + * bump minimum cmake version on qualify-clang.sh too + * simplify cmake test without minor version + [ Andreas Beckmann ] + * clang-9: Drop Recommends: libomp-9-dev which is not co-installable with + libomp-11-dev (and libomp-dev) for smoother upgrades of libomp-dev from + buster to bullseye. (Closes: #990452) + + -- Gianfranco Costamagna Mon, 27 Sep 2021 15:02:13 +0200 + +llvm-toolchain-9 (1:9.0.1-17) unstable; urgency=medium + + * Remove an old breaks/replaces for 9 which was causing + some issues on Debian buster. Thanks to Julien Wajsberg + for the bug report + * bump autopkgtest cmake version (Closes: #994501) + Thanks to Timo Röhling for the patch + * cherry pick 68d5235cb58f988c71b403334cd9482d663841ab to build + with newer version of the kernel + + -- Sylvestre Ledru Sat, 25 Sep 2021 16:00:36 +0200 + +llvm-toolchain-9 (1:9.0.1-16) unstable; urgency=medium + + * Only enable libomp-9-doc on supported archs + [ Adrian Bunk ] * Fix the fuzzer build on i386. @@ -863,9 +941,9 @@ llvm-toolchain-9 (1:9.0.1-12) unstable; urgency=medium + [ Jessica Clarke ] * Cherry-pick upstream patch D74453 to fix atomic compare-and-swap on riscv64. - riscv64. [ William Grant ] * debian/patches/riscv64-multilib-empty.patch: Adjust riscv64 GCC detector diff -Nru llvm-toolchain-11-11.0.1/debian/control llvm-toolchain-11-11.1.0/debian/control --- llvm-toolchain-11-11.0.1/debian/control 2021-08-10 00:05:15.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/control 2022-01-24 08:12:46.000000000 +0000 @@ -2,14 +2,14 @@ Section: devel Priority: optional Rules-Requires-Root: no -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: LLVM Packaging Team +Maintainer: LLVM Packaging Team Uploaders: Sylvestre Ledru , Gianfranco Costamagna Build-Depends: debhelper (>= 9.0), cmake, chrpath, texinfo, sharutils, libffi-dev, lsb-release, patchutils, diffstat, xz-utils, python3-dev, libedit-dev, libncurses5-dev, swig, python3-six, python3-sphinx (>= 1.3.6), binutils-dev, + libxml2-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], @@ -20,7 +20,7 @@ libctypes-ocaml-dev [amd64 arm64 armhf ppc64el s390x], dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el s390x], libpfm4-dev [linux-any], python3-setuptools, libz3-dev -Build-Conflicts: oprofile, ocaml +Build-Conflicts: oprofile Standards-Version: 4.2.1 Homepage: https://www.llvm.org/ Vcs-Git: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain.git -b 11 @@ -35,7 +35,8 @@ llvm-11-linker-tools (= ${binary:Version}), libclang1-11 (= ${binary:Version}), libc6-dev, binutils Provides: c-compiler, objc-compiler, c++-compiler -Recommends: llvm-11-dev, python3, libomp-11-dev +Recommends: llvm-11-dev, python3 +# libomp-11-dev Suggests: clang-11-doc Description: C, C++ and Objective-C compiler Clang project is a C, C++, Objective C and Objective C++ front-end @@ -286,8 +287,8 @@ Package: llvm-11-linker-tools Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Breaks: llvm-11-dev (<< 1:11.0.1-2ubuntu3) -Replaces: llvm-11-dev (<< 1:11.0.1-2ubuntu3) +Breaks: llvm-11-dev (<< 1:11.1.0~++20211003090502+1fdec59bffc1-1~exp1~20211003090859.3) +Replaces: llvm-11-dev (<< 1:11.1.0~++20211003090502+1fdec59bffc1-1~exp1~20211003090859.3) 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 @@ -349,7 +350,8 @@ Architecture: any Depends: ${shlibs:Depends}, libffi-dev, ${misc:Depends}, llvm-11 (= ${binary:Version}), libllvm11 (= ${binary:Version}), libtinfo-dev, - llvm-11-tools (= ${binary:Version}), libclang-cpp11 (= ${binary:Version}), libz3-dev + llvm-11-tools (= ${binary:Version}), libclang-cpp11 (= ${binary:Version}), libz3-dev, + libxml2-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 @@ -452,7 +454,7 @@ # ------------- lld ------------- Package: lld-11 -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 +Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 # ia64 hurd powerpc have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm11 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} @@ -462,7 +464,7 @@ Project. Package: liblld-11 -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 +Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 # ia64 hurd powerpc have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm11 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} @@ -476,7 +478,7 @@ Package: liblld-11-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 +Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 # ia64 hurd powerpc have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, lld-11 (= ${binary:Version}), liblld-11 (= ${binary:Version}) @@ -578,7 +580,7 @@ Package: libomp-11-doc Section: doc -Architecture: all +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery Replaces: libiomp-x.y-doc Breaks: libiomp-x.y-doc diff -Nru llvm-toolchain-11-11.0.1/debian/orig-tar.sh llvm-toolchain-11-11.1.0/debian/orig-tar.sh --- llvm-toolchain-11-11.0.1/debian/orig-tar.sh 2020-10-31 21:25:48.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/orig-tar.sh 2022-01-24 08:11:48.000000000 +0000 @@ -41,9 +41,9 @@ git clean -qfd git checkout . git remote update > /dev/null - git reset --hard origin/master > /dev/null + git reset --hard origin/main > /dev/null git clean -qfd - git checkout master > /dev/null + git checkout main > /dev/null git pull cd - } @@ -82,10 +82,10 @@ SOURCE=$(dpkg-parsechangelog |grep ^Source|awk '{print $2}') cd - &> /dev/null if test "$SOURCE" != "llvm-toolchain-snapshot"; then - echo "Checkout of the master is only available for llvm-toolchain-snapshot" + echo "Checkout of the main is only available for llvm-toolchain-snapshot" exit 1 fi - BRANCH="master" + BRANCH="main" fi if test -n "$1" -a -n "$2"; then @@ -124,14 +124,14 @@ # Building a branch git checkout $BRANCH git reset --hard origin/$BRANCH - if test $BRANCH != "master"; then + if test $BRANCH != "main"; then VERSION=$(echo $BRANCH|cut -d/ -f2|cut -d. -f1) if ! echo "$MAJOR_VERSION"|grep -q "$VERSION"; then echo "mismatch in version: Dir=$MAJOR_VERSION Provided=$VERSION" exit 1 fi else - # No argument, take master. So, it can only be snapshot + # No argument, take main. So, it can only be snapshot VERSION=$MAJOR_VERSION MAJOR_VERSION=snapshot fi diff -Nru llvm-toolchain-11-11.0.1/debian/patches/0001-Add-minor-version-to-libclang.so-and-libclang-cpp.so.patch llvm-toolchain-11-11.1.0/debian/patches/0001-Add-minor-version-to-libclang.so-and-libclang-cpp.so.patch --- llvm-toolchain-11-11.0.1/debian/patches/0001-Add-minor-version-to-libclang.so-and-libclang-cpp.so.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/0001-Add-minor-version-to-libclang.so-and-libclang-cpp.so.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,58 @@ +From 3a8282376b6c2bb65a3bb580c10d4da1296d8df1 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Thu, 21 Jan 2021 11:35:48 -0800 +Subject: [PATCH] Add minor version to libclang.so and libclang-cpp.so SONAME + +This patch is for the release/11.x branch. We need to bump the SONAME, because +the ABI of the shared library is changing + +Reviewed By: sylvestre.ledru, cuviper + +Differential Revision: https://reviews.llvm.org/D94941 +--- + clang/CMakeLists.txt | 2 +- + clang/tools/clang-shlib/CMakeLists.txt | 5 ----- + clang/tools/libclang/CMakeLists.txt | 1 - + 3 files changed, 1 insertion(+), 7 deletions(-) + +diff --git b/clang/CMakeLists.txt a/clang/CMakeLists.txt +index bb4b801f01c8..2e06c5fd9028 100644 +--- b/clang/CMakeLists.txt ++++ a/clang/CMakeLists.txt +@@ -509,7 +509,7 @@ set(CLANG_EXECUTABLE_VERSION + "${CLANG_VERSION_MAJOR}" CACHE STRING + "Major version number that will be appended to the clang executable name") + set(LIBCLANG_LIBRARY_VERSION +- "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING ++ "${CLANG_VERSION_MAJOR}" CACHE STRING + "Major version number that will be appended to the libclang library") + mark_as_advanced(CLANG_EXECUTABLE_VERSION LIBCLANG_LIBRARY_VERSION) + +diff --git b/clang/tools/clang-shlib/CMakeLists.txt a/clang/tools/clang-shlib/CMakeLists.txt +index 47ff80418bb0..5949223fc8e3 100644 +--- b/clang/tools/clang-shlib/CMakeLists.txt ++++ a/clang/tools/clang-shlib/CMakeLists.txt +@@ -48,8 +48,3 @@ add_clang_library(clang-cpp + ${_OBJECTS} + LINK_LIBS + ${_DEPS}) +- +- set_target_properties(clang-cpp +- PROPERTIES +- VERSION ${LIBCLANG_LIBRARY_VERSION} +- SOVERSION ${LIBCLANG_LIBRARY_VERSION}) +diff --git b/clang/tools/libclang/CMakeLists.txt a/clang/tools/libclang/CMakeLists.txt +index 5cd9ac5cddc1..a4077140acee 100644 +--- b/clang/tools/libclang/CMakeLists.txt ++++ a/clang/tools/libclang/CMakeLists.txt +@@ -150,7 +150,6 @@ if(ENABLE_SHARED) + else() + set_target_properties(libclang + PROPERTIES +- SOVERSION ${LIBCLANG_LIBRARY_VERSION} + VERSION ${LIBCLANG_LIBRARY_VERSION} + DEFINE_SYMBOL _CINDEX_LIB_) + # FIXME: _CINDEX_LIB_ affects dllexport/dllimport on Win32. +-- +2.29.2 + diff -Nru llvm-toolchain-11-11.0.1/debian/patches/bring-reporter-back.patch llvm-toolchain-11-11.1.0/debian/patches/bring-reporter-back.patch --- llvm-toolchain-11-11.0.1/debian/patches/bring-reporter-back.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/bring-reporter-back.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,223 @@ +From e3cd3a3c91524c957e06bb0170343548f02b6842 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Thu, 11 Feb 2021 22:28:19 +0000 +Subject: [PATCH] Partially Revert "scan-view: Remove Reporter.py and + associated AppleScript files" + +This reverts some of commit dbb01536f6f49fa428f170e34466072ef439b3e9. + +The Reporter module was still being used by the ScanView.py module and deleting +it caused scan-view to fail. This commit adds back Reporter.py but removes the +code the references the AppleScript files which were removed in +dbb01536f6f49fa428f170e34466072ef439b3e9. + +Reviewed By: NoQ + +Differential Revision: https://reviews.llvm.org/D96367 +--- + clang/tools/scan-view/CMakeLists.txt | 1 + + clang/tools/scan-view/share/Reporter.py | 183 ++++++++++++++++++++++++ + 2 files changed, 184 insertions(+) + create mode 100644 clang/tools/scan-view/share/Reporter.py + +diff --git a/clang/tools/scan-view/CMakeLists.txt b/clang/tools/scan-view/CMakeLists.txt +index dd3d33439299..eccc6b83195b 100644 +--- a/clang/tools/scan-view/CMakeLists.txt ++++ b/clang/tools/scan-view/CMakeLists.txt +@@ -5,6 +5,7 @@ set(BinFiles + + set(ShareFiles + ScanView.py ++ Reporter.py + startfile.py + bugcatcher.ico) + +diff --git a/clang/tools/scan-view/share/Reporter.py b/clang/tools/scan-view/share/Reporter.py +new file mode 100644 +index 000000000000..31a14fb0cf74 +--- /dev/null ++++ b/clang/tools/scan-view/share/Reporter.py +@@ -0,0 +1,183 @@ ++#!/usr/bin/env python ++# -*- coding: utf-8 -*- ++ ++"""Methods for reporting bugs.""" ++ ++import subprocess, sys, os ++ ++__all__ = ['ReportFailure', 'BugReport', 'getReporters'] ++ ++# ++ ++class ReportFailure(Exception): ++ """Generic exception for failures in bug reporting.""" ++ def __init__(self, value): ++ self.value = value ++ ++# Collect information about a bug. ++ ++class BugReport(object): ++ def __init__(self, title, description, files): ++ self.title = title ++ self.description = description ++ self.files = files ++ ++# Reporter interfaces. ++ ++import os ++ ++import email, mimetypes, smtplib ++from email import encoders ++from email.message import Message ++from email.mime.base import MIMEBase ++from email.mime.multipart import MIMEMultipart ++from email.mime.text import MIMEText ++ ++#===------------------------------------------------------------------------===# ++# ReporterParameter ++#===------------------------------------------------------------------------===# ++ ++class ReporterParameter(object): ++ def __init__(self, n): ++ self.name = n ++ def getName(self): ++ return self.name ++ def getValue(self,r,bugtype,getConfigOption): ++ return getConfigOption(r.getName(),self.getName()) ++ def saveConfigValue(self): ++ return True ++ ++class TextParameter (ReporterParameter): ++ def getHTML(self,r,bugtype,getConfigOption): ++ return """\ ++ ++%s: ++ ++"""%(self.getName(),r.getName(),self.getName(),self.getValue(r,bugtype,getConfigOption)) ++ ++class SelectionParameter (ReporterParameter): ++ def __init__(self, n, values): ++ ReporterParameter.__init__(self,n) ++ self.values = values ++ ++ def getHTML(self,r,bugtype,getConfigOption): ++ default = self.getValue(r,bugtype,getConfigOption) ++ return """\ ++ ++%s:"""%(self.getName(),r.getName(),self.getName(),'\n'.join(["""\ ++"""%(o[0], ++ o[0] == default and ' selected="selected"' or '', ++ o[1]) for o in self.values])) ++ ++#===------------------------------------------------------------------------===# ++# Reporters ++#===------------------------------------------------------------------------===# ++ ++class EmailReporter(object): ++ def getName(self): ++ return 'Email' ++ ++ def getParameters(self): ++ return [TextParameter(x) for x in ['To', 'From', 'SMTP Server', 'SMTP Port']] ++ ++ # Lifted from python email module examples. ++ def attachFile(self, outer, path): ++ # Guess the content type based on the file's extension. Encoding ++ # will be ignored, although we should check for simple things like ++ # gzip'd or compressed files. ++ ctype, encoding = mimetypes.guess_type(path) ++ if ctype is None or encoding is not None: ++ # No guess could be made, or the file is encoded (compressed), so ++ # use a generic bag-of-bits type. ++ ctype = 'application/octet-stream' ++ maintype, subtype = ctype.split('/', 1) ++ if maintype == 'text': ++ fp = open(path) ++ # Note: we should handle calculating the charset ++ msg = MIMEText(fp.read(), _subtype=subtype) ++ fp.close() ++ else: ++ fp = open(path, 'rb') ++ msg = MIMEBase(maintype, subtype) ++ msg.set_payload(fp.read()) ++ fp.close() ++ # Encode the payload using Base64 ++ encoders.encode_base64(msg) ++ # Set the filename parameter ++ msg.add_header('Content-Disposition', 'attachment', filename=os.path.basename(path)) ++ outer.attach(msg) ++ ++ def fileReport(self, report, parameters): ++ mainMsg = """\ ++BUG REPORT ++--- ++Title: %s ++Description: %s ++"""%(report.title, report.description) ++ ++ if not parameters.get('To'): ++ raise ReportFailure('No "To" address specified.') ++ if not parameters.get('From'): ++ raise ReportFailure('No "From" address specified.') ++ ++ msg = MIMEMultipart() ++ msg['Subject'] = 'BUG REPORT: %s'%(report.title) ++ # FIXME: Get config parameters ++ msg['To'] = parameters.get('To') ++ msg['From'] = parameters.get('From') ++ msg.preamble = mainMsg ++ ++ msg.attach(MIMEText(mainMsg, _subtype='text/plain')) ++ for file in report.files: ++ self.attachFile(msg, file) ++ ++ try: ++ s = smtplib.SMTP(host=parameters.get('SMTP Server'), ++ port=parameters.get('SMTP Port')) ++ s.sendmail(msg['From'], msg['To'], msg.as_string()) ++ s.close() ++ except: ++ raise ReportFailure('Unable to send message via SMTP.') ++ ++ return "Message sent!" ++ ++class BugzillaReporter(object): ++ def getName(self): ++ return 'Bugzilla' ++ ++ def getParameters(self): ++ return [TextParameter(x) for x in ['URL','Product']] ++ ++ def fileReport(self, report, parameters): ++ raise NotImplementedError ++ ++ ++class RadarClassificationParameter(SelectionParameter): ++ def __init__(self): ++ SelectionParameter.__init__(self,"Classification", ++ [['1', 'Security'], ['2', 'Crash/Hang/Data Loss'], ++ ['3', 'Performance'], ['4', 'UI/Usability'], ++ ['6', 'Serious Bug'], ['7', 'Other']]) ++ ++ def saveConfigValue(self): ++ return False ++ ++ def getValue(self,r,bugtype,getConfigOption): ++ if bugtype.find("leak") != -1: ++ return '3' ++ elif bugtype.find("dereference") != -1: ++ return '2' ++ elif bugtype.find("missing ivar release") != -1: ++ return '3' ++ else: ++ return '7' ++ ++### ++ ++def getReporters(): ++ reporters = [] ++ reporters.append(EmailReporter()) ++ return reporters ++ diff -Nru llvm-toolchain-11-11.0.1/debian/patches/compilerrt-build-scudo-standalone-option.diff llvm-toolchain-11-11.1.0/debian/patches/compilerrt-build-scudo-standalone-option.diff --- llvm-toolchain-11-11.0.1/debian/patches/compilerrt-build-scudo-standalone-option.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/compilerrt-build-scudo-standalone-option.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,19 @@ +add option to disable compiler-rt scudo standalone allocator as it is +not always supported by all arch profiles such as arm5vt of ARM32 arch +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/compiler-rt/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/CMakeLists.txt +@@ -256,6 +256,12 @@ option(COMPILER_RT_USE_BUILTINS_LIBRARY + + include(config-ix) + ++option(COMPILER_RT_BUILD_SCUDO_STANDALONE ++ "override whether or not to build scudo standalone" ON) ++if(NOT COMPILER_RT_BUILD_SCUDO_STANDALONE) ++ set(COMPILER_RT_HAS_SCUDO_STANDALONE FALSE) ++endif() ++ + #================================ + # Setup Compiler Flags + #================================ diff -Nru llvm-toolchain-11-11.0.1/debian/patches/compilerrt-builtins-arch-fix-armhf.diff llvm-toolchain-11-11.1.0/debian/patches/compilerrt-builtins-arch-fix-armhf.diff --- llvm-toolchain-11-11.0.1/debian/patches/compilerrt-builtins-arch-fix-armhf.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/compilerrt-builtins-arch-fix-armhf.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,18 @@ +fix builtins armhf default arch detection by adding the same armhf triple +handling use for compiler-rt +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/lib/builtins/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/compiler-rt/lib/builtins/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/lib/builtins/CMakeLists.txt +@@ -19,6 +19,11 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR + + load_llvm_config() + construct_compiler_rt_default_triple() ++ if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$") ++ if (${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "^arm") ++ set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf") ++ endif() ++ endif() + + if(APPLE) + include(CompilerRTDarwinUtils) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/compilerrt-fix-warn-xray-testing.diff llvm-toolchain-11-11.1.0/debian/patches/compilerrt-fix-warn-xray-testing.diff --- llvm-toolchain-11-11.0.1/debian/patches/compilerrt-fix-warn-xray-testing.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/compilerrt-fix-warn-xray-testing.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,33 @@ +suppress warnings for xray and testing when not enabled +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/compiler-rt/cmake/Modules/CompilerRTUtils.cmake ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +@@ -323,15 +323,15 @@ macro(load_llvm_config) + + # Detect if we have the LLVMXRay and TestingSupport library installed and + # available from llvm-config. ++ set(COMPILER_RT_HAS_LLVMXRAY FALSE) + execute_process( + COMMAND ${LLVM_CONFIG_PATH} "--ldflags" "--libs" "xray" + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT + ERROR_QUIET) +- if (HAD_ERROR) ++ if (HAD_ERROR AND COMPILER_RT_BUILD_XRAY) + message(WARNING "llvm-config finding xray failed with status ${HAD_ERROR}") +- set(COMPILER_RT_HAS_LLVMXRAY FALSE) +- else() ++ elseif(COMPILER_RT_BUILD_XRAY) + string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) + list(GET CONFIG_OUTPUT 0 LDFLAGS) + list(GET CONFIG_OUTPUT 1 LIBLIST) +@@ -348,7 +348,7 @@ macro(load_llvm_config) + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT + ERROR_QUIET) +- if (HAD_ERROR) ++ if (HAD_ERROR AND COMPILER_RT_INCLUDE_TESTS) + message(WARNING "llvm-config finding testingsupport failed with status ${HAD_ERROR}") + elseif(COMPILER_RT_INCLUDE_TESTS) + string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/D91833-bpftrace-fix-code-gen.diff llvm-toolchain-11-11.1.0/debian/patches/D91833-bpftrace-fix-code-gen.diff --- llvm-toolchain-11-11.0.1/debian/patches/D91833-bpftrace-fix-code-gen.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/D91833-bpftrace-fix-code-gen.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,405 @@ +Index: llvm-toolchain-11-11.1.0/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp ++++ llvm-toolchain-11-11.1.0/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp +@@ -7,6 +7,7 @@ + //===----------------------------------------------------------------------===// + + #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" ++#include "llvm/Analysis/MemoryLocation.h" + #include "llvm/CodeGen/ISDOpcodes.h" + #include "llvm/CodeGen/MachineFrameInfo.h" + #include "llvm/CodeGen/MachineFunction.h" +@@ -96,18 +97,28 @@ bool BaseIndexOffset::computeAliasing(co + int64_t PtrDiff; + if (NumBytes0.hasValue() && NumBytes1.hasValue() && + BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff)) { ++ // If the size of memory access is unknown, do not use it to analysis. ++ // One example of unknown size memory access is to load/store scalable ++ // vector objects on the stack. + // BasePtr1 is PtrDiff away from BasePtr0. They alias if none of the + // following situations arise: +- IsAlias = !( +- // [----BasePtr0----] +- // [---BasePtr1--] +- // ========PtrDiff========> +- (*NumBytes0 <= PtrDiff) || +- // [----BasePtr0----] +- // [---BasePtr1--] +- // =====(-PtrDiff)====> +- (PtrDiff + *NumBytes1 <= 0)); // i.e. *NumBytes1 < -PtrDiff. +- return true; ++ if (PtrDiff >= 0 && ++ *NumBytes0 != static_cast(MemoryLocation::UnknownSize)) { ++ // [----BasePtr0----] ++ // [---BasePtr1--] ++ // ========PtrDiff========> ++ IsAlias = !(*NumBytes0 <= PtrDiff); ++ return true; ++ } ++ if (PtrDiff < 0 && ++ *NumBytes1 != static_cast(MemoryLocation::UnknownSize)) { ++ // [----BasePtr0----] ++ // [---BasePtr1--] ++ // =====(-PtrDiff)====> ++ IsAlias = !((PtrDiff + *NumBytes1) <= 0); ++ return true; ++ } ++ return false; + } + // If both BasePtr0 and BasePtr1 are FrameIndexes, we will not be + // able to calculate their relative offset if at least one arises +Index: llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/CMakeLists.txt +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/llvm/unittests/CodeGen/CMakeLists.txt ++++ llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/CMakeLists.txt +@@ -21,6 +21,7 @@ add_llvm_unittest(CodeGenTests + MachineInstrTest.cpp + MachineOperandTest.cpp + ScalableVectorMVTsTest.cpp ++ SelectionDAGAddressAnalysisTest.cpp + TypeTraitsTest.cpp + TargetOptionsTest.cpp + ) +Index: llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp +=================================================================== +--- /dev/null ++++ llvm-toolchain-11-11.1.0/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp +@@ -0,0 +1,337 @@ ++//===- llvm/unittest/CodeGen/SelectionDAGAddressAnalysisTest.cpp ---------===// ++// ++// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. ++// See https://llvm.org/LICENSE.txt for license information. ++// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ++// ++//===----------------------------------------------------------------------===// ++ ++#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" ++#include "llvm/Analysis/MemoryLocation.h" ++#include "llvm/Analysis/OptimizationRemarkEmitter.h" ++#include "llvm/AsmParser/Parser.h" ++#include "llvm/CodeGen/MachineModuleInfo.h" ++#include "llvm/CodeGen/SelectionDAG.h" ++#include "llvm/CodeGen/TargetLowering.h" ++#include "llvm/Support/SourceMgr.h" ++#include "llvm/Support/TargetRegistry.h" ++#include "llvm/Support/TargetSelect.h" ++#include "llvm/Target/TargetMachine.h" ++#include "gtest/gtest.h" ++ ++namespace llvm { ++ ++class SelectionDAGAddressAnalysisTest : public testing::Test { ++protected: ++ static void SetUpTestCase() { ++ InitializeAllTargets(); ++ InitializeAllTargetMCs(); ++ } ++ ++ void SetUp() override { ++ StringRef Assembly = "@g = global i32 0\n" ++ "define i32 @f() {\n" ++ " %1 = load i32, i32* @g\n" ++ " ret i32 %1\n" ++ "}"; ++ ++ Triple TargetTriple("aarch64--"); ++ std::string Error; ++ const Target *T = TargetRegistry::lookupTarget("", TargetTriple, Error); ++ // FIXME: These tests do not depend on AArch64 specifically, but we have to ++ // initialize a target. A skeleton Target for unittests would allow us to ++ // always run these tests. ++ if (!T) ++ return; ++ ++ TargetOptions Options; ++ TM = std::unique_ptr(static_cast( ++ T->createTargetMachine("AArch64", "", "+sve", Options, None, None, ++ CodeGenOpt::Aggressive))); ++ if (!TM) ++ return; ++ ++ SMDiagnostic SMError; ++ M = parseAssemblyString(Assembly, SMError, Context); ++ if (!M) ++ report_fatal_error(SMError.getMessage()); ++ M->setDataLayout(TM->createDataLayout()); ++ ++ F = M->getFunction("f"); ++ if (!F) ++ report_fatal_error("F?"); ++ G = M->getGlobalVariable("g"); ++ if (!G) ++ report_fatal_error("G?"); ++ ++ MachineModuleInfo MMI(TM.get()); ++ ++ MF = std::make_unique(*F, *TM, *TM->getSubtargetImpl(*F), ++ 0, MMI); ++ ++ DAG = std::make_unique(*TM, CodeGenOpt::None); ++ if (!DAG) ++ report_fatal_error("DAG?"); ++ OptimizationRemarkEmitter ORE(F); ++ DAG->init(*MF, ORE, nullptr, nullptr, nullptr, nullptr, nullptr); ++ } ++ ++ TargetLoweringBase::LegalizeTypeAction getTypeAction(EVT VT) { ++ return DAG->getTargetLoweringInfo().getTypeAction(Context, VT); ++ } ++ ++ EVT getTypeToTransformTo(EVT VT) { ++ return DAG->getTargetLoweringInfo().getTypeToTransformTo(Context, VT); ++ } ++ ++ LLVMContext Context; ++ std::unique_ptr TM; ++ std::unique_ptr M; ++ Function *F; ++ GlobalVariable *G; ++ std::unique_ptr MF; ++ std::unique_ptr DAG; ++}; ++ ++TEST_F(SelectionDAGAddressAnalysisTest, sameFrameObject) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 4); ++ SDValue FIPtr = DAG->CreateStackTemporary(VecVT); ++ int FI = cast(FIPtr.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI); ++ TypeSize Offset = TypeSize::Fixed(0); ++ SDValue Value = DAG->getConstant(0, Loc, VecVT); ++ SDValue Index = DAG->getMemBasePlusOffset(FIPtr, Offset, Loc); ++ SDValue Store = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index, ++ PtrInfo.getWithOffset(Offset)); ++ Optional NumBytes = MemoryLocation::getSizeOrUnknown( ++ cast(Store)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store.getNode(), NumBytes, Store.getNode(), NumBytes, *DAG, IsAlias); ++ ++ EXPECT_TRUE(IsValid); ++ EXPECT_TRUE(IsAlias); ++} ++ ++TEST_F(SelectionDAGAddressAnalysisTest, noAliasingFrameObjects) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ // <4 x i8> ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 4); ++ // <2 x i8> ++ auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2); ++ SDValue FIPtr = DAG->CreateStackTemporary(VecVT); ++ int FI = cast(FIPtr.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI); ++ SDValue Value = DAG->getConstant(0, Loc, SubVecVT); ++ TypeSize Offset0 = TypeSize::Fixed(0); ++ TypeSize Offset1 = SubVecVT.getStoreSize(); ++ SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc); ++ SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc); ++ SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index0, ++ PtrInfo.getWithOffset(Offset0)); ++ SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index1, ++ PtrInfo.getWithOffset(Offset1)); ++ Optional NumBytes0 = MemoryLocation::getSizeOrUnknown( ++ cast(Store0)->getMemoryVT().getStoreSize()); ++ Optional NumBytes1 = MemoryLocation::getSizeOrUnknown( ++ cast(Store1)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias); ++ ++ EXPECT_TRUE(IsValid); ++ EXPECT_FALSE(IsAlias); ++} ++ ++TEST_F(SelectionDAGAddressAnalysisTest, unknownSizeFrameObjects) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ // ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true); ++ // ++ auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2, true); ++ SDValue FIPtr = DAG->CreateStackTemporary(VecVT); ++ int FI = cast(FIPtr.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI); ++ SDValue Value = DAG->getConstant(0, Loc, SubVecVT); ++ TypeSize Offset0 = TypeSize::Fixed(0); ++ TypeSize Offset1 = SubVecVT.getStoreSize(); ++ SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc); ++ SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc); ++ SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index0, ++ PtrInfo.getWithOffset(Offset0)); ++ SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index1, ++ PtrInfo.getWithOffset(Offset1)); ++ Optional NumBytes0 = MemoryLocation::getSizeOrUnknown( ++ cast(Store0)->getMemoryVT().getStoreSize()); ++ Optional NumBytes1 = MemoryLocation::getSizeOrUnknown( ++ cast(Store1)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias); ++ ++ EXPECT_FALSE(IsValid); ++} ++ ++TEST_F(SelectionDAGAddressAnalysisTest, globalWithFrameObject) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ // ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true); ++ SDValue FIPtr = DAG->CreateStackTemporary(VecVT); ++ int FI = cast(FIPtr.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI); ++ SDValue Value = DAG->getConstant(0, Loc, VecVT); ++ TypeSize Offset = TypeSize::Fixed(0); ++ SDValue Index = DAG->getMemBasePlusOffset(FIPtr, Offset, Loc); ++ SDValue Store = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index, ++ PtrInfo.getWithOffset(Offset)); ++ Optional NumBytes = MemoryLocation::getSizeOrUnknown( ++ cast(Store)->getMemoryVT().getStoreSize()); ++ EVT GTy = DAG->getTargetLoweringInfo().getValueType(DAG->getDataLayout(), ++ G->getType()); ++ SDValue GValue = DAG->getConstant(0, Loc, GTy); ++ SDValue GAddr = DAG->getGlobalAddress(G, Loc, GTy); ++ SDValue GStore = DAG->getStore(DAG->getEntryNode(), Loc, GValue, GAddr, ++ MachinePointerInfo(G, 0)); ++ Optional GNumBytes = MemoryLocation::getSizeOrUnknown( ++ cast(GStore)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store.getNode(), NumBytes, GStore.getNode(), GNumBytes, *DAG, IsAlias); ++ ++ EXPECT_TRUE(IsValid); ++ EXPECT_FALSE(IsAlias); ++} ++ ++TEST_F(SelectionDAGAddressAnalysisTest, fixedSizeFrameObjectsWithinDiff) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ // ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true); ++ // ++ auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2, true); ++ // <2 x i8> ++ auto SubFixedVecVT2xi8 = EVT::getVectorVT(Context, Int8VT, 2); ++ SDValue FIPtr = DAG->CreateStackTemporary(VecVT); ++ int FI = cast(FIPtr.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI); ++ SDValue Value0 = DAG->getConstant(0, Loc, SubFixedVecVT2xi8); ++ SDValue Value1 = DAG->getConstant(0, Loc, SubVecVT); ++ TypeSize Offset0 = TypeSize::Fixed(0); ++ TypeSize Offset1 = SubFixedVecVT2xi8.getStoreSize(); ++ SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc); ++ SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc); ++ SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value0, Index0, ++ PtrInfo.getWithOffset(Offset0)); ++ SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value1, Index1, ++ PtrInfo.getWithOffset(Offset1)); ++ Optional NumBytes0 = MemoryLocation::getSizeOrUnknown( ++ cast(Store0)->getMemoryVT().getStoreSize()); ++ Optional NumBytes1 = MemoryLocation::getSizeOrUnknown( ++ cast(Store1)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias); ++ EXPECT_TRUE(IsValid); ++ EXPECT_FALSE(IsAlias); ++ ++ IsValid = BaseIndexOffset::computeAliasing( ++ Store1.getNode(), NumBytes1, Store0.getNode(), NumBytes0, *DAG, IsAlias); ++ EXPECT_TRUE(IsValid); ++ EXPECT_FALSE(IsAlias); ++} ++ ++TEST_F(SelectionDAGAddressAnalysisTest, fixedSizeFrameObjectsOutOfDiff) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ // ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 4, true); ++ // ++ auto SubVecVT = EVT::getVectorVT(Context, Int8VT, 2, true); ++ // <2 x i8> ++ auto SubFixedVecVT2xi8 = EVT::getVectorVT(Context, Int8VT, 2); ++ // <4 x i8> ++ auto SubFixedVecVT4xi8 = EVT::getVectorVT(Context, Int8VT, 4); ++ SDValue FIPtr = DAG->CreateStackTemporary(VecVT); ++ int FI = cast(FIPtr.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI); ++ SDValue Value0 = DAG->getConstant(0, Loc, SubFixedVecVT4xi8); ++ SDValue Value1 = DAG->getConstant(0, Loc, SubVecVT); ++ TypeSize Offset0 = TypeSize::Fixed(0); ++ TypeSize Offset1 = SubFixedVecVT2xi8.getStoreSize(); ++ SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc); ++ SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc); ++ SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value0, Index0, ++ PtrInfo.getWithOffset(Offset0)); ++ SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value1, Index1, ++ PtrInfo.getWithOffset(Offset1)); ++ Optional NumBytes0 = MemoryLocation::getSizeOrUnknown( ++ cast(Store0)->getMemoryVT().getStoreSize()); ++ Optional NumBytes1 = MemoryLocation::getSizeOrUnknown( ++ cast(Store1)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias); ++ EXPECT_TRUE(IsValid); ++ EXPECT_TRUE(IsAlias); ++} ++ ++TEST_F(SelectionDAGAddressAnalysisTest, twoFixedStackObjects) { ++ if (!TM) ++ return; ++ SDLoc Loc; ++ auto Int8VT = EVT::getIntegerVT(Context, 8); ++ // ++ auto VecVT = EVT::getVectorVT(Context, Int8VT, 2, true); ++ // <2 x i8> ++ auto FixedVecVT = EVT::getVectorVT(Context, Int8VT, 2); ++ SDValue FIPtr0 = DAG->CreateStackTemporary(FixedVecVT); ++ SDValue FIPtr1 = DAG->CreateStackTemporary(VecVT); ++ int FI0 = cast(FIPtr0.getNode())->getIndex(); ++ int FI1 = cast(FIPtr1.getNode())->getIndex(); ++ MachinePointerInfo PtrInfo0 = MachinePointerInfo::getFixedStack(*MF, FI0); ++ MachinePointerInfo PtrInfo1 = MachinePointerInfo::getFixedStack(*MF, FI1); ++ SDValue Value0 = DAG->getConstant(0, Loc, FixedVecVT); ++ SDValue Value1 = DAG->getConstant(0, Loc, VecVT); ++ TypeSize Offset0 = TypeSize::Fixed(0); ++ SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr0, Offset0, Loc); ++ SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr1, Offset0, Loc); ++ SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value0, Index0, ++ PtrInfo0.getWithOffset(Offset0)); ++ SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value1, Index1, ++ PtrInfo1.getWithOffset(Offset0)); ++ Optional NumBytes0 = MemoryLocation::getSizeOrUnknown( ++ cast(Store0)->getMemoryVT().getStoreSize()); ++ Optional NumBytes1 = MemoryLocation::getSizeOrUnknown( ++ cast(Store1)->getMemoryVT().getStoreSize()); ++ ++ bool IsAlias; ++ bool IsValid = BaseIndexOffset::computeAliasing( ++ Store0.getNode(), NumBytes0, Store1.getNode(), NumBytes1, *DAG, IsAlias); ++ EXPECT_TRUE(IsValid); ++ EXPECT_FALSE(IsAlias); ++} ++ ++} // end namespace llvm diff -Nru llvm-toolchain-11-11.0.1/debian/patches/D92052.patch llvm-toolchain-11-11.1.0/debian/patches/D92052.patch --- llvm-toolchain-11-11.0.1/debian/patches/D92052.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/D92052.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,77 @@ +Index: llvm/lib/MC/MCParser/ELFAsmParser.cpp +=================================================================== +--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp ++++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp +@@ -652,10 +652,13 @@ + !(SectionName == ".eh_frame" && Type == ELF::SHT_PROGBITS)) + Error(loc, "changed section type for " + SectionName + ", expected: 0x" + + utohexstr(Section->getType())); +- if (Section->getFlags() != Flags) ++ // Check that flags are used consistently. However, the GNU assembler permits ++ // to leave out in subsequent uses of the same sections; for compatibility, ++ // do likewise. ++ if ((Flags || Size || !TypeName.empty()) && Section->getFlags() != Flags) + Error(loc, "changed section flags for " + SectionName + ", expected: 0x" + + utohexstr(Section->getFlags())); +- if (Section->getEntrySize() != Size) ++ if ((Flags || Size || !TypeName.empty()) && Section->getEntrySize() != Size) + Error(loc, "changed section entsize for " + SectionName + + ", expected: " + Twine(Section->getEntrySize())); + +Index: llvm/test/MC/ELF/section-entsize-changed.s +=================================================================== +--- a/llvm/test/MC/ELF/section-entsize-changed.s ++++ b/llvm/test/MC/ELF/section-entsize-changed.s +@@ -10,3 +10,26 @@ + .pushsection .foo,"aM",@progbits,4 + + .pushsection .foo,"aM",@progbits,1 ++ ++ ++bar: ++.section .bar,"ax",@progbits ++ ++.section .bar ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .bar, expected: 0x6 ++.section .bar,"awx",@progbits ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .bar, expected: 0x6 ++.pushsection .bar,"a",@progbits ++ ++.pushsection .bar ++ ++foobar: ++.section .foobar,"ax",@progbits; .byte 1 ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .foobar, expected: 0x6 ++.section .foobar,"",@progbits; .byte 2 ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .foobar, expected: 0x6 ++.section .foobar,"a",@progbits; .byte 3 +Index: llvm/test/MC/ELF/section-omitted-attributes.s +=================================================================== +--- /dev/null ++++ llvm/test/MC/ELF/section-omitted-attributes.s +@@ -0,0 +1,21 @@ ++# RUN: llvm-mc -triple=x86_64 %s -o - | FileCheck %s ++ ++// CHECK: .section .foo,"aM",@progbits,1 ++// CHECK: .section .bar,"aM",@progbits,4 ++ ++foo: ++.section .foo,"aM",@progbits,1 ++ ++.section .foo ++ ++.pushsection .foo ++ ++.pushsection .foo ++ ++.section .bar,"aM",@progbits,4 ++ ++.section .bar ++ ++.pushsection .bar,"aM",@progbits,4 ++ ++.pushsection .bar diff -Nru llvm-toolchain-11-11.0.1/debian/patches/D98574.patch llvm-toolchain-11-11.1.0/debian/patches/D98574.patch --- llvm-toolchain-11-11.0.1/debian/patches/D98574.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/D98574.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,40 @@ +--- llvm-toolchain-snapshot-13~++20210129063721+010b176cdefb.orig/clang/lib/Basic/Targets/Sparc.cpp ++++ llvm-toolchain-snapshot-13~++20210129063721+010b176cdefb/clang/lib/Basic/Targets/Sparc.cpp +@@ -156,9 +156,12 @@ void SparcV8TargetInfo::getTargetDefines + Builder.defineMacro("__sparcv8__"); + break; + case CG_V9: +- Builder.defineMacro("__sparcv9"); +- Builder.defineMacro("__sparcv9__"); + Builder.defineMacro("__sparc_v9__"); ++ // Linux doesn't need these variants, but the BSDs do. ++ if (getTriple().getOS() != llvm::Triple::Linux) { ++ Builder.defineMacro("__sparcv9"); ++ Builder.defineMacro("__sparcv9__"); ++ } + break; + } + } +@@ -239,13 +242,17 @@ void SparcV8TargetInfo::getTargetDefines + void SparcV9TargetInfo::getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const { + SparcTargetInfo::getTargetDefines(Opts, Builder); +- Builder.defineMacro("__sparcv9"); + Builder.defineMacro("__arch64__"); +- // Solaris doesn't need these variants, but the BSDs do. +- if (getTriple().getOS() != llvm::Triple::Solaris) { +- Builder.defineMacro("__sparc64__"); ++ if (getTriple().getOS() == llvm::Triple::Linux) { + Builder.defineMacro("__sparc_v9__"); +- Builder.defineMacro("__sparcv9__"); ++ } else { ++ Builder.defineMacro("__sparcv9"); ++ // Solaris doesn't need these variants, but the BSDs do. ++ if (getTriple().getOS() != llvm::Triple::Solaris) { ++ Builder.defineMacro("__sparc64__"); ++ Builder.defineMacro("__sparc_v9__"); ++ Builder.defineMacro("__sparcv9__"); ++ } + } + + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); diff -Nru llvm-toolchain-11-11.0.1/debian/patches/D98575.patch llvm-toolchain-11-11.1.0/debian/patches/D98575.patch --- llvm-toolchain-11-11.0.1/debian/patches/D98575.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/D98575.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,19 @@ +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/cmake/base-config-ix.cmake +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/compiler-rt/cmake/base-config-ix.cmake ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/compiler-rt/cmake/base-config-ix.cmake +@@ -220,8 +220,12 @@ macro(test_targets) + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x") + test_target_arch(s390x "" "") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "sparc") +- test_target_arch(sparc "" "-m32") +- test_target_arch(sparcv9 "" "-m64") ++ if (CMAKE_SIZEOF_VOID_P EQUAL 4) ++ test_target_arch(sparc "" "-mcpu=v9" "-m32") ++ append("-latomic" CMAKE_LD_FLAGS) ++ else() ++ test_target_arch(sparcv9 "" "-m64") ++ endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el") + # Gcc doesn't accept -m32/-m64 so we do the next best thing and use + # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match diff -Nru llvm-toolchain-11-11.0.1/debian/patches/libclc-fix-prepare_builtins-rpath.diff llvm-toolchain-11-11.1.0/debian/patches/libclc-fix-prepare_builtins-rpath.diff --- llvm-toolchain-11-11.0.1/debian/patches/libclc-fix-prepare_builtins-rpath.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/libclc-fix-prepare_builtins-rpath.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,16 @@ +set rpath for prepare_builtins build utility to find correct stage2 +libs at runtime when executed as part of a build +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/libclc/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/libclc/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/libclc/CMakeLists.txt +@@ -149,6 +149,9 @@ target_compile_options( prepare_builtins + target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) + target_link_libraries( prepare_builtins PRIVATE ${LLVM_LIBS} ) + target_link_libraries( prepare_builtins PRIVATE ${LLVM_SYSTEM_LIBS} ) ++set_target_properties( prepare_builtins ++ PROPERTIES INSTALL_RPATH "${LLVM_LIBDIR}" ++ BUILD_WITH_INSTALL_RPATH "ON") + + # Setup arch devices + set( r600--_devices cedar cypress barts cayman ) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/libclc-llvm-spirv.diff llvm-toolchain-11-11.1.0/debian/patches/libclc-llvm-spirv.diff --- llvm-toolchain-11-11.0.1/debian/patches/libclc-llvm-spirv.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/libclc-llvm-spirv.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,13 @@ +diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt +index b8b5ceff086c..5964468358f2 100644 +--- a/libclc/CMakeLists.txt ++++ b/libclc/CMakeLists.txt +@@ -97,7 +97,7 @@ find_program( LLVM_CLANG clang PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) + find_program( LLVM_AS llvm-as PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) + find_program( LLVM_LINK llvm-link PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) + find_program( LLVM_OPT opt PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) +-find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR} NO_DEFAULT_PATH ) ++find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_BINDIR}) + + # Print toolchain + message( "clang: ${LLVM_CLANG}" ) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/libcxxabi-fix-link-builtins.diff llvm-toolchain-11-11.1.0/debian/patches/libcxxabi-fix-link-builtins.diff --- llvm-toolchain-11-11.0.1/debian/patches/libcxxabi-fix-link-builtins.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/libcxxabi-fix-link-builtins.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,17 @@ +if LIBCXXABI_USE_COMPILER_RT=ON, add builtins to libcxxabi library +flags, otherwise add libgcc following how libunwind does the same +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/libcxxabi/src/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/libcxxabi/src/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/libcxxabi/src/CMakeLists.txt +@@ -111,7 +111,9 @@ if (ANDROID AND ANDROID_PLATFORM_LEVEL L + list(APPEND LIBCXXABI_LIBRARIES android_support) + endif() + +-if (NOT LIBCXXABI_USE_COMPILER_RT) ++if (LIBCXXABI_USE_COMPILER_RT) ++ add_library_flags("${LIBCXXABI_BUILTINS_LIBRARY}") ++else() + add_library_flags_if(LIBCXXABI_HAS_GCC_LIB gcc) + endif () + diff -Nru llvm-toolchain-11-11.0.1/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff llvm-toolchain-11-11.1.0/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff --- llvm-toolchain-11-11.0.1/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,24 @@ +if libatomic is found only link it if libgcc is the rtlib +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/libcxx/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/libcxx/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/libcxx/CMakeLists.txt +@@ -800,12 +800,14 @@ function(cxx_link_system_libraries targe + endif() + elseif (LIBCXX_HAS_GCC_LIB) + target_link_libraries(${target} PRIVATE gcc) ++ if (LIBCXX_HAS_ATOMIC_LIB) ++ target_link_libraries(${target} PRIVATE atomic) ++ endif() + elseif (LIBCXX_HAS_GCC_S_LIB) + target_link_libraries(${target} PRIVATE gcc_s) +- endif() +- +- if (LIBCXX_HAS_ATOMIC_LIB) +- target_link_libraries(${target} PRIVATE atomic) ++ if (LIBCXX_HAS_ATOMIC_LIB) ++ target_link_libraries(${target} PRIVATE atomic) ++ endif() + endif() + + if (MINGW) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/libsanitizer-remove-cyclades.patch llvm-toolchain-11-11.1.0/debian/patches/libsanitizer-remove-cyclades.patch --- llvm-toolchain-11-11.0.1/debian/patches/libsanitizer-remove-cyclades.patch 2021-08-10 00:05:15.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/libsanitizer-remove-cyclades.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From 884040db086936107ec81656aa5b4c607235fb9a Mon Sep 17 00:00:00 2001 -From: Tamar Christina -Date: Thu, 20 May 2021 18:55:11 +0100 -Subject: [PATCH] libsanitizer: Remove cyclades inclusion in sanitizer - -The Linux kernel has removed the interface to cyclades from -the latest kernel headers[1] due to them being orphaned for the -past 13 years. - -libsanitizer uses this header when compiling against glibc, but -glibcs itself doesn't seem to have any references to cyclades. - -Further more it seems that the driver is broken in the kernel and -the firmware doesn't seem to be available anymore. - -As such since this is breaking the build of libsanitizer (and so the -GCC bootstrap[2]) I propose to remove this. - -[1] https://lkml.org/lkml/2021/3/2/153 -[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379 - -Reviewed By: eugenis - -Differential Revision: https://reviews.llvm.org/D102059 - -(cherry picked from commit 68d5235cb58f988c71b403334cd9482d663841ab) - -Origin: backport, https://github.com/llvm/llvm-project/commit/884040db086936107ec81656aa5b4c607235fb9a -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-11/+bug/1939424 -Applied-Upstream: 12.0.0 -Reviewed-By: Sergio Durigan Junior - ---- - .../sanitizer_common_interceptors_ioctl.inc | 9 --------- - .../sanitizer_platform_limits_posix.cpp | 11 ----------- - .../sanitizer_platform_limits_posix.h | 10 ---------- - 3 files changed, 30 deletions(-) - -Index: llvm-toolchain-11-11.0.1/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -=================================================================== ---- llvm-toolchain-11-11.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc 2021-08-09 20:04:52.708009283 -0400 -+++ llvm-toolchain-11-11.0.1/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc 2021-08-09 20:04:52.704009405 -0400 -@@ -366,15 +366,6 @@ - - #if SANITIZER_LINUX && !SANITIZER_ANDROID - // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE -- _(CYGETDEFTHRESH, WRITE, sizeof(int)); -- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); -- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); -- _(CYGETTHRESH, WRITE, sizeof(int)); -- _(CYGETTIMEOUT, WRITE, sizeof(int)); -- _(CYSETDEFTHRESH, NONE, 0); -- _(CYSETDEFTIMEOUT, NONE, 0); -- _(CYSETTHRESH, NONE, 0); -- _(CYSETTIMEOUT, NONE, 0); - _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); - _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); - _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); -Index: llvm-toolchain-11-11.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -=================================================================== ---- llvm-toolchain-11-11.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 2021-08-09 20:04:52.708009283 -0400 -+++ llvm-toolchain-11-11.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 2021-08-09 20:04:52.704009405 -0400 -@@ -130,7 +130,6 @@ - # include - #endif - #include --#include - #include - #include - #include -@@ -444,7 +443,6 @@ - - #if SANITIZER_LINUX && !SANITIZER_ANDROID - unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); -- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); - #if EV_VERSION > (0x010000) - unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); - #else -@@ -810,15 +808,6 @@ - #endif // SANITIZER_LINUX - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; -- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; -- unsigned IOCTL_CYGETMON = CYGETMON; -- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; -- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; -- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; -- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; -- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; -- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; - unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; - unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; - unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; -Index: llvm-toolchain-11-11.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -=================================================================== ---- llvm-toolchain-11-11.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2021-08-09 20:04:52.708009283 -0400 -+++ llvm-toolchain-11-11.0.1/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2021-08-09 20:04:52.704009405 -0400 -@@ -981,7 +981,6 @@ - - #if SANITIZER_LINUX && !SANITIZER_ANDROID - extern unsigned struct_ax25_parms_struct_sz; --extern unsigned struct_cyclades_monitor_sz; - extern unsigned struct_input_keymap_entry_sz; - extern unsigned struct_ipx_config_data_sz; - extern unsigned struct_kbdiacrs_sz; -@@ -1326,15 +1325,6 @@ - #endif // SANITIZER_LINUX - - #if SANITIZER_LINUX && !SANITIZER_ANDROID --extern unsigned IOCTL_CYGETDEFTHRESH; --extern unsigned IOCTL_CYGETDEFTIMEOUT; --extern unsigned IOCTL_CYGETMON; --extern unsigned IOCTL_CYGETTHRESH; --extern unsigned IOCTL_CYGETTIMEOUT; --extern unsigned IOCTL_CYSETDEFTHRESH; --extern unsigned IOCTL_CYSETDEFTIMEOUT; --extern unsigned IOCTL_CYSETTHRESH; --extern unsigned IOCTL_CYSETTIMEOUT; - extern unsigned IOCTL_EQL_EMANCIPATE; - extern unsigned IOCTL_EQL_ENSLAVE; - extern unsigned IOCTL_EQL_GETMASTRCFG; diff -Nru llvm-toolchain-11-11.0.1/debian/patches/llvm-fix-lld-linker-check.diff llvm-toolchain-11-11.1.0/debian/patches/llvm-fix-lld-linker-check.diff --- llvm-toolchain-11-11.0.1/debian/patches/llvm-fix-lld-linker-check.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/llvm-fix-lld-linker-check.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,15 @@ +remove regex anchor in lld linker detection to account for vendor, if +specified, being prepended to lld version string +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/cmake/modules/AddLLVM.cmake +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/llvm/cmake/modules/AddLLVM.cmake ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/cmake/modules/AddLLVM.cmake +@@ -210,7 +210,7 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND + set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") + set(LLVM_LINKER_IS_GOLD YES CACHE INTERNAL "") + message(STATUS "Linker detection: GNU Gold") +- elseif("${stdout}" MATCHES "^LLD") ++ elseif("${stdout}" MATCHES "LLD") + set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") + set(LLVM_LINKER_IS_LLD YES CACHE INTERNAL "") + message(STATUS "Linker detection: LLD") diff -Nru llvm-toolchain-11-11.0.1/debian/patches/llvm-runtimes-builtins-build-check.diff llvm-toolchain-11-11.1.0/debian/patches/llvm-runtimes-builtins-build-check.diff --- llvm-toolchain-11-11.0.1/debian/patches/llvm-runtimes-builtins-build-check.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/llvm-runtimes-builtins-build-check.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,20 @@ +add a check and only set up and build compiler-rt builtins if they have +not been disabled +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/runtimes/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/llvm/runtimes/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/runtimes/CMakeLists.txt +@@ -132,7 +132,12 @@ endfunction() + # is required because the other runtimes need the builtin libraries present + # before the just-built compiler can pass the configuration tests. + get_compiler_rt_path(compiler_rt_path) +-if(compiler_rt_path) ++# check if builtins have been disabled ++set(RUNTIMES_BUILD_BUILTINS ON) ++if(DEFINED COMPILER_RT_BUILD_BUILTINS) ++ set(RUNTIMES_BUILD_BUILTINS ${COMPILER_RT_BUILD_BUILTINS}) ++endif() ++if(compiler_rt_path AND RUNTIMES_BUILD_BUILTINS) + if(NOT LLVM_BUILTIN_TARGETS) + builtin_default_target(${compiler_rt_path} + DEPENDS clang-resource-headers) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/lower-python-dep.diff llvm-toolchain-11-11.1.0/debian/patches/lower-python-dep.diff --- llvm-toolchain-11-11.0.1/debian/patches/lower-python-dep.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/lower-python-dep.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,15 @@ +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/cmake/modules/HandleLLVMOptions.cmake +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/llvm/cmake/modules/HandleLLVMOptions.cmake ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/cmake/modules/HandleLLVMOptions.cmake +@@ -1213,8 +1213,8 @@ if(LLVM_USE_RELATIVE_PATHS_IN_FILES) + endif() + + if(LLVM_INCLUDE_TESTS) +- # Lit test suite requires at least python 3.6 +- set(LLVM_MINIMUM_PYTHON_VERSION 3.6) ++ # Lit test suite requires at least python 3.5 ++ set(LLVM_MINIMUM_PYTHON_VERSION 3.5) + else() + # FIXME: it is unknown if this is the actual minimum bound + set(LLVM_MINIMUM_PYTHON_VERSION 3.0) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/mesa-texture-failure.patch llvm-toolchain-11-11.1.0/debian/patches/mesa-texture-failure.patch --- llvm-toolchain-11-11.0.1/debian/patches/mesa-texture-failure.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/mesa-texture-failure.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,197 @@ +Description: This is a cherry-pick of upstream commits bf41c4d29e44 and c5a1eb9b0a76 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989545 +Index: llvm-toolchain-11-11.0.1/llvm/include/llvm/CodeGen/MachineOperand.h +=================================================================== +--- llvm-toolchain-11-11.0.1.orig/llvm/include/llvm/CodeGen/MachineOperand.h ++++ llvm-toolchain-11-11.0.1/llvm/include/llvm/CodeGen/MachineOperand.h +@@ -728,12 +728,12 @@ + /// ChangeToImmediate - Replace this operand with a new immediate operand of + /// the specified value. If an operand is known to be an immediate already, + /// the setImm method should be used. +- void ChangeToImmediate(int64_t ImmVal); ++ void ChangeToImmediate(int64_t ImmVal, unsigned TargetFlags = 0); + + /// ChangeToFPImmediate - Replace this operand with a new FP immediate operand + /// of the specified value. If an operand is known to be an FP immediate + /// already, the setFPImm method should be used. +- void ChangeToFPImmediate(const ConstantFP *FPImm); ++ void ChangeToFPImmediate(const ConstantFP *FPImm, unsigned TargetFlags = 0); + + /// ChangeToES - Replace this operand with a new external symbol operand. + void ChangeToES(const char *SymName, unsigned TargetFlags = 0); +@@ -743,10 +743,10 @@ + unsigned TargetFlags = 0); + + /// ChangeToMCSymbol - Replace this operand with a new MC symbol operand. +- void ChangeToMCSymbol(MCSymbol *Sym); ++ void ChangeToMCSymbol(MCSymbol *Sym, unsigned TargetFlags = 0); + + /// Replace this operand with a frame index. +- void ChangeToFrameIndex(int Idx); ++ void ChangeToFrameIndex(int Idx, unsigned TargetFlags = 0); + + /// Replace this operand with a target index. + void ChangeToTargetIndex(unsigned Idx, int64_t Offset, +Index: llvm-toolchain-11-11.0.1/llvm/lib/CodeGen/MachineOperand.cpp +=================================================================== +--- llvm-toolchain-11-11.0.1.orig/llvm/lib/CodeGen/MachineOperand.cpp ++++ llvm-toolchain-11-11.0.1/llvm/lib/CodeGen/MachineOperand.cpp +@@ -153,22 +153,25 @@ + /// ChangeToImmediate - Replace this operand with a new immediate operand of + /// the specified value. If an operand is known to be an immediate already, + /// the setImm method should be used. +-void MachineOperand::ChangeToImmediate(int64_t ImmVal) { ++void MachineOperand::ChangeToImmediate(int64_t ImmVal, unsigned TargetFlags) { + assert((!isReg() || !isTied()) && "Cannot change a tied operand into an imm"); + + removeRegFromUses(); + + OpKind = MO_Immediate; + Contents.ImmVal = ImmVal; ++ setTargetFlags(TargetFlags); + } + +-void MachineOperand::ChangeToFPImmediate(const ConstantFP *FPImm) { ++void MachineOperand::ChangeToFPImmediate(const ConstantFP *FPImm, ++ unsigned TargetFlags) { + assert((!isReg() || !isTied()) && "Cannot change a tied operand into an imm"); + + removeRegFromUses(); + + OpKind = MO_FPImmediate; + Contents.CFP = FPImm; ++ setTargetFlags(TargetFlags); + } + + void MachineOperand::ChangeToES(const char *SymName, +@@ -197,7 +200,7 @@ + setTargetFlags(TargetFlags); + } + +-void MachineOperand::ChangeToMCSymbol(MCSymbol *Sym) { ++void MachineOperand::ChangeToMCSymbol(MCSymbol *Sym, unsigned TargetFlags) { + assert((!isReg() || !isTied()) && + "Cannot change a tied operand into an MCSymbol"); + +@@ -205,9 +208,10 @@ + + OpKind = MO_MCSymbol; + Contents.Sym = Sym; ++ setTargetFlags(TargetFlags); + } + +-void MachineOperand::ChangeToFrameIndex(int Idx) { ++void MachineOperand::ChangeToFrameIndex(int Idx, unsigned TargetFlags) { + assert((!isReg() || !isTied()) && + "Cannot change a tied operand into a FrameIndex"); + +@@ -215,6 +219,7 @@ + + OpKind = MO_FrameIndex; + setIndex(Idx); ++ setTargetFlags(TargetFlags); + } + + void MachineOperand::ChangeToTargetIndex(unsigned Idx, int64_t Offset, +Index: llvm-toolchain-11-11.0.1/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp +=================================================================== +--- llvm-toolchain-11-11.0.1.orig/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp ++++ llvm-toolchain-11-11.0.1/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp +@@ -282,9 +282,6 @@ + assert(!Fold.needsShrink() && "not handled"); + + if (Fold.isImm()) { +- // FIXME: ChangeToImmediate should probably clear the subreg flags. It's +- // reinterpreted as TargetFlags. +- Old.setSubReg(0); + Old.ChangeToImmediate(Fold.ImmToFold); + return true; + } +@@ -819,8 +816,6 @@ + + UseMI->setDesc(TII->get(AMDGPU::S_MOV_B32)); + +- // FIXME: ChangeToImmediate should clear subreg +- UseMI->getOperand(1).setSubReg(0); + if (OpToFold.isImm()) + UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm()); + else +Index: llvm-toolchain-11-11.0.1/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +=================================================================== +--- llvm-toolchain-11-11.0.1.orig/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp ++++ llvm-toolchain-11-11.0.1/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +@@ -2588,7 +2588,6 @@ + + UseMI.setDesc(get(NewOpc)); + UseMI.getOperand(1).ChangeToImmediate(Imm.getSExtValue()); +- UseMI.getOperand(1).setTargetFlags(0); + UseMI.addImplicitDefUseOperands(*UseMI.getParent()->getParent()); + return true; + } +Index: llvm-toolchain-11-11.0.1/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp +=================================================================== +--- llvm-toolchain-11-11.0.1.orig/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp ++++ llvm-toolchain-11-11.0.1/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp +@@ -84,21 +84,19 @@ + MachineOperand &MovSrc = Def->getOperand(1); + bool ConstantFolded = false; + +- if (MovSrc.isImm() && (isInt<32>(MovSrc.getImm()) || +- isUInt<32>(MovSrc.getImm()))) { +- // It's possible to have only one component of a super-reg defined by +- // a single mov, so we need to clear any subregister flag. +- Src0.setSubReg(0); +- Src0.ChangeToImmediate(MovSrc.getImm()); +- ConstantFolded = true; +- } else if (MovSrc.isFI()) { +- Src0.setSubReg(0); +- Src0.ChangeToFrameIndex(MovSrc.getIndex()); +- ConstantFolded = true; +- } else if (MovSrc.isGlobal()) { +- Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(), +- MovSrc.getTargetFlags()); +- ConstantFolded = true; ++ if (TII->isOperandLegal(MI, Src0Idx, &MovSrc)) { ++ if (MovSrc.isImm() && ++ (isInt<32>(MovSrc.getImm()) || isUInt<32>(MovSrc.getImm()))) { ++ Src0.ChangeToImmediate(MovSrc.getImm()); ++ ConstantFolded = true; ++ } else if (MovSrc.isFI()) { ++ Src0.ChangeToFrameIndex(MovSrc.getIndex()); ++ ConstantFolded = true; ++ } else if (MovSrc.isGlobal()) { ++ Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(), ++ MovSrc.getTargetFlags()); ++ ConstantFolded = true; ++ } + } + + if (ConstantFolded) { +Index: llvm-toolchain-11-11.0.1/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir +=================================================================== +--- /dev/null ++++ llvm-toolchain-11-11.0.1/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir +@@ -0,0 +1,23 @@ ++# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-shrink-instructions --verify-machineinstrs %s -o - | FileCheck %s ++ ++# Make sure immediate folding into V_CNDMASK respects constant bus restrictions. ++--- ++ ++name: shrink_cndmask_illegal_imm_folding ++tracksRegLiveness: true ++body: | ++ bb.0: ++ liveins: $vgpr0, $vgpr1 ++ ; CHECK-LABEL: name: shrink_cndmask_illegal_imm_folding ++ ; CHECK: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 ++ ; CHECK: [[MOV:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec ++ ; CHECK: V_CMP_EQ_U32_e32 0, [[COPY]], implicit-def $vcc, implicit $exec ++ ; CHECK: V_CNDMASK_B32_e32 [[MOV]], killed [[COPY]], implicit $vcc, implicit $exec ++ ++ %0:vgpr_32 = COPY $vgpr0 ++ %1:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec ++ V_CMP_EQ_U32_e32 0, %0:vgpr_32, implicit-def $vcc, implicit $exec ++ %2:vgpr_32 = V_CNDMASK_B32_e64 0, %1:vgpr_32, 0, killed %0:vgpr_32, $vcc, implicit $exec ++ S_NOP 0 ++ ++... diff -Nru llvm-toolchain-11-11.0.1/debian/patches/mips/mips-D101773-reloc.patch llvm-toolchain-11-11.1.0/debian/patches/mips/mips-D101773-reloc.patch --- llvm-toolchain-11-11.0.1/debian/patches/mips/mips-D101773-reloc.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/mips/mips-D101773-reloc.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,48 @@ +From ab40c027f0ce9492919a72ad339de40bdb84b354 Mon Sep 17 00:00:00 2001 +From: Dimitry Andric +Date: Mon, 3 May 2021 20:08:49 +0200 +Subject: [PATCH] [MC][ELF] Work around R_MIPS_LO16 relocation handling problem + +This fixes PR49821, and avoids "ld.lld: error: test.o:(.rodata.str1.1): +offset is outside the section" errors when linking MIPS objects with +negative R_MIPS_LO16 implicit addends. + +ld.lld handles R_MIPS_HI16/R_MIPS_LO16 separately, not as a whole, so it +doesn't know that an R_MIPS_HI16 with implicit addend 1 and an +R_MIPS_LO16 with implicit addend -32768 represents 32768, which is in +range of a MergeInputSection. We could introduce a new RelExpr member +(like R_RISCV_PC_INDIRECT for R_RISCV_PCREL_HI20 / R_RISCV_PCREL_LO12) +but the complexity is unnecessary given that GNU as keeps the original +symbol for this case as well. + +Reviewed By: atanasyan, MaskRay + +Differential Revision: https://reviews.llvm.org/D101773 +--- + llvm/lib/MC/ELFObjectWriter.cpp | 11 +++++++++++ + llvm/test/MC/Mips/mips_lo16.s | 22 ++++++++++++++++++++++ + 2 files changed, 33 insertions(+) + create mode 100644 llvm/test/MC/Mips/mips_lo16.s + +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/lib/MC/ELFObjectWriter.cpp +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/llvm/lib/MC/ELFObjectWriter.cpp ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/llvm/lib/MC/ELFObjectWriter.cpp +@@ -1376,6 +1376,17 @@ bool ELFObjectWriter::shouldRelocateWith + if (TargetObjectWriter->getEMachine() == ELF::EM_MIPS && + !hasRelocationAddend()) + return true; ++ ++ // ld.lld handles R_MIPS_HI16/R_MIPS_LO16 separately, not as a whole, so ++ // it doesn't know that an R_MIPS_HI16 with implicit addend 1 and an ++ // R_MIPS_LO16 with implicit addend -32768 represents 32768, which is in ++ // range of a MergeInputSection. We could introduce a new RelExpr member ++ // (like R_RISCV_PC_INDIRECT for R_RISCV_PCREL_HI20 / R_RISCV_PCREL_LO12) ++ // but the complexity is unnecessary given that GNU as keeps the original ++ // symbol for this case as well. ++ if (TargetObjectWriter->getEMachine() == ELF::EM_MIPS && ++ !hasRelocationAddend()) ++ return true; + } + + // Most TLS relocations use a got, so they need the symbol. Even those that diff -Nru llvm-toolchain-11-11.0.1/debian/patches/mips/mips-force-nomadd4.patch llvm-toolchain-11-11.1.0/debian/patches/mips/mips-force-nomadd4.patch --- llvm-toolchain-11-11.0.1/debian/patches/mips/mips-force-nomadd4.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/mips/mips-force-nomadd4.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,66 @@ +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. + +Index: llvm-toolchain-snapshot_14~++20211003054316+d6482df683b9/clang/lib/Basic/Targets/Mips.h +=================================================================== +--- llvm-toolchain-snapshot_14~++20211003054316+d6482df683b9.orig/clang/lib/Basic/Targets/Mips.h ++++ llvm-toolchain-snapshot_14~++20211003054316+d6482df683b9/clang/lib/Basic/Targets/Mips.h +@@ -332,6 +332,8 @@ public: + HasMSA = true; + else if (Feature == "+nomadd4") + DisableMadd4 = true; ++ else if (Feature == "-nomadd4") ++ DisableMadd4 = false; + else if (Feature == "+fp64") + FPMode = FP64; + else if (Feature == "-fp64") +Index: llvm-toolchain-snapshot_14~++20211003054316+d6482df683b9/llvm/lib/Target/Mips/MipsSubtarget.cpp +=================================================================== +--- llvm-toolchain-snapshot_14~++20211003054316+d6482df683b9.orig/llvm/lib/Target/Mips/MipsSubtarget.cpp ++++ llvm-toolchain-snapshot_14~++20211003054316+d6482df683b9/llvm/lib/Target/Mips/MipsSubtarget.cpp +@@ -80,7 +80,7 @@ MipsSubtarget::MipsSubtarget(const Tripl + InMips16HardFloat(Mips16HardFloat), InMicroMipsMode(false), HasDSP(false), + HasDSPR2(false), HasDSPR3(false), AllowMixed16_32(Mixed16_32 || Mips_Os16), + Os16(Mips_Os16), HasMSA(false), UseTCCInDIV(false), HasSym32(false), +- HasEVA(false), DisableMadd4(false), HasMT(false), HasCRC(false), ++ HasEVA(false), DisableMadd4(true), HasMT(false), HasCRC(false), + HasVirt(false), HasGINV(false), UseIndirectJumpsHazard(false), + StackAlignOverride(StackAlignOverride), TM(TM), TargetTriple(TT), + TSInfo(), InstrInfo(MipsInstrInfo::create( +@@ -91,6 +91,9 @@ MipsSubtarget::MipsSubtarget(const Tripl + if (MipsArchVersion == MipsDefault) + MipsArchVersion = Mips32; + ++ if (hasMips32r6() || hasMips64r6()) ++ DisableMadd4 = false; ++ + // Don't even attempt to generate code for MIPS-I and MIPS-V. They have not + // been tested and currently exist for the integrated assembler only. + if (MipsArchVersion == Mips1) +@@ -238,6 +241,7 @@ MipsSubtarget & + MipsSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS, + const TargetMachine &TM) { + StringRef CPUName = MIPS_MC::selectMipsCPU(TM.getTargetTriple(), CPU); ++ SubtargetFeatures Features(FS); + + // Parse features string. + ParseSubtargetFeatures(CPUName, /*TuneCPU*/ CPUName, FS); +@@ -260,6 +264,13 @@ MipsSubtarget::initializeSubtargetDepend + report_fatal_error("64-bit code requested on a subtarget that doesn't " + "support it!"); + ++ for (const std::string &Feature : Features.getFeatures()) { ++ if (Feature == "+nomadd4") ++ DisableMadd4 = true; ++ else if (Feature == "-nomadd4") ++ DisableMadd4 = false; ++ } ++ + return *this; + } + diff -Nru llvm-toolchain-11-11.0.1/debian/patches/mips/mips-fpxx-enable.diff llvm-toolchain-11-11.1.0/debian/patches/mips/mips-fpxx-enable.diff --- llvm-toolchain-11-11.0.1/debian/patches/mips/mips-fpxx-enable.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/mips/mips-fpxx-enable.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,17 @@ +Index: llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/clang/lib/Driver/ToolChains/Arch/Mips.cpp +=================================================================== +--- llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415.orig/clang/lib/Driver/ToolChains/Arch/Mips.cpp ++++ llvm-toolchain-snapshot_14~++20211114120952+5b4bfd8c2415/clang/lib/Driver/ToolChains/Arch/Mips.cpp +@@ -467,10 +467,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 -Nru llvm-toolchain-11-11.0.1/debian/patches/omp-riscv64.patch llvm-toolchain-11-11.1.0/debian/patches/omp-riscv64.patch --- llvm-toolchain-11-11.0.1/debian/patches/omp-riscv64.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/omp-riscv64.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,23 @@ +Description: Define the affinity for riscv64 +Last-Update: 2021-08-27 + +--- llvm-toolchain-12-12.0.1.orig/openmp/runtime/src/kmp_affinity.h ++++ llvm-toolchain-12-12.0.1/openmp/runtime/src/kmp_affinity.h +@@ -209,6 +209,17 @@ public: + #elif __NR_sched_getaffinity != 123 + #error Wrong code for getaffinity system call. + #endif /* __NR_sched_getaffinity */ ++#elif KMP_ARCH_RISCV64 ++#ifndef __NR_sched_setaffinity ++#define __NR_sched_setaffinity 122 ++#elif __NR_sched_setaffinity != 122 ++#error Wrong code for setaffinity system call. ++#endif /* __NR_sched_setaffinity */ ++#ifndef __NR_sched_getaffinity ++#define __NR_sched_getaffinity 123 ++#elif __NR_sched_getaffinity != 123 ++#error Wrong code for getaffinity system call. ++#endif /* __NR_sched_getaffinity */ + #elif KMP_ARCH_X86_64 + #ifndef __NR_sched_setaffinity + #define __NR_sched_setaffinity 203 diff -Nru llvm-toolchain-11-11.0.1/debian/patches/openmp-fix-runtimes-build.diff llvm-toolchain-11-11.1.0/debian/patches/openmp-fix-runtimes-build.diff --- llvm-toolchain-11-11.0.1/debian/patches/openmp-fix-runtimes-build.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/openmp-fix-runtimes-build.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,146 @@ +include required runtimes as dependencies to openmp targets to make sure +they are built first when included as part of a runtimes build since openmp +can depend on them +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/llvm/runtimes/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/llvm/runtimes/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/llvm/runtimes/CMakeLists.txt +@@ -236,6 +236,7 @@ function(runtime_default_target) + -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} + -DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS} ++ -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} + -DCMAKE_C_COMPILER_WORKS=ON + -DCMAKE_CXX_COMPILER_WORKS=ON + -DCMAKE_ASM_COMPILER_WORKS=ON +@@ -454,7 +455,7 @@ if(runtimes) + # build directory cannot find the C++ headers in certain configurations. + # I need to build a mechanism for runtime projects to provide CMake code + # that executes at LLVM configuration time to handle this case. +- add_dependencies(clang-bootstrap-deps runtimes-configure) ++ #add_dependencies(clang-bootstrap-deps runtimes-configure) + # We need to add the runtimes as a dependency because compiler-rt can be + # built as part of runtimes and we need the profile runtime for PGO + add_dependencies(clang-bootstrap-deps runtimes) +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/CMakeLists.txt +@@ -67,6 +67,28 @@ option(OPENMP_ENABLE_LIBOMPTARGET_PROFIL + ${ENABLE_LIBOMPTARGET}) + option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF) + ++option(OPENMP_USE_LLVM_UNWINDER "Build and use the LLVM unwinder" OFF) ++ ++option(LIBOMP_ENABLE_RTTI "Enabling RTTI forces libomp to be a c++ lib" ${LLVM_ENABLE_RTTI}) ++ ++macro(add_runtimes_build_depends_if_needed target) ++ if(RUNTIMES_BUILD) ++ # required for rtti and libomp/libomptarget profiling if enabled ++ add_dependencies(${target} cxx-headers cxxabi_static cxx_static cxxabi_shared cxx_shared) ++ if(OPENMP_USE_LLVM_UNWINDER AND (NOT target STREQUAL "omp" AND NOT LIBOMP_ENABLE_RTTI)) ++ add_dependencies(${target} unwind_static unwind_shared) ++ get_target_property(target_link_flags ${target} LINK_FLAGS) ++ set(runtimes_link_flags "-lunwind") ++ if(target_link_flags) ++ set(runtimes_link_flags "${target_link_flags} -lunwind") ++ endif() ++ set_target_properties(${target} ++ PROPERTIES ++ LINK_FLAGS "${runtimes_link_flags}") ++ endif() ++ endif() ++endmacro() ++ + # Build host runtime library, after LIBOMPTARGET variables are set since they are needed + # to enable time profiling support in the OpenMP runtime. + add_subdirectory(runtime) +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/libomptarget/plugins/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/CMakeLists.txt +@@ -36,6 +36,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tma + add_library("omptarget.rtl.${tmachine_libname}" SHARED + ${CMAKE_CURRENT_SOURCE_DIR}/../generic-elf-64bit/src/rtl.cpp) + ++ add_runtimes_build_depends_if_needed("omptarget.rtl.${tmachine_libname}") ++ + # Install plugin under the lib destination folder. + install(TARGETS "omptarget.rtl.${tmachine_libname}" + LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/cuda/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/libomptarget/plugins/cuda/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/cuda/CMakeLists.txt +@@ -47,6 +47,8 @@ else() + set (LIBOMPTARGET_DEP_LIBRARIES ${CMAKE_DL_LIBS}) + endif() + ++add_runtimes_build_depends_if_needed(omptarget.rtl.cuda) ++ + # Install plugin under the lib destination folder. + install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") + +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/src/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/libomptarget/src/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/src/CMakeLists.txt +@@ -39,6 +39,8 @@ target_link_libraries(omptarget PRIVATE + ${CMAKE_DL_LIBS} + "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports") + ++add_runtimes_build_depends_if_needed(omptarget) ++ + # Install libomptarget under the lib destination folder. + install(TARGETS omptarget LIBRARY COMPONENT omptarget + DESTINATION "${OPENMP_INSTALL_LIBDIR}") +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/runtime/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/CMakeLists.txt +@@ -287,6 +287,10 @@ if(LIBOMP_STATS) + set(LIBOMP_USE_STDCPPLIB TRUE) + endif() + ++if(LIBOMP_ENABLE_RTTI) ++ set(LIBOMP_USE_STDCPPLIB TRUE) ++endif() ++ + # Shared library can be switched to a static library + set(LIBOMP_ENABLE_SHARED TRUE CACHE BOOL + "Shared library instead of static library?") +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/src/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/runtime/src/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/src/CMakeLists.txt +@@ -136,6 +136,7 @@ endif() + if(NOT ${LIBOMP_USE_STDCPPLIB}) + set(LIBOMP_LINKER_LANGUAGE C) + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES) ++ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") + else() + set(LIBOMP_LINKER_LANGUAGE CXX) + endif() +@@ -186,6 +187,8 @@ else() + ) + endif() + ++add_runtimes_build_depends_if_needed(omp) ++ + # Get the library's location within the build tree for the unit tester + if(NOT WIN32) + get_target_property(LIBOMP_LIBRARY_DIR omp LIBRARY_OUTPUT_DIRECTORY) +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/tools/archer/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/tools/archer/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/tools/archer/CMakeLists.txt +@@ -14,6 +14,9 @@ if(LIBOMP_OMPT_SUPPORT) + add_library(archer SHARED ompt-tsan.cpp) + add_library(archer_static STATIC ompt-tsan.cpp) + ++ add_runtimes_build_depends_if_needed(archer) ++ add_runtimes_build_depends_if_needed(archer_static) ++ + install(TARGETS archer archer_static + LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/remove-cyclades.diff llvm-toolchain-11-11.1.0/debian/patches/remove-cyclades.diff --- llvm-toolchain-11-11.0.1/debian/patches/remove-cyclades.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/remove-cyclades.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,110 @@ +commit 68d5235cb58f988c71b403334cd9482d663841ab +Author: Tamar Christina +Date: Thu May 20 18:55:11 2021 +0100 + + libsanitizer: Remove cyclades inclusion in sanitizer + + The Linux kernel has removed the interface to cyclades from + the latest kernel headers[1] due to them being orphaned for the + past 13 years. + + libsanitizer uses this header when compiling against glibc, but + glibcs itself doesn't seem to have any references to cyclades. + + Further more it seems that the driver is broken in the kernel and + the firmware doesn't seem to be available anymore. + + As such since this is breaking the build of libsanitizer (and so the + GCC bootstrap[2]) I propose to remove this. + + [1] https://lkml.org/lkml/2021/3/2/153 + [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379 + + Reviewed By: eugenis + + Differential Revision: https://reviews.llvm.org/D102059 + +Index: llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc ++++ llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +@@ -366,15 +366,6 @@ static void ioctl_table_fill() { + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE +- _(CYGETDEFTHRESH, WRITE, sizeof(int)); +- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); +- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); +- _(CYGETTHRESH, WRITE, sizeof(int)); +- _(CYGETTIMEOUT, WRITE, sizeof(int)); +- _(CYSETDEFTHRESH, NONE, 0); +- _(CYSETDEFTIMEOUT, NONE, 0); +- _(CYSETTHRESH, NONE, 0); +- _(CYSETTIMEOUT, NONE, 0); + _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); + _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); + _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); +Index: llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -130,7 +130,6 @@ typedef struct user_fpregs elf_fpregset_ + # include + #endif + #include +-#include + #include + #include + #include +@@ -444,7 +443,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); +- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); + #if EV_VERSION > (0x010000) + unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); + #else +@@ -810,15 +808,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El + #endif // SANITIZER_LINUX + + #if SANITIZER_LINUX && !SANITIZER_ANDROID +- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; +- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; +- unsigned IOCTL_CYGETMON = CYGETMON; +- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; +- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; +- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; +- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; +- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; +- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; + unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; + unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; + unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; +Index: llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +=================================================================== +--- llvm-toolchain-11-11.1.0.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -981,7 +981,6 @@ extern unsigned struct_vt_mode_sz; + + #if SANITIZER_LINUX && !SANITIZER_ANDROID + extern unsigned struct_ax25_parms_struct_sz; +-extern unsigned struct_cyclades_monitor_sz; + extern unsigned struct_input_keymap_entry_sz; + extern unsigned struct_ipx_config_data_sz; + extern unsigned struct_kbdiacrs_sz; +@@ -1326,15 +1325,6 @@ extern unsigned IOCTL_VT_WAITACTIVE; + #endif // SANITIZER_LINUX + + #if SANITIZER_LINUX && !SANITIZER_ANDROID +-extern unsigned IOCTL_CYGETDEFTHRESH; +-extern unsigned IOCTL_CYGETDEFTIMEOUT; +-extern unsigned IOCTL_CYGETMON; +-extern unsigned IOCTL_CYGETTHRESH; +-extern unsigned IOCTL_CYGETTIMEOUT; +-extern unsigned IOCTL_CYSETDEFTHRESH; +-extern unsigned IOCTL_CYSETDEFTIMEOUT; +-extern unsigned IOCTL_CYSETTHRESH; +-extern unsigned IOCTL_CYSETTIMEOUT; + extern unsigned IOCTL_EQL_EMANCIPATE; + extern unsigned IOCTL_EQL_ENSLAVE; + extern unsigned IOCTL_EQL_GETMASTRCFG; diff -Nru llvm-toolchain-11-11.0.1/debian/patches/revert-abi-change-clang.diff llvm-toolchain-11-11.1.0/debian/patches/revert-abi-change-clang.diff --- llvm-toolchain-11-11.0.1/debian/patches/revert-abi-change-clang.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/revert-abi-change-clang.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,187 @@ +commit 9bbcb554cdbf1a7b85e9a72169e4037cf4736a10 +Author: Marco Antognini +Date: Thu Oct 29 10:30:11 2020 +0000 + + Address ABI issues introduced with CXCursor_CXXAddrspaceCastExpr + + Revert values in CXCursorKind as they were before + CXCursor_CXXAddrspaceCastExpr was introduced in a6a237f2046a ([OpenCL] + Added addrspace_cast operator in C++ mode., 2020-05-18). + + Insert CXCursor_CXXAddrspaceCastExpr after the last expression in + CXCursorKind using the next available value. + + Reviewed By: akyrtzi, svenvh + + Differential Revision: https://reviews.llvm.org/D90385 + + (cherry picked from commit bbdbd020d2c2f315ed1545b23c23ec6ff1abc022) + +Index: llvm-toolchain-11_11.1.0/clang/include/clang-c/Index.h +=================================================================== +--- llvm-toolchain-11_11.1.0.orig/clang/include/clang-c/Index.h ++++ llvm-toolchain-11_11.1.0/clang/include/clang-c/Index.h +@@ -33,7 +33,7 @@ + * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. + */ + #define CINDEX_VERSION_MAJOR 0 +-#define CINDEX_VERSION_MINOR 61 ++#define CINDEX_VERSION_MINOR 60 + + #define CINDEX_VERSION_ENCODE(major, minor) (((major)*10000) + ((minor)*1)) + +@@ -2052,58 +2052,62 @@ enum CXCursorKind { + */ + CXCursor_CXXFunctionalCastExpr = 128, + ++ /** OpenCL's addrspace_cast<> expression. ++ */ ++ CXCursor_CXXAddrspaceCastExpr = 129, ++ + /** A C++ typeid expression (C++ [expr.typeid]). + */ +- CXCursor_CXXTypeidExpr = 129, ++ CXCursor_CXXTypeidExpr = 130, + + /** [C++ 2.13.5] C++ Boolean Literal. + */ +- CXCursor_CXXBoolLiteralExpr = 130, ++ CXCursor_CXXBoolLiteralExpr = 131, + + /** [C++0x 2.14.7] C++ Pointer Literal. + */ +- CXCursor_CXXNullPtrLiteralExpr = 131, ++ CXCursor_CXXNullPtrLiteralExpr = 132, + + /** Represents the "this" expression in C++ + */ +- CXCursor_CXXThisExpr = 132, ++ CXCursor_CXXThisExpr = 133, + + /** [C++ 15] C++ Throw Expression. + * + * This handles 'throw' and 'throw' assignment-expression. When + * assignment-expression isn't present, Op will be null. + */ +- CXCursor_CXXThrowExpr = 133, ++ CXCursor_CXXThrowExpr = 134, + + /** A new expression for memory allocation and constructor calls, e.g: + * "new CXXNewExpr(foo)". + */ +- CXCursor_CXXNewExpr = 134, ++ CXCursor_CXXNewExpr = 135, + + /** A delete expression for memory deallocation and destructor calls, + * e.g. "delete[] pArray". + */ +- CXCursor_CXXDeleteExpr = 135, ++ CXCursor_CXXDeleteExpr = 136, + + /** A unary expression. (noexcept, sizeof, or other traits) + */ +- CXCursor_UnaryExpr = 136, ++ CXCursor_UnaryExpr = 137, + + /** An Objective-C string literal i.e. @"foo". + */ +- CXCursor_ObjCStringLiteral = 137, ++ CXCursor_ObjCStringLiteral = 138, + + /** An Objective-C \@encode expression. + */ +- CXCursor_ObjCEncodeExpr = 138, ++ CXCursor_ObjCEncodeExpr = 139, + + /** An Objective-C \@selector expression. + */ +- CXCursor_ObjCSelectorExpr = 139, ++ CXCursor_ObjCSelectorExpr = 140, + + /** An Objective-C \@protocol expression. + */ +- CXCursor_ObjCProtocolExpr = 140, ++ CXCursor_ObjCProtocolExpr = 141, + + /** An Objective-C "bridged" cast expression, which casts between + * Objective-C pointers and C pointers, transferring ownership in the process. +@@ -2112,7 +2116,7 @@ enum CXCursorKind { + * NSString *str = (__bridge_transfer NSString *)CFCreateString(); + * \endcode + */ +- CXCursor_ObjCBridgedCastExpr = 141, ++ CXCursor_ObjCBridgedCastExpr = 142, + + /** Represents a C++0x pack expansion that produces a sequence of + * expressions. +@@ -2127,7 +2131,7 @@ enum CXCursorKind { + * } + * \endcode + */ +- CXCursor_PackExpansionExpr = 142, ++ CXCursor_PackExpansionExpr = 143, + + /** Represents an expression that computes the length of a parameter + * pack. +@@ -2139,7 +2143,7 @@ enum CXCursorKind { + * }; + * \endcode + */ +- CXCursor_SizeOfPackExpr = 143, ++ CXCursor_SizeOfPackExpr = 144, + + /* Represents a C++ lambda expression that produces a local function + * object. +@@ -2153,43 +2157,39 @@ enum CXCursorKind { + * } + * \endcode + */ +- CXCursor_LambdaExpr = 144, ++ CXCursor_LambdaExpr = 145, + + /** Objective-c Boolean Literal. + */ +- CXCursor_ObjCBoolLiteralExpr = 145, ++ CXCursor_ObjCBoolLiteralExpr = 146, + + /** Represents the "self" expression in an Objective-C method. + */ +- CXCursor_ObjCSelfExpr = 146, ++ CXCursor_ObjCSelfExpr = 147, + + /** OpenMP 5.0 [2.1.5, Array Section]. + */ +- CXCursor_OMPArraySectionExpr = 147, ++ CXCursor_OMPArraySectionExpr = 148, + + /** Represents an @available(...) check. + */ +- CXCursor_ObjCAvailabilityCheckExpr = 148, ++ CXCursor_ObjCAvailabilityCheckExpr = 149, + + /** + * Fixed point literal + */ +- CXCursor_FixedPointLiteral = 149, ++ CXCursor_FixedPointLiteral = 150, + + /** OpenMP 5.0 [2.1.4, Array Shaping]. + */ +- CXCursor_OMPArrayShapingExpr = 150, ++ CXCursor_OMPArrayShapingExpr = 151, + + /** + * OpenMP 5.0 [2.1.6 Iterators] + */ +- CXCursor_OMPIteratorExpr = 151, +- +- /** OpenCL's addrspace_cast<> expression. +- */ +- CXCursor_CXXAddrspaceCastExpr = 152, ++ CXCursor_OMPIteratorExpr = 152, + +- CXCursor_LastExpr = CXCursor_CXXAddrspaceCastExpr, ++ CXCursor_LastExpr = CXCursor_OMPIteratorExpr, + + /* Statements */ + CXCursor_FirstStmt = 200, diff -Nru llvm-toolchain-11-11.0.1/debian/patches/scan-build-py-fix-analyze-path.diff llvm-toolchain-11-11.1.0/debian/patches/scan-build-py-fix-analyze-path.diff --- llvm-toolchain-11-11.0.1/debian/patches/scan-build-py-fix-analyze-path.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/scan-build-py-fix-analyze-path.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,15 @@ +Index: llvm-toolchain-11-11.0.1/clang/tools/scan-build-py/libscanbuild/analyze.py +=================================================================== +--- llvm-toolchain-11-11.0.1.orig/clang/tools/scan-build-py/libscanbuild/analyze.py ++++ llvm-toolchain-11-11.0.1/clang/tools/scan-build-py/libscanbuild/analyze.py +@@ -39,8 +39,8 @@ from libscanbuild.shell import decode + + __all__ = ['scan_build', 'analyze_build', 'analyze_compiler_wrapper'] + +-COMPILER_WRAPPER_CC = 'analyze-cc' +-COMPILER_WRAPPER_CXX = 'analyze-c++' ++COMPILER_WRAPPER_CC = '/usr/share/clang/scan-build-py-11/bin/analyze-cc' ++COMPILER_WRAPPER_CXX = '/usr/share/clang/scan-build-py-11/bin/analyze-c++' + + CTU_EXTDEF_MAP_FILENAME = 'externalDefMap.txt' + CTU_TEMP_DEFMAP_FOLDER = 'tmpExternalDefMaps' diff -Nru llvm-toolchain-11-11.0.1/debian/patches/scan-build-py-fix-default-bin.diff llvm-toolchain-11-11.1.0/debian/patches/scan-build-py-fix-default-bin.diff --- llvm-toolchain-11-11.0.1/debian/patches/scan-build-py-fix-default-bin.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/scan-build-py-fix-default-bin.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,13 @@ +Index: llvm-toolchain-12-12.0.0/clang/tools/scan-build-py/libscanbuild/arguments.py +=================================================================== +--- llvm-toolchain-12-12.0.0.orig/clang/tools/scan-build-py/libscanbuild/arguments.py ++++ llvm-toolchain-12-12.0.0/clang/tools/scan-build-py/libscanbuild/arguments.py +@@ -250,7 +250,7 @@ def create_analyze_parser(from_build_com + '--use-analyzer', + metavar='', + dest='clang', +- default='clang', ++ default='clang-11', + help="""'%(prog)s' uses the 'clang' executable relative to itself for + static analysis. One can override this behavior with this option by + using the 'clang' packaged with Xcode (on OS X) or from the PATH.""") diff -Nru llvm-toolchain-11-11.0.1/debian/patches/series llvm-toolchain-11-11.1.0/debian/patches/series --- llvm-toolchain-11-11.0.1/debian/patches/series 2021-08-10 00:05:15.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/series 2022-01-24 08:15:24.000000000 +0000 @@ -140,6 +140,12 @@ print-lldb-path.patch libcxx-armhf-ftbfs.diff silent-integration-test-suite-i386.diff +0001-Add-minor-version-to-libclang.so-and-libclang-cpp.so.patch +revert-abi-change-clang.diff +scan-build-py-fix-analyze-path.diff +D91833-bpftrace-fix-code-gen.diff +scan-build-py-fix-default-bin.diff +mesa-texture-failure.patch +remove-cyclades.diff D99501-ignore-lto-auto.diff -libsanitizer-remove-cyclades.patch fix-missing-include-limit.patch diff -Nru llvm-toolchain-11-11.0.1/debian/patches/silent-integration-test-suite-i386.diff llvm-toolchain-11-11.1.0/debian/patches/silent-integration-test-suite-i386.diff --- llvm-toolchain-11-11.0.1/debian/patches/silent-integration-test-suite-i386.diff 2020-11-12 10:01:56.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/silent-integration-test-suite-i386.diff 2022-01-24 08:15:24.000000000 +0000 @@ -1,7 +1,7 @@ -Index: llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/basic_lldb.c +Index: llvm-toolchain-11-11.1.0/integration-test-suite/tests/basic_lldb.c =================================================================== ---- llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c.orig/integration-test-suite/tests/basic_lldb.c -+++ llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/basic_lldb.c +--- llvm-toolchain-11-11.1.0.orig/integration-test-suite/tests/basic_lldb.c ++++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/basic_lldb.c @@ -1,6 +1,7 @@ // RUN: %clang -g -o %t %s // RUN: %lldb -s %S/basic_lldb.in %t | grep "main at basic_lldb.c:" @@ -10,10 +10,10 @@ int main() { int a=0; -Index: llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/basic_lldb2.cpp +Index: llvm-toolchain-11-11.1.0/integration-test-suite/tests/basic_lldb2.cpp =================================================================== ---- llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c.orig/integration-test-suite/tests/basic_lldb2.cpp -+++ llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/basic_lldb2.cpp +--- llvm-toolchain-11-11.1.0.orig/integration-test-suite/tests/basic_lldb2.cpp ++++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/basic_lldb2.cpp @@ -1,6 +1,7 @@ // RUN: %clangxx -g -o %t %s // RUN: %lldb -s %S/basic_lldb2.in %t | grep "stop reason = step over" @@ -22,10 +22,10 @@ #include int main (void) -Index: llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/test_asan_lc.c +Index: llvm-toolchain-11-11.1.0/integration-test-suite/tests/test_asan_lc.c =================================================================== ---- llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c.orig/integration-test-suite/tests/test_asan_lc.c -+++ llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/test_asan_lc.c +--- llvm-toolchain-11-11.1.0.orig/integration-test-suite/tests/test_asan_lc.c ++++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/test_asan_lc.c @@ -3,6 +3,7 @@ // REQUIRES: clang // RUN: %clang -fsanitize=address %s -o %t -lc @@ -34,16 +34,3 @@ #include int main(int argc, char **argv) -Index: llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/test_tsan.c -=================================================================== ---- llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c.orig/integration-test-suite/tests/test_tsan.c -+++ llvm-toolchain-11_11.0.1~++20201112101029+0874e7ef66c/integration-test-suite/tests/test_tsan.c -@@ -5,7 +5,7 @@ - // RUN: %llvm-nm %t | grep __tsan - // RUN: env TSAN_OPTIONS="log_path=stdout:exitcode=0" %t 2>&1 > %t.out - // RUN: grep -q "data race" %t.out --// XFAIL: arm -+// XFAIL: arm, i686, i386 - - #include - #include diff -Nru llvm-toolchain-11-11.0.1/debian/patches/sparc/sparc-D98574-clang-def.patch llvm-toolchain-11-11.1.0/debian/patches/sparc/sparc-D98574-clang-def.patch --- llvm-toolchain-11-11.0.1/debian/patches/sparc/sparc-D98574-clang-def.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/sparc/sparc-D98574-clang-def.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,3762 @@ +--- llvm-toolchain-12-12.0.1~+rc1.orig/clang/lib/Basic/Targets/Sparc.cpp ++++ llvm-toolchain-12-12.0.1~+rc1/clang/lib/Basic/Targets/Sparc.cpp +@@ -156,8 +156,6 @@ void SparcV8TargetInfo::getTargetDefines + Builder.defineMacro("__sparcv8__"); + break; + case CG_V9: +- Builder.defineMacro("__sparcv9"); +- Builder.defineMacro("__sparcv9__"); + Builder.defineMacro("__sparc_v9__"); + break; + } +@@ -239,13 +237,25 @@ void SparcV8TargetInfo::getTargetDefines + void SparcV9TargetInfo::getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const { + SparcTargetInfo::getTargetDefines(Opts, Builder); +- Builder.defineMacro("__sparcv9"); + Builder.defineMacro("__arch64__"); +- // Solaris doesn't need these variants, but the BSDs do. +- if (getTriple().getOS() != llvm::Triple::Solaris) { ++ switch (getTriple().getOS()) { ++ case llvm::Triple::Linux: ++ Builder.defineMacro("__sparc_v9__"); ++ break; ++ case llvm::Triple::FreeBSD: ++ case llvm::Triple::NetBSD: + Builder.defineMacro("__sparc64__"); + Builder.defineMacro("__sparc_v9__"); ++ Builder.defineMacro("__sparcv9"); ++ break; ++ case llvm::Triple::OpenBSD: ++ Builder.defineMacro("__sparc64__"); + Builder.defineMacro("__sparcv9__"); ++ Builder.defineMacro("__sparc_v9__"); ++ break; ++ case llvm::Triple::Solaris: ++ Builder.defineMacro("__sparcv9"); ++ break; + } + + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); +--- llvm-toolchain-12-12.0.1~+rc1.orig/clang/test/Preprocessor/predefined-arch-macros.c ++++ llvm-toolchain-12-12.0.1~+rc1/clang/test/Preprocessor/predefined-arch-macros.c +@@ -3418,11 +3418,8 @@ + // CHECK_SPARC: #define __BIG_ENDIAN__ 1 + // CHECK_SPARC: #define __sparc 1 + // CHECK_SPARC: #define __sparc__ 1 +-// CHECK_SPARC-NOT: #define __sparcv9 1 +-// CHECK_SPARC-NOT: #define __sparcv9__ 1 + // CHECK_SPARC: #define __sparcv8 1 +-// CHECK_SPARC-NOT: #define __sparcv9 1 +-// CHECK_SPARC-NOT: #define __sparcv9__ 1 ++// CHECK_SPARC-NOT: #define __sparc_v9__ 1 + + // RUN: %clang -mcpu=v9 -E -dM %s -o - 2>&1 \ + // RUN: -target sparc-unknown-linux \ +@@ -3430,8 +3427,6 @@ + // CHECK_SPARC-V9-NOT: #define __sparcv8 1 + // CHECK_SPARC-V9-NOT: #define __sparcv8__ 1 + // CHECK_SPARC-V9: #define __sparc_v9__ 1 +-// CHECK_SPARC-V9: #define __sparcv9 1 +-// CHECK_SPARC-V9: #define __sparcv9__ 1 + + // RUN: %clang -E -dM %s -o - 2>&1 \ + // RUN: -target sparc-sun-solaris \ +@@ -3518,12 +3513,10 @@ + // RUN: -target sparcv9-unknown-linux \ + // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARCV9 + // CHECK_SPARCV9: #define __BIG_ENDIAN__ 1 ++// CHECK_SPARCV9: #define __arch64__ 1 + // CHECK_SPARCV9: #define __sparc 1 +-// CHECK_SPARCV9: #define __sparc64__ 1 + // CHECK_SPARCV9: #define __sparc__ 1 + // CHECK_SPARCV9: #define __sparc_v9__ 1 +-// CHECK_SPARCV9: #define __sparcv9 1 +-// CHECK_SPARCV9: #define __sparcv9__ 1 + + // RUN: %clang -E -dM %s -o - 2>&1 \ + // RUN: -target sparcv9-unknown-linux \ +--- /dev/null ++++ llvm-toolchain-12-12.0.1~+rc1/clang/test/Preprocessor/predefined-arch-macros.c.orig +@@ -0,0 +1,3681 @@ ++// REQUIRES: amdgpu-registered-target ++// Begin X86/GCC/Linux tests ---------------- ++ ++// RUN: %clang -march=i386 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I386_M32 ++// CHECK_I386_M32: #define __LAHF_SAHF__ 1 ++// CHECK_I386_M32: #define __i386 1 ++// CHECK_I386_M32: #define __i386__ 1 ++// CHECK_I386_M32: #define __tune_i386__ 1 ++// CHECK_I386_M32: #define i386 1 ++// RUN: not %clang -march=i386 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I386_M64 ++// CHECK_I386_M64: error: {{.*}} ++ ++// RUN: %clang -march=i486 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I486_M32 ++// CHECK_I486_M32: #define __i386 1 ++// CHECK_I486_M32: #define __i386__ 1 ++// CHECK_I486_M32: #define __i486 1 ++// CHECK_I486_M32: #define __i486__ 1 ++// CHECK_I486_M32: #define __tune_i486__ 1 ++// CHECK_I486_M32: #define i386 1 ++// RUN: not %clang -march=i486 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I486_M64 ++// CHECK_I486_M64: error: {{.*}} ++ ++// RUN: %clang -march=i586 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I586_M32 ++// CHECK_I586_M32: #define __i386 1 ++// CHECK_I586_M32: #define __i386__ 1 ++// CHECK_I586_M32: #define __i586 1 ++// CHECK_I586_M32: #define __i586__ 1 ++// CHECK_I586_M32: #define __pentium 1 ++// CHECK_I586_M32: #define __pentium__ 1 ++// CHECK_I586_M32: #define __tune_i586__ 1 ++// CHECK_I586_M32: #define __tune_pentium__ 1 ++// CHECK_I586_M32: #define i386 1 ++// RUN: not %clang -march=i586 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I586_M64 ++// CHECK_I586_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM_M32 ++// CHECK_PENTIUM_M32: #define __i386 1 ++// CHECK_PENTIUM_M32: #define __i386__ 1 ++// CHECK_PENTIUM_M32: #define __i586 1 ++// CHECK_PENTIUM_M32: #define __i586__ 1 ++// CHECK_PENTIUM_M32: #define __pentium 1 ++// CHECK_PENTIUM_M32: #define __pentium__ 1 ++// CHECK_PENTIUM_M32: #define __tune_i586__ 1 ++// CHECK_PENTIUM_M32: #define __tune_pentium__ 1 ++// CHECK_PENTIUM_M32: #define i386 1 ++// RUN: not %clang -march=pentium -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM_M64 ++// CHECK_PENTIUM_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium-mmx -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM_MMX_M32 ++// CHECK_PENTIUM_MMX_M32: #define __MMX__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __i386 1 ++// CHECK_PENTIUM_MMX_M32: #define __i386__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __i586 1 ++// CHECK_PENTIUM_MMX_M32: #define __i586__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __pentium 1 ++// CHECK_PENTIUM_MMX_M32: #define __pentium__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __pentium_mmx__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __tune_i586__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __tune_pentium__ 1 ++// CHECK_PENTIUM_MMX_M32: #define __tune_pentium_mmx__ 1 ++// CHECK_PENTIUM_MMX_M32: #define i386 1 ++// RUN: not %clang -march=pentium-mmx -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM_MMX_M64 ++// CHECK_PENTIUM_MMX_M64: error: {{.*}} ++ ++// RUN: %clang -march=winchip-c6 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_WINCHIP_C6_M32 ++// CHECK_WINCHIP_C6_M32: #define __MMX__ 1 ++// CHECK_WINCHIP_C6_M32: #define __i386 1 ++// CHECK_WINCHIP_C6_M32: #define __i386__ 1 ++// CHECK_WINCHIP_C6_M32: #define __i486 1 ++// CHECK_WINCHIP_C6_M32: #define __i486__ 1 ++// CHECK_WINCHIP_C6_M32: #define __tune_i486__ 1 ++// CHECK_WINCHIP_C6_M32: #define i386 1 ++// RUN: not %clang -march=winchip-c6 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_WINCHIP_C6_M64 ++// CHECK_WINCHIP_C6_M64: error: {{.*}} ++ ++// RUN: %clang -march=winchip2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_WINCHIP2_M32 ++// CHECK_WINCHIP2_M32: #define __3dNOW__ 1 ++// CHECK_WINCHIP2_M32: #define __MMX__ 1 ++// CHECK_WINCHIP2_M32: #define __i386 1 ++// CHECK_WINCHIP2_M32: #define __i386__ 1 ++// CHECK_WINCHIP2_M32: #define __i486 1 ++// CHECK_WINCHIP2_M32: #define __i486__ 1 ++// CHECK_WINCHIP2_M32: #define __tune_i486__ 1 ++// CHECK_WINCHIP2_M32: #define i386 1 ++// RUN: not %clang -march=winchip2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_WINCHIP2_M64 ++// CHECK_WINCHIP2_M64: error: {{.*}} ++ ++// RUN: %clang -march=c3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_C3_M32 ++// CHECK_C3_M32: #define __3dNOW__ 1 ++// CHECK_C3_M32: #define __MMX__ 1 ++// CHECK_C3_M32: #define __i386 1 ++// CHECK_C3_M32: #define __i386__ 1 ++// CHECK_C3_M32: #define __i486 1 ++// CHECK_C3_M32: #define __i486__ 1 ++// CHECK_C3_M32: #define __tune_i486__ 1 ++// CHECK_C3_M32: #define i386 1 ++// RUN: not %clang -march=c3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_C3_M64 ++// CHECK_C3_M64: error: {{.*}} ++ ++// RUN: %clang -march=c3-2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_C3_2_M32 ++// CHECK_C3_2_M32: #define __MMX__ 1 ++// CHECK_C3_2_M32: #define __SSE__ 1 ++// CHECK_C3_2_M32: #define __i386 1 ++// CHECK_C3_2_M32: #define __i386__ 1 ++// CHECK_C3_2_M32: #define __i686 1 ++// CHECK_C3_2_M32: #define __i686__ 1 ++// CHECK_C3_2_M32: #define __pentiumpro 1 ++// CHECK_C3_2_M32: #define __pentiumpro__ 1 ++// CHECK_C3_2_M32: #define __tune_i686__ 1 ++// CHECK_C3_2_M32: #define __tune_pentium2__ 1 ++// CHECK_C3_2_M32: #define __tune_pentiumpro__ 1 ++// CHECK_C3_2_M32: #define i386 1 ++// RUN: not %clang -march=c3-2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_C3_2_M64 ++// CHECK_C3_2_M64: error: {{.*}} ++ ++// RUN: %clang -march=i686 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I686_M32 ++// CHECK_I686_M32: #define __i386 1 ++// CHECK_I686_M32: #define __i386__ 1 ++// CHECK_I686_M32: #define __i686 1 ++// CHECK_I686_M32: #define __i686__ 1 ++// CHECK_I686_M32: #define __pentiumpro 1 ++// CHECK_I686_M32: #define __pentiumpro__ 1 ++// CHECK_I686_M32: #define __tune_i686__ 1 ++// CHECK_I686_M32: #define __tune_pentiumpro__ 1 ++// CHECK_I686_M32: #define i386 1 ++// RUN: not %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_I686_M64 ++// CHECK_I686_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentiumpro -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUMPRO_M32 ++// CHECK_PENTIUMPRO_M32: #define __i386 1 ++// CHECK_PENTIUMPRO_M32: #define __i386__ 1 ++// CHECK_PENTIUMPRO_M32: #define __i686 1 ++// CHECK_PENTIUMPRO_M32: #define __i686__ 1 ++// CHECK_PENTIUMPRO_M32: #define __pentiumpro 1 ++// CHECK_PENTIUMPRO_M32: #define __pentiumpro__ 1 ++// CHECK_PENTIUMPRO_M32: #define __tune_i686__ 1 ++// CHECK_PENTIUMPRO_M32: #define __tune_pentiumpro__ 1 ++// CHECK_PENTIUMPRO_M32: #define i386 1 ++// RUN: not %clang -march=pentiumpro -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUMPRO_M64 ++// CHECK_PENTIUMPRO_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM2_M32 ++// CHECK_PENTIUM2_M32: #define __FXSR__ 1 ++// CHECK_PENTIUM2_M32: #define __MMX__ 1 ++// CHECK_PENTIUM2_M32: #define __i386 1 ++// CHECK_PENTIUM2_M32: #define __i386__ 1 ++// CHECK_PENTIUM2_M32: #define __i686 1 ++// CHECK_PENTIUM2_M32: #define __i686__ 1 ++// CHECK_PENTIUM2_M32: #define __pentiumpro 1 ++// CHECK_PENTIUM2_M32: #define __pentiumpro__ 1 ++// CHECK_PENTIUM2_M32: #define __tune_i686__ 1 ++// CHECK_PENTIUM2_M32: #define __tune_pentium2__ 1 ++// CHECK_PENTIUM2_M32: #define __tune_pentiumpro__ 1 ++// CHECK_PENTIUM2_M32: #define i386 1 ++// RUN: not %clang -march=pentium2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM2_M64 ++// CHECK_PENTIUM2_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM3_M32 ++// CHECK_PENTIUM3_M32: #define __MMX__ 1 ++// CHECK_PENTIUM3_M32: #define __SSE__ 1 ++// CHECK_PENTIUM3_M32: #define __i386 1 ++// CHECK_PENTIUM3_M32: #define __i386__ 1 ++// CHECK_PENTIUM3_M32: #define __i686 1 ++// CHECK_PENTIUM3_M32: #define __i686__ 1 ++// CHECK_PENTIUM3_M32: #define __pentiumpro 1 ++// CHECK_PENTIUM3_M32: #define __pentiumpro__ 1 ++// CHECK_PENTIUM3_M32: #define __tune_i686__ 1 ++// CHECK_PENTIUM3_M32: #define __tune_pentium2__ 1 ++// CHECK_PENTIUM3_M32: #define __tune_pentium3__ 1 ++// CHECK_PENTIUM3_M32: #define __tune_pentiumpro__ 1 ++// CHECK_PENTIUM3_M32: #define i386 1 ++// RUN: not %clang -march=pentium3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM3_M64 ++// CHECK_PENTIUM3_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium3m -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM3M_M32 ++// CHECK_PENTIUM3M_M32: #define __MMX__ 1 ++// CHECK_PENTIUM3M_M32: #define __SSE__ 1 ++// CHECK_PENTIUM3M_M32: #define __i386 1 ++// CHECK_PENTIUM3M_M32: #define __i386__ 1 ++// CHECK_PENTIUM3M_M32: #define __i686 1 ++// CHECK_PENTIUM3M_M32: #define __i686__ 1 ++// CHECK_PENTIUM3M_M32: #define __pentiumpro 1 ++// CHECK_PENTIUM3M_M32: #define __pentiumpro__ 1 ++// CHECK_PENTIUM3M_M32: #define __tune_i686__ 1 ++// CHECK_PENTIUM3M_M32: #define __tune_pentiumpro__ 1 ++// CHECK_PENTIUM3M_M32: #define i386 1 ++// RUN: not %clang -march=pentium3m -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM3M_M64 ++// CHECK_PENTIUM3M_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium-m -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM_M_M32 ++// CHECK_PENTIUM_M_M32: #define __MMX__ 1 ++// CHECK_PENTIUM_M_M32: #define __SSE2__ 1 ++// CHECK_PENTIUM_M_M32: #define __SSE__ 1 ++// CHECK_PENTIUM_M_M32: #define __i386 1 ++// CHECK_PENTIUM_M_M32: #define __i386__ 1 ++// CHECK_PENTIUM_M_M32: #define __i686 1 ++// CHECK_PENTIUM_M_M32: #define __i686__ 1 ++// CHECK_PENTIUM_M_M32: #define __pentiumpro 1 ++// CHECK_PENTIUM_M_M32: #define __pentiumpro__ 1 ++// CHECK_PENTIUM_M_M32: #define __tune_i686__ 1 ++// CHECK_PENTIUM_M_M32: #define __tune_pentiumpro__ 1 ++// CHECK_PENTIUM_M_M32: #define i386 1 ++// RUN: not %clang -march=pentium-m -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM_M_M64 ++// CHECK_PENTIUM_M_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium4 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM4_M32 ++// CHECK_PENTIUM4_M32: #define __MMX__ 1 ++// CHECK_PENTIUM4_M32: #define __SSE2__ 1 ++// CHECK_PENTIUM4_M32: #define __SSE__ 1 ++// CHECK_PENTIUM4_M32: #define __i386 1 ++// CHECK_PENTIUM4_M32: #define __i386__ 1 ++// CHECK_PENTIUM4_M32: #define __pentium4 1 ++// CHECK_PENTIUM4_M32: #define __pentium4__ 1 ++// CHECK_PENTIUM4_M32: #define __tune_pentium4__ 1 ++// CHECK_PENTIUM4_M32: #define i386 1 ++// RUN: not %clang -march=pentium4 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM4_M64 ++// CHECK_PENTIUM4_M64: error: {{.*}} ++ ++// RUN: %clang -march=pentium4m -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM4M_M32 ++// CHECK_PENTIUM4M_M32: #define __MMX__ 1 ++// CHECK_PENTIUM4M_M32: #define __SSE2__ 1 ++// CHECK_PENTIUM4M_M32: #define __SSE__ 1 ++// CHECK_PENTIUM4M_M32: #define __i386 1 ++// CHECK_PENTIUM4M_M32: #define __i386__ 1 ++// CHECK_PENTIUM4M_M32: #define __pentium4 1 ++// CHECK_PENTIUM4M_M32: #define __pentium4__ 1 ++// CHECK_PENTIUM4M_M32: #define __tune_pentium4__ 1 ++// CHECK_PENTIUM4M_M32: #define i386 1 ++// RUN: not %clang -march=pentium4m -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM4M_M64 ++// CHECK_PENTIUM4M_M64: error: {{.*}} ++ ++// RUN: %clang -march=yonah -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_YONAH_M32 ++// CHECK_YONAH_M32: #define __MMX__ 1 ++// CHECK_YONAH_M32: #define __SSE2__ 1 ++// CHECK_YONAH_M32: #define __SSE3__ 1 ++// CHECK_YONAH_M32: #define __SSE__ 1 ++// CHECK_YONAH_M32: #define __i386 1 ++// CHECK_YONAH_M32: #define __i386__ 1 ++// CHECK_YONAH_M32: #define __nocona 1 ++// CHECK_YONAH_M32: #define __nocona__ 1 ++// CHECK_YONAH_M32: #define __tune_nocona__ 1 ++// CHECK_YONAH_M32: #define i386 1 ++// RUN: not %clang -march=yonah -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_YONAH_M64 ++// CHECK_YONAH_M64: error: {{.*}} ++ ++// RUN: %clang -march=prescott -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PRESCOTT_M32 ++// CHECK_PRESCOTT_M32: #define __MMX__ 1 ++// CHECK_PRESCOTT_M32: #define __SSE2__ 1 ++// CHECK_PRESCOTT_M32: #define __SSE3__ 1 ++// CHECK_PRESCOTT_M32: #define __SSE__ 1 ++// CHECK_PRESCOTT_M32: #define __i386 1 ++// CHECK_PRESCOTT_M32: #define __i386__ 1 ++// CHECK_PRESCOTT_M32: #define __nocona 1 ++// CHECK_PRESCOTT_M32: #define __nocona__ 1 ++// CHECK_PRESCOTT_M32: #define __tune_nocona__ 1 ++// CHECK_PRESCOTT_M32: #define i386 1 ++// RUN: not %clang -march=prescott -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PRESCOTT_M64 ++// CHECK_PRESCOTT_M64: error: {{.*}} ++ ++// RUN: %clang -march=nocona -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_NOCONA_M32 ++// CHECK_NOCONA_M32: #define __MMX__ 1 ++// CHECK_NOCONA_M32: #define __SSE2__ 1 ++// CHECK_NOCONA_M32: #define __SSE3__ 1 ++// CHECK_NOCONA_M32: #define __SSE__ 1 ++// CHECK_NOCONA_M32: #define __i386 1 ++// CHECK_NOCONA_M32: #define __i386__ 1 ++// CHECK_NOCONA_M32: #define __nocona 1 ++// CHECK_NOCONA_M32: #define __nocona__ 1 ++// CHECK_NOCONA_M32: #define __tune_nocona__ 1 ++// CHECK_NOCONA_M32: #define i386 1 ++// RUN: %clang -march=nocona -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_NOCONA_M64 ++// CHECK_NOCONA_M64: #define __MMX__ 1 ++// CHECK_NOCONA_M64: #define __SSE2_MATH__ 1 ++// CHECK_NOCONA_M64: #define __SSE2__ 1 ++// CHECK_NOCONA_M64: #define __SSE3__ 1 ++// CHECK_NOCONA_M64: #define __SSE_MATH__ 1 ++// CHECK_NOCONA_M64: #define __SSE__ 1 ++// CHECK_NOCONA_M64: #define __amd64 1 ++// CHECK_NOCONA_M64: #define __amd64__ 1 ++// CHECK_NOCONA_M64: #define __nocona 1 ++// CHECK_NOCONA_M64: #define __nocona__ 1 ++// CHECK_NOCONA_M64: #define __tune_nocona__ 1 ++// CHECK_NOCONA_M64: #define __x86_64 1 ++// CHECK_NOCONA_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=core2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CORE2_M32 ++// CHECK_CORE2_M32: #define __MMX__ 1 ++// CHECK_CORE2_M32: #define __SSE2__ 1 ++// CHECK_CORE2_M32: #define __SSE3__ 1 ++// CHECK_CORE2_M32: #define __SSE__ 1 ++// CHECK_CORE2_M32: #define __SSSE3__ 1 ++// CHECK_CORE2_M32: #define __core2 1 ++// CHECK_CORE2_M32: #define __core2__ 1 ++// CHECK_CORE2_M32: #define __i386 1 ++// CHECK_CORE2_M32: #define __i386__ 1 ++// CHECK_CORE2_M32: #define __tune_core2__ 1 ++// CHECK_CORE2_M32: #define i386 1 ++ ++// RUN: %clang -march=core2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CORE2_M64 ++// CHECK_CORE2_M64: #define __MMX__ 1 ++// CHECK_CORE2_M64: #define __SSE2_MATH__ 1 ++// CHECK_CORE2_M64: #define __SSE2__ 1 ++// CHECK_CORE2_M64: #define __SSE3__ 1 ++// CHECK_CORE2_M64: #define __SSE_MATH__ 1 ++// CHECK_CORE2_M64: #define __SSE__ 1 ++// CHECK_CORE2_M64: #define __SSSE3__ 1 ++// CHECK_CORE2_M64: #define __amd64 1 ++// CHECK_CORE2_M64: #define __amd64__ 1 ++// CHECK_CORE2_M64: #define __core2 1 ++// CHECK_CORE2_M64: #define __core2__ 1 ++// CHECK_CORE2_M64: #define __tune_core2__ 1 ++// CHECK_CORE2_M64: #define __x86_64 1 ++// CHECK_CORE2_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=corei7 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_COREI7_M32 ++// CHECK_COREI7_M32: #define __MMX__ 1 ++// CHECK_COREI7_M32: #define __POPCNT__ 1 ++// CHECK_COREI7_M32: #define __SSE2__ 1 ++// CHECK_COREI7_M32: #define __SSE3__ 1 ++// CHECK_COREI7_M32: #define __SSE4_1__ 1 ++// CHECK_COREI7_M32: #define __SSE4_2__ 1 ++// CHECK_COREI7_M32: #define __SSE__ 1 ++// CHECK_COREI7_M32: #define __SSSE3__ 1 ++// CHECK_COREI7_M32: #define __corei7 1 ++// CHECK_COREI7_M32: #define __corei7__ 1 ++// CHECK_COREI7_M32: #define __i386 1 ++// CHECK_COREI7_M32: #define __i386__ 1 ++// CHECK_COREI7_M32: #define __tune_corei7__ 1 ++// CHECK_COREI7_M32: #define i386 1 ++ ++// RUN: %clang -march=corei7 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_COREI7_M64 ++// CHECK_COREI7_M64: #define __MMX__ 1 ++// CHECK_COREI7_M64: #define __POPCNT__ 1 ++// CHECK_COREI7_M64: #define __SSE2_MATH__ 1 ++// CHECK_COREI7_M64: #define __SSE2__ 1 ++// CHECK_COREI7_M64: #define __SSE3__ 1 ++// CHECK_COREI7_M64: #define __SSE4_1__ 1 ++// CHECK_COREI7_M64: #define __SSE4_2__ 1 ++// CHECK_COREI7_M64: #define __SSE_MATH__ 1 ++// CHECK_COREI7_M64: #define __SSE__ 1 ++// CHECK_COREI7_M64: #define __SSSE3__ 1 ++// CHECK_COREI7_M64: #define __amd64 1 ++// CHECK_COREI7_M64: #define __amd64__ 1 ++// CHECK_COREI7_M64: #define __corei7 1 ++// CHECK_COREI7_M64: #define __corei7__ 1 ++// CHECK_COREI7_M64: #define __tune_corei7__ 1 ++// CHECK_COREI7_M64: #define __x86_64 1 ++// CHECK_COREI7_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=corei7-avx -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_COREI7_AVX_M32 ++// CHECK_COREI7_AVX_M32: #define __AVX__ 1 ++// CHECK_COREI7_AVX_M32: #define __MMX__ 1 ++// CHECK_COREI7_AVX_M32: #define __PCLMUL__ 1 ++// CHECK_COREI7_AVX_M32-NOT: __RDRND__ ++// CHECK_COREI7_AVX_M32: #define __POPCNT__ 1 ++// CHECK_COREI7_AVX_M32: #define __SSE2__ 1 ++// CHECK_COREI7_AVX_M32: #define __SSE3__ 1 ++// CHECK_COREI7_AVX_M32: #define __SSE4_1__ 1 ++// CHECK_COREI7_AVX_M32: #define __SSE4_2__ 1 ++// CHECK_COREI7_AVX_M32: #define __SSE__ 1 ++// CHECK_COREI7_AVX_M32: #define __SSSE3__ 1 ++// CHECK_COREI7_AVX_M32: #define __XSAVEOPT__ 1 ++// CHECK_COREI7_AVX_M32: #define __XSAVE__ 1 ++// CHECK_COREI7_AVX_M32: #define __corei7 1 ++// CHECK_COREI7_AVX_M32: #define __corei7__ 1 ++// CHECK_COREI7_AVX_M32: #define __i386 1 ++// CHECK_COREI7_AVX_M32: #define __i386__ 1 ++// CHECK_COREI7_AVX_M32: #define __tune_corei7__ 1 ++// CHECK_COREI7_AVX_M32: #define i386 1 ++ ++// RUN: %clang -march=corei7-avx -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_COREI7_AVX_M64 ++// CHECK_COREI7_AVX_M64: #define __AVX__ 1 ++// CHECK_COREI7_AVX_M64: #define __MMX__ 1 ++// CHECK_COREI7_AVX_M64: #define __PCLMUL__ 1 ++// CHECK_COREI7_AVX_M64-NOT: __RDRND__ ++// CHECK_COREI7_AVX_M64: #define __POPCNT__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE2_MATH__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE2__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE3__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE4_1__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE4_2__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE_MATH__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSE__ 1 ++// CHECK_COREI7_AVX_M64: #define __SSSE3__ 1 ++// CHECK_COREI7_AVX_M64: #define __XSAVEOPT__ 1 ++// CHECK_COREI7_AVX_M64: #define __XSAVE__ 1 ++// CHECK_COREI7_AVX_M64: #define __amd64 1 ++// CHECK_COREI7_AVX_M64: #define __amd64__ 1 ++// CHECK_COREI7_AVX_M64: #define __corei7 1 ++// CHECK_COREI7_AVX_M64: #define __corei7__ 1 ++// CHECK_COREI7_AVX_M64: #define __tune_corei7__ 1 ++// CHECK_COREI7_AVX_M64: #define __x86_64 1 ++// CHECK_COREI7_AVX_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=core-avx-i -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CORE_AVX_I_M32 ++// CHECK_CORE_AVX_I_M32: #define __AVX__ 1 ++// CHECK_CORE_AVX_I_M32: #define __F16C__ 1 ++// CHECK_CORE_AVX_I_M32: #define __MMX__ 1 ++// CHECK_CORE_AVX_I_M32: #define __PCLMUL__ 1 ++// CHECK_CORE_AVX_I_M32: #define __RDRND__ 1 ++// CHECK_CORE_AVX_I_M32: #define __SSE2__ 1 ++// CHECK_CORE_AVX_I_M32: #define __SSE3__ 1 ++// CHECK_CORE_AVX_I_M32: #define __SSE4_1__ 1 ++// CHECK_CORE_AVX_I_M32: #define __SSE4_2__ 1 ++// CHECK_CORE_AVX_I_M32: #define __SSE__ 1 ++// CHECK_CORE_AVX_I_M32: #define __SSSE3__ 1 ++// CHECK_CORE_AVX_I_M32: #define __XSAVEOPT__ 1 ++// CHECK_CORE_AVX_I_M32: #define __XSAVE__ 1 ++// CHECK_CORE_AVX_I_M32: #define __corei7 1 ++// CHECK_CORE_AVX_I_M32: #define __corei7__ 1 ++// CHECK_CORE_AVX_I_M32: #define __i386 1 ++// CHECK_CORE_AVX_I_M32: #define __i386__ 1 ++// CHECK_CORE_AVX_I_M32: #define __tune_corei7__ 1 ++// CHECK_CORE_AVX_I_M32: #define i386 1 ++ ++// RUN: %clang -march=core-avx-i -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CORE_AVX_I_M64 ++// CHECK_CORE_AVX_I_M64: #define __AVX__ 1 ++// CHECK_CORE_AVX_I_M64: #define __F16C__ 1 ++// CHECK_CORE_AVX_I_M64: #define __MMX__ 1 ++// CHECK_CORE_AVX_I_M64: #define __PCLMUL__ 1 ++// CHECK_CORE_AVX_I_M64: #define __RDRND__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE2_MATH__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE2__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE3__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE4_1__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE4_2__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE_MATH__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSE__ 1 ++// CHECK_CORE_AVX_I_M64: #define __SSSE3__ 1 ++// CHECK_CORE_AVX_I_M64: #define __XSAVEOPT__ 1 ++// CHECK_CORE_AVX_I_M64: #define __XSAVE__ 1 ++// CHECK_CORE_AVX_I_M64: #define __amd64 1 ++// CHECK_CORE_AVX_I_M64: #define __amd64__ 1 ++// CHECK_CORE_AVX_I_M64: #define __corei7 1 ++// CHECK_CORE_AVX_I_M64: #define __corei7__ 1 ++// CHECK_CORE_AVX_I_M64: #define __tune_corei7__ 1 ++// CHECK_CORE_AVX_I_M64: #define __x86_64 1 ++// CHECK_CORE_AVX_I_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=core-avx2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CORE_AVX2_M32 ++// CHECK_CORE_AVX2_M32: #define __AVX2__ 1 ++// CHECK_CORE_AVX2_M32: #define __AVX__ 1 ++// CHECK_CORE_AVX2_M32: #define __BMI2__ 1 ++// CHECK_CORE_AVX2_M32: #define __BMI__ 1 ++// CHECK_CORE_AVX2_M32: #define __F16C__ 1 ++// CHECK_CORE_AVX2_M32: #define __FMA__ 1 ++// CHECK_CORE_AVX2_M32: #define __INVPCID__ 1 ++// CHECK_CORE_AVX2_M32: #define __LAHF_SAHF__ 1 ++// CHECK_CORE_AVX2_M32: #define __LZCNT__ 1 ++// CHECK_CORE_AVX2_M32: #define __MMX__ 1 ++// CHECK_CORE_AVX2_M32: #define __MOVBE__ 1 ++// CHECK_CORE_AVX2_M32: #define __PCLMUL__ 1 ++// CHECK_CORE_AVX2_M32: #define __POPCNT__ 1 ++// CHECK_CORE_AVX2_M32: #define __RDRND__ 1 ++// CHECK_CORE_AVX2_M32: #define __SSE2__ 1 ++// CHECK_CORE_AVX2_M32: #define __SSE3__ 1 ++// CHECK_CORE_AVX2_M32: #define __SSE4_1__ 1 ++// CHECK_CORE_AVX2_M32: #define __SSE4_2__ 1 ++// CHECK_CORE_AVX2_M32: #define __SSE__ 1 ++// CHECK_CORE_AVX2_M32: #define __SSSE3__ 1 ++// CHECK_CORE_AVX2_M32: #define __XSAVEOPT__ 1 ++// CHECK_CORE_AVX2_M32: #define __XSAVE__ 1 ++// CHECK_CORE_AVX2_M32: #define __corei7 1 ++// CHECK_CORE_AVX2_M32: #define __corei7__ 1 ++// CHECK_CORE_AVX2_M32: #define __i386 1 ++// CHECK_CORE_AVX2_M32: #define __i386__ 1 ++// CHECK_CORE_AVX2_M32: #define __tune_corei7__ 1 ++// CHECK_CORE_AVX2_M32: #define i386 1 ++ ++// RUN: %clang -march=core-avx2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CORE_AVX2_M64 ++// CHECK_CORE_AVX2_M64: #define __AVX2__ 1 ++// CHECK_CORE_AVX2_M64: #define __AVX__ 1 ++// CHECK_CORE_AVX2_M64: #define __BMI2__ 1 ++// CHECK_CORE_AVX2_M64: #define __BMI__ 1 ++// CHECK_CORE_AVX2_M64: #define __F16C__ 1 ++// CHECK_CORE_AVX2_M64: #define __FMA__ 1 ++// CHECK_CORE_AVX2_M64: #define __INVPCID__ 1 ++// CHECK_CORE_AVX2_M64: #define __LAHF_SAHF__ 1 ++// CHECK_CORE_AVX2_M64: #define __LZCNT__ 1 ++// CHECK_CORE_AVX2_M64: #define __MMX__ 1 ++// CHECK_CORE_AVX2_M64: #define __MOVBE__ 1 ++// CHECK_CORE_AVX2_M64: #define __PCLMUL__ 1 ++// CHECK_CORE_AVX2_M64: #define __POPCNT__ 1 ++// CHECK_CORE_AVX2_M64: #define __RDRND__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE2_MATH__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE2__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE3__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE4_1__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE4_2__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE_MATH__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSE__ 1 ++// CHECK_CORE_AVX2_M64: #define __SSSE3__ 1 ++// CHECK_CORE_AVX2_M64: #define __XSAVEOPT__ 1 ++// CHECK_CORE_AVX2_M64: #define __XSAVE__ 1 ++// CHECK_CORE_AVX2_M64: #define __amd64 1 ++// CHECK_CORE_AVX2_M64: #define __amd64__ 1 ++// CHECK_CORE_AVX2_M64: #define __corei7 1 ++// CHECK_CORE_AVX2_M64: #define __corei7__ 1 ++// CHECK_CORE_AVX2_M64: #define __tune_corei7__ 1 ++// CHECK_CORE_AVX2_M64: #define __x86_64 1 ++// CHECK_CORE_AVX2_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=broadwell -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BROADWELL_M32 ++// CHECK_BROADWELL_M32: #define __ADX__ 1 ++// CHECK_BROADWELL_M32: #define __AVX2__ 1 ++// CHECK_BROADWELL_M32: #define __AVX__ 1 ++// CHECK_BROADWELL_M32: #define __BMI2__ 1 ++// CHECK_BROADWELL_M32: #define __BMI__ 1 ++// CHECK_BROADWELL_M32: #define __F16C__ 1 ++// CHECK_BROADWELL_M32: #define __FMA__ 1 ++// CHECK_BROADWELL_M32: #define __INVPCID__ 1 ++// CHECK_BROADWELL_M32: #define __LAHF_SAHF__ 1 ++// CHECK_BROADWELL_M32: #define __LZCNT__ 1 ++// CHECK_BROADWELL_M32: #define __MMX__ 1 ++// CHECK_BROADWELL_M32: #define __MOVBE__ 1 ++// CHECK_BROADWELL_M32: #define __PCLMUL__ 1 ++// CHECK_BROADWELL_M32: #define __POPCNT__ 1 ++// CHECK_BROADWELL_M32: #define __PRFCHW__ 1 ++// CHECK_BROADWELL_M32: #define __RDRND__ 1 ++// CHECK_BROADWELL_M32: #define __RDSEED__ 1 ++// CHECK_BROADWELL_M32: #define __SSE2__ 1 ++// CHECK_BROADWELL_M32: #define __SSE3__ 1 ++// CHECK_BROADWELL_M32: #define __SSE4_1__ 1 ++// CHECK_BROADWELL_M32: #define __SSE4_2__ 1 ++// CHECK_BROADWELL_M32: #define __SSE__ 1 ++// CHECK_BROADWELL_M32: #define __SSSE3__ 1 ++// CHECK_BROADWELL_M32: #define __XSAVEOPT__ 1 ++// CHECK_BROADWELL_M32: #define __XSAVE__ 1 ++// CHECK_BROADWELL_M32: #define __corei7 1 ++// CHECK_BROADWELL_M32: #define __corei7__ 1 ++// CHECK_BROADWELL_M32: #define __i386 1 ++// CHECK_BROADWELL_M32: #define __i386__ 1 ++// CHECK_BROADWELL_M32: #define __tune_corei7__ 1 ++// CHECK_BROADWELL_M32: #define i386 1 ++ ++// RUN: %clang -march=broadwell -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BROADWELL_M64 ++// CHECK_BROADWELL_M64: #define __ADX__ 1 ++// CHECK_BROADWELL_M64: #define __AVX2__ 1 ++// CHECK_BROADWELL_M64: #define __AVX__ 1 ++// CHECK_BROADWELL_M64: #define __BMI2__ 1 ++// CHECK_BROADWELL_M64: #define __BMI__ 1 ++// CHECK_BROADWELL_M64: #define __F16C__ 1 ++// CHECK_BROADWELL_M64: #define __FMA__ 1 ++// CHECK_BROADWELL_M64: #define __INVPCID__ 1 ++// CHECK_BROADWELL_M64: #define __LAHF_SAHF__ 1 ++// CHECK_BROADWELL_M64: #define __LZCNT__ 1 ++// CHECK_BROADWELL_M64: #define __MMX__ 1 ++// CHECK_BROADWELL_M64: #define __MOVBE__ 1 ++// CHECK_BROADWELL_M64: #define __PCLMUL__ 1 ++// CHECK_BROADWELL_M64: #define __POPCNT__ 1 ++// CHECK_BROADWELL_M64: #define __PRFCHW__ 1 ++// CHECK_BROADWELL_M64: #define __RDRND__ 1 ++// CHECK_BROADWELL_M64: #define __RDSEED__ 1 ++// CHECK_BROADWELL_M64: #define __SSE2_MATH__ 1 ++// CHECK_BROADWELL_M64: #define __SSE2__ 1 ++// CHECK_BROADWELL_M64: #define __SSE3__ 1 ++// CHECK_BROADWELL_M64: #define __SSE4_1__ 1 ++// CHECK_BROADWELL_M64: #define __SSE4_2__ 1 ++// CHECK_BROADWELL_M64: #define __SSE_MATH__ 1 ++// CHECK_BROADWELL_M64: #define __SSE__ 1 ++// CHECK_BROADWELL_M64: #define __SSSE3__ 1 ++// CHECK_BROADWELL_M64: #define __XSAVEOPT__ 1 ++// CHECK_BROADWELL_M64: #define __XSAVE__ 1 ++// CHECK_BROADWELL_M64: #define __amd64 1 ++// CHECK_BROADWELL_M64: #define __amd64__ 1 ++// CHECK_BROADWELL_M64: #define __corei7 1 ++// CHECK_BROADWELL_M64: #define __corei7__ 1 ++// CHECK_BROADWELL_M64: #define __tune_corei7__ 1 ++// CHECK_BROADWELL_M64: #define __x86_64 1 ++// CHECK_BROADWELL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=skylake -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SKL_M32 ++// CHECK_SKL_M32: #define __ADX__ 1 ++// CHECK_SKL_M32: #define __AES__ 1 ++// CHECK_SKL_M32: #define __AVX2__ 1 ++// CHECK_SKL_M32: #define __AVX__ 1 ++// CHECK_SKL_M32: #define __BMI2__ 1 ++// CHECK_SKL_M32: #define __BMI__ 1 ++// CHECK_SKL_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_SKL_M32: #define __F16C__ 1 ++// CHECK_SKL_M32: #define __FMA__ 1 ++// CHECK_SKL_M32: #define __INVPCID__ 1 ++// CHECK_SKL_M32: #define __LZCNT__ 1 ++// CHECK_SKL_M32: #define __MMX__ 1 ++// CHECK_SKL_M32: #define __MOVBE__ 1 ++// CHECK_SKL_M32: #define __PCLMUL__ 1 ++// CHECK_SKL_M32: #define __POPCNT__ 1 ++// CHECK_SKL_M32: #define __PRFCHW__ 1 ++// CHECK_SKL_M32: #define __RDRND__ 1 ++// CHECK_SKL_M32: #define __RDSEED__ 1 ++// CHECK_SKL_M32: #define __SGX__ 1 ++// CHECK_SKL_M32: #define __SSE2__ 1 ++// CHECK_SKL_M32: #define __SSE3__ 1 ++// CHECK_SKL_M32: #define __SSE4_1__ 1 ++// CHECK_SKL_M32: #define __SSE4_2__ 1 ++// CHECK_SKL_M32: #define __SSE__ 1 ++// CHECK_SKL_M32: #define __SSSE3__ 1 ++// CHECK_SKL_M32: #define __XSAVEC__ 1 ++// CHECK_SKL_M32: #define __XSAVEOPT__ 1 ++// CHECK_SKL_M32: #define __XSAVES__ 1 ++// CHECK_SKL_M32: #define __XSAVE__ 1 ++// CHECK_SKL_M32: #define i386 1 ++ ++// RUN: %clang -march=skylake -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SKL_M64 ++// CHECK_SKL_M64: #define __ADX__ 1 ++// CHECK_SKL_M64: #define __AES__ 1 ++// CHECK_SKL_M64: #define __AVX2__ 1 ++// CHECK_SKL_M64: #define __AVX__ 1 ++// CHECK_SKL_M64: #define __BMI2__ 1 ++// CHECK_SKL_M64: #define __BMI__ 1 ++// CHECK_SKL_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_SKL_M64: #define __F16C__ 1 ++// CHECK_SKL_M64: #define __FMA__ 1 ++// CHECK_SKL_M64: #define __INVPCID__ 1 ++// CHECK_SKL_M64: #define __LZCNT__ 1 ++// CHECK_SKL_M64: #define __MMX__ 1 ++// CHECK_SKL_M64: #define __MOVBE__ 1 ++// CHECK_SKL_M64: #define __PCLMUL__ 1 ++// CHECK_SKL_M64: #define __POPCNT__ 1 ++// CHECK_SKL_M64: #define __PRFCHW__ 1 ++// CHECK_SKL_M64: #define __RDRND__ 1 ++// CHECK_SKL_M64: #define __RDSEED__ 1 ++// CHECK_SKL_M64: #define __SGX__ 1 ++// CHECK_SKL_M64: #define __SSE2_MATH__ 1 ++// CHECK_SKL_M64: #define __SSE2__ 1 ++// CHECK_SKL_M64: #define __SSE3__ 1 ++// CHECK_SKL_M64: #define __SSE4_1__ 1 ++// CHECK_SKL_M64: #define __SSE4_2__ 1 ++// CHECK_SKL_M64: #define __SSE_MATH__ 1 ++// CHECK_SKL_M64: #define __SSE__ 1 ++// CHECK_SKL_M64: #define __SSSE3__ 1 ++// CHECK_SKL_M64: #define __XSAVEC__ 1 ++// CHECK_SKL_M64: #define __XSAVEOPT__ 1 ++// CHECK_SKL_M64: #define __XSAVES__ 1 ++// CHECK_SKL_M64: #define __XSAVE__ 1 ++// CHECK_SKL_M64: #define __amd64 1 ++// CHECK_SKL_M64: #define __amd64__ 1 ++// CHECK_SKL_M64: #define __x86_64 1 ++// CHECK_SKL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=knl -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_KNL_M32 ++// CHECK_KNL_M32: #define __AES__ 1 ++// CHECK_KNL_M32: #define __AVX2__ 1 ++// CHECK_KNL_M32: #define __AVX512CD__ 1 ++// CHECK_KNL_M32: #define __AVX512ER__ 1 ++// CHECK_KNL_M32: #define __AVX512F__ 1 ++// CHECK_KNL_M32: #define __AVX512PF__ 1 ++// CHECK_KNL_M32: #define __AVX__ 1 ++// CHECK_KNL_M32: #define __BMI2__ 1 ++// CHECK_KNL_M32: #define __BMI__ 1 ++// CHECK_KNL_M32: #define __F16C__ 1 ++// CHECK_KNL_M32: #define __FMA__ 1 ++// CHECK_KNL_M32: #define __LZCNT__ 1 ++// CHECK_KNL_M32: #define __MMX__ 1 ++// CHECK_KNL_M32: #define __MOVBE__ 1 ++// CHECK_KNL_M32: #define __PCLMUL__ 1 ++// CHECK_KNL_M32: #define __POPCNT__ 1 ++// CHECK_KNL_M32: #define __PREFETCHWT1__ 1 ++// CHECK_KNL_M32: #define __PRFCHW__ 1 ++// CHECK_KNL_M32: #define __RDRND__ 1 ++// CHECK_KNL_M32: #define __SSE2__ 1 ++// CHECK_KNL_M32: #define __SSE3__ 1 ++// CHECK_KNL_M32: #define __SSE4_1__ 1 ++// CHECK_KNL_M32: #define __SSE4_2__ 1 ++// CHECK_KNL_M32: #define __SSE__ 1 ++// CHECK_KNL_M32: #define __SSSE3__ 1 ++// CHECK_KNL_M32: #define __XSAVEOPT__ 1 ++// CHECK_KNL_M32: #define __XSAVE__ 1 ++// CHECK_KNL_M32: #define __i386 1 ++// CHECK_KNL_M32: #define __i386__ 1 ++// CHECK_KNL_M32: #define __knl 1 ++// CHECK_KNL_M32: #define __knl__ 1 ++// CHECK_KNL_M32: #define __tune_knl__ 1 ++// CHECK_KNL_M32: #define i386 1 ++ ++// RUN: %clang -march=knl -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_KNL_M64 ++// CHECK_KNL_M64: #define __AES__ 1 ++// CHECK_KNL_M64: #define __AVX2__ 1 ++// CHECK_KNL_M64: #define __AVX512CD__ 1 ++// CHECK_KNL_M64: #define __AVX512ER__ 1 ++// CHECK_KNL_M64: #define __AVX512F__ 1 ++// CHECK_KNL_M64: #define __AVX512PF__ 1 ++// CHECK_KNL_M64: #define __AVX__ 1 ++// CHECK_KNL_M64: #define __BMI2__ 1 ++// CHECK_KNL_M64: #define __BMI__ 1 ++// CHECK_KNL_M64: #define __F16C__ 1 ++// CHECK_KNL_M64: #define __FMA__ 1 ++// CHECK_KNL_M64: #define __LZCNT__ 1 ++// CHECK_KNL_M64: #define __MMX__ 1 ++// CHECK_KNL_M64: #define __MOVBE__ 1 ++// CHECK_KNL_M64: #define __PCLMUL__ 1 ++// CHECK_KNL_M64: #define __POPCNT__ 1 ++// CHECK_KNL_M64: #define __PREFETCHWT1__ 1 ++// CHECK_KNL_M64: #define __PRFCHW__ 1 ++// CHECK_KNL_M64: #define __RDRND__ 1 ++// CHECK_KNL_M64: #define __SSE2_MATH__ 1 ++// CHECK_KNL_M64: #define __SSE2__ 1 ++// CHECK_KNL_M64: #define __SSE3__ 1 ++// CHECK_KNL_M64: #define __SSE4_1__ 1 ++// CHECK_KNL_M64: #define __SSE4_2__ 1 ++// CHECK_KNL_M64: #define __SSE_MATH__ 1 ++// CHECK_KNL_M64: #define __SSE__ 1 ++// CHECK_KNL_M64: #define __SSSE3__ 1 ++// CHECK_KNL_M64: #define __XSAVEOPT__ 1 ++// CHECK_KNL_M64: #define __XSAVE__ 1 ++// CHECK_KNL_M64: #define __amd64 1 ++// CHECK_KNL_M64: #define __amd64__ 1 ++// CHECK_KNL_M64: #define __knl 1 ++// CHECK_KNL_M64: #define __knl__ 1 ++// CHECK_KNL_M64: #define __tune_knl__ 1 ++// CHECK_KNL_M64: #define __x86_64 1 ++// CHECK_KNL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=knm -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_KNM_M32 ++// CHECK_KNM_M32: #define __AES__ 1 ++// CHECK_KNM_M32: #define __AVX2__ 1 ++// CHECK_KNM_M32: #define __AVX512CD__ 1 ++// CHECK_KNM_M32: #define __AVX512ER__ 1 ++// CHECK_KNM_M32: #define __AVX512F__ 1 ++// CHECK_KNM_M32: #define __AVX512PF__ 1 ++// CHECK_KNM_M32: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_KNM_M32: #define __AVX__ 1 ++// CHECK_KNM_M32: #define __BMI2__ 1 ++// CHECK_KNM_M32: #define __BMI__ 1 ++// CHECK_KNM_M32: #define __F16C__ 1 ++// CHECK_KNM_M32: #define __FMA__ 1 ++// CHECK_KNM_M32: #define __LZCNT__ 1 ++// CHECK_KNM_M32: #define __MMX__ 1 ++// CHECK_KNM_M32: #define __MOVBE__ 1 ++// CHECK_KNM_M32: #define __PCLMUL__ 1 ++// CHECK_KNM_M32: #define __POPCNT__ 1 ++// CHECK_KNM_M32: #define __PREFETCHWT1__ 1 ++// CHECK_KNM_M32: #define __PRFCHW__ 1 ++// CHECK_KNM_M32: #define __RDRND__ 1 ++// CHECK_KNM_M32: #define __SSE2__ 1 ++// CHECK_KNM_M32: #define __SSE3__ 1 ++// CHECK_KNM_M32: #define __SSE4_1__ 1 ++// CHECK_KNM_M32: #define __SSE4_2__ 1 ++// CHECK_KNM_M32: #define __SSE__ 1 ++// CHECK_KNM_M32: #define __SSSE3__ 1 ++// CHECK_KNM_M32: #define __XSAVEOPT__ 1 ++// CHECK_KNM_M32: #define __XSAVE__ 1 ++// CHECK_KNM_M32: #define __i386 1 ++// CHECK_KNM_M32: #define __i386__ 1 ++// CHECK_KNM_M32: #define i386 1 ++ ++// RUN: %clang -march=knm -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_KNM_M64 ++// CHECK_KNM_M64: #define __AES__ 1 ++// CHECK_KNM_M64: #define __AVX2__ 1 ++// CHECK_KNM_M64: #define __AVX512CD__ 1 ++// CHECK_KNM_M64: #define __AVX512ER__ 1 ++// CHECK_KNM_M64: #define __AVX512F__ 1 ++// CHECK_KNM_M64: #define __AVX512PF__ 1 ++// CHECK_KNM_M64: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_KNM_M64: #define __AVX__ 1 ++// CHECK_KNM_M64: #define __BMI2__ 1 ++// CHECK_KNM_M64: #define __BMI__ 1 ++// CHECK_KNM_M64: #define __F16C__ 1 ++// CHECK_KNM_M64: #define __FMA__ 1 ++// CHECK_KNM_M64: #define __LZCNT__ 1 ++// CHECK_KNM_M64: #define __MMX__ 1 ++// CHECK_KNM_M64: #define __MOVBE__ 1 ++// CHECK_KNM_M64: #define __PCLMUL__ 1 ++// CHECK_KNM_M64: #define __POPCNT__ 1 ++// CHECK_KNM_M64: #define __PREFETCHWT1__ 1 ++// CHECK_KNM_M64: #define __PRFCHW__ 1 ++// CHECK_KNM_M64: #define __RDRND__ 1 ++// CHECK_KNM_M64: #define __SSE2_MATH__ 1 ++// CHECK_KNM_M64: #define __SSE2__ 1 ++// CHECK_KNM_M64: #define __SSE3__ 1 ++// CHECK_KNM_M64: #define __SSE4_1__ 1 ++// CHECK_KNM_M64: #define __SSE4_2__ 1 ++// CHECK_KNM_M64: #define __SSE_MATH__ 1 ++// CHECK_KNM_M64: #define __SSE__ 1 ++// CHECK_KNM_M64: #define __SSSE3__ 1 ++// CHECK_KNM_M64: #define __XSAVEOPT__ 1 ++// CHECK_KNM_M64: #define __XSAVE__ 1 ++// CHECK_KNM_M64: #define __amd64 1 ++// CHECK_KNM_M64: #define __amd64__ 1 ++// CHECK_KNM_M64: #define __x86_64 1 ++// CHECK_KNM_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=skylake-avx512 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SKX_M32 ++// CHECK_SKX_M32: #define __AES__ 1 ++// CHECK_SKX_M32: #define __AVX2__ 1 ++// CHECK_SKX_M32: #define __AVX512BW__ 1 ++// CHECK_SKX_M32: #define __AVX512CD__ 1 ++// CHECK_SKX_M32: #define __AVX512DQ__ 1 ++// CHECK_SKX_M32: #define __AVX512F__ 1 ++// CHECK_SKX_M32: #define __AVX512VL__ 1 ++// CHECK_SKX_M32: #define __AVX__ 1 ++// CHECK_SKX_M32: #define __BMI2__ 1 ++// CHECK_SKX_M32: #define __BMI__ 1 ++// CHECK_SKX_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_SKX_M32: #define __CLWB__ 1 ++// CHECK_SKX_M32: #define __F16C__ 1 ++// CHECK_SKX_M32: #define __FMA__ 1 ++// CHECK_SKX_M32: #define __INVPCID__ 1 ++// CHECK_SKX_M32: #define __LZCNT__ 1 ++// CHECK_SKX_M32: #define __MMX__ 1 ++// CHECK_SKX_M32: #define __MOVBE__ 1 ++// CHECK_SKX_M32: #define __PCLMUL__ 1 ++// CHECK_SKX_M32: #define __PKU__ 1 ++// CHECK_SKX_M32: #define __POPCNT__ 1 ++// CHECK_SKX_M32: #define __PRFCHW__ 1 ++// CHECK_SKX_M32: #define __RDRND__ 1 ++// CHECK_SKX_M32: #define __RDSEED__ 1 ++// CHECK_SKX_M32-NOT: #define __SGX__ 1 ++// CHECK_SKX_M32: #define __SSE2__ 1 ++// CHECK_SKX_M32: #define __SSE3__ 1 ++// CHECK_SKX_M32: #define __SSE4_1__ 1 ++// CHECK_SKX_M32: #define __SSE4_2__ 1 ++// CHECK_SKX_M32: #define __SSE__ 1 ++// CHECK_SKX_M32: #define __SSSE3__ 1 ++// CHECK_SKX_M32: #define __XSAVEC__ 1 ++// CHECK_SKX_M32: #define __XSAVEOPT__ 1 ++// CHECK_SKX_M32: #define __XSAVES__ 1 ++// CHECK_SKX_M32: #define __XSAVE__ 1 ++// CHECK_SKX_M32: #define __corei7 1 ++// CHECK_SKX_M32: #define __corei7__ 1 ++// CHECK_SKX_M32: #define __i386 1 ++// CHECK_SKX_M32: #define __i386__ 1 ++// CHECK_SKX_M32: #define __tune_corei7__ 1 ++// CHECK_SKX_M32: #define i386 1 ++ ++// RUN: %clang -march=skylake-avx512 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SKX_M64 ++// CHECK_SKX_M64: #define __AES__ 1 ++// CHECK_SKX_M64: #define __AVX2__ 1 ++// CHECK_SKX_M64: #define __AVX512BW__ 1 ++// CHECK_SKX_M64: #define __AVX512CD__ 1 ++// CHECK_SKX_M64: #define __AVX512DQ__ 1 ++// CHECK_SKX_M64: #define __AVX512F__ 1 ++// CHECK_SKX_M64: #define __AVX512VL__ 1 ++// CHECK_SKX_M64: #define __AVX__ 1 ++// CHECK_SKX_M64: #define __BMI2__ 1 ++// CHECK_SKX_M64: #define __BMI__ 1 ++// CHECK_SKX_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_SKX_M64: #define __CLWB__ 1 ++// CHECK_SKX_M64: #define __F16C__ 1 ++// CHECK_SKX_M64: #define __FMA__ 1 ++// CHECK_SKX_M64: #define __INVPCID__ 1 ++// CHECK_SKX_M64: #define __LZCNT__ 1 ++// CHECK_SKX_M64: #define __MMX__ 1 ++// CHECK_SKX_M64: #define __MOVBE__ 1 ++// CHECK_SKX_M64: #define __PCLMUL__ 1 ++// CHECK_SKX_M64: #define __PKU__ 1 ++// CHECK_SKX_M64: #define __POPCNT__ 1 ++// CHECK_SKX_M64: #define __PRFCHW__ 1 ++// CHECK_SKX_M64: #define __RDRND__ 1 ++// CHECK_SKX_M64: #define __RDSEED__ 1 ++// CHECK_SKX_M64-NOT: #define __SGX__ 1 ++// CHECK_SKX_M64: #define __SSE2_MATH__ 1 ++// CHECK_SKX_M64: #define __SSE2__ 1 ++// CHECK_SKX_M64: #define __SSE3__ 1 ++// CHECK_SKX_M64: #define __SSE4_1__ 1 ++// CHECK_SKX_M64: #define __SSE4_2__ 1 ++// CHECK_SKX_M64: #define __SSE_MATH__ 1 ++// CHECK_SKX_M64: #define __SSE__ 1 ++// CHECK_SKX_M64: #define __SSSE3__ 1 ++// CHECK_SKX_M64: #define __XSAVEC__ 1 ++// CHECK_SKX_M64: #define __XSAVEOPT__ 1 ++// CHECK_SKX_M64: #define __XSAVES__ 1 ++// CHECK_SKX_M64: #define __XSAVE__ 1 ++// CHECK_SKX_M64: #define __amd64 1 ++// CHECK_SKX_M64: #define __amd64__ 1 ++// CHECK_SKX_M64: #define __corei7 1 ++// CHECK_SKX_M64: #define __corei7__ 1 ++// CHECK_SKX_M64: #define __tune_corei7__ 1 ++// CHECK_SKX_M64: #define __x86_64 1 ++// CHECK_SKX_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=cascadelake -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CLX_M32 ++// CHECK_CLX_M32: #define __AES__ 1 ++// CHECK_CLX_M32: #define __AVX2__ 1 ++// CHECK_CLX_M32: #define __AVX512BW__ 1 ++// CHECK_CLX_M32: #define __AVX512CD__ 1 ++// CHECK_CLX_M32: #define __AVX512DQ__ 1 ++// CHECK_CLX_M32: #define __AVX512F__ 1 ++// CHECK_CLX_M32: #define __AVX512VL__ 1 ++// CHECK_CLX_M32: #define __AVX512VNNI__ 1 ++// CHECK_CLX_M32: #define __AVX__ 1 ++// CHECK_CLX_M32: #define __BMI2__ 1 ++// CHECK_CLX_M32: #define __BMI__ 1 ++// CHECK_CLX_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_CLX_M32: #define __CLWB__ 1 ++// CHECK_CLX_M32: #define __F16C__ 1 ++// CHECK_CLX_M32: #define __FMA__ 1 ++// CHECK_CLX_M32: #define __INVPCID__ 1 ++// CHECK_CLX_M32: #define __LZCNT__ 1 ++// CHECK_CLX_M32: #define __MMX__ 1 ++// CHECK_CLX_M32: #define __MOVBE__ 1 ++// CHECK_CLX_M32: #define __PCLMUL__ 1 ++// CHECK_CLX_M32: #define __PKU__ 1 ++// CHECK_CLX_M32: #define __POPCNT__ 1 ++// CHECK_CLX_M32: #define __PRFCHW__ 1 ++// CHECK_CLX_M32: #define __RDRND__ 1 ++// CHECK_CLX_M32: #define __RDSEED__ 1 ++// CHECK_CLX_M32-NOT: #define __SGX__ 1 ++// CHECK_CLX_M32: #define __SSE2__ 1 ++// CHECK_CLX_M32: #define __SSE3__ 1 ++// CHECK_CLX_M32: #define __SSE4_1__ 1 ++// CHECK_CLX_M32: #define __SSE4_2__ 1 ++// CHECK_CLX_M32: #define __SSE__ 1 ++// CHECK_CLX_M32: #define __SSSE3__ 1 ++// CHECK_CLX_M32: #define __XSAVEC__ 1 ++// CHECK_CLX_M32: #define __XSAVEOPT__ 1 ++// CHECK_CLX_M32: #define __XSAVES__ 1 ++// CHECK_CLX_M32: #define __XSAVE__ 1 ++// CHECK_CLX_M32: #define __corei7 1 ++// CHECK_CLX_M32: #define __corei7__ 1 ++// CHECK_CLX_M32: #define __i386 1 ++// CHECK_CLX_M32: #define __i386__ 1 ++// CHECK_CLX_M32: #define __tune_corei7__ 1 ++// CHECK_CLX_M32: #define i386 1 ++ ++// RUN: %clang -march=cascadelake -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CLX_M64 ++// CHECK_CLX_M64: #define __AES__ 1 ++// CHECK_CLX_M64: #define __AVX2__ 1 ++// CHECK_CLX_M64: #define __AVX512BW__ 1 ++// CHECK_CLX_M64: #define __AVX512CD__ 1 ++// CHECK_CLX_M64: #define __AVX512DQ__ 1 ++// CHECK_CLX_M64: #define __AVX512F__ 1 ++// CHECK_CLX_M64: #define __AVX512VL__ 1 ++// CHECK_CLX_M64: #define __AVX512VNNI__ 1 ++// CHECK_CLX_M64: #define __AVX__ 1 ++// CHECK_CLX_M64: #define __BMI2__ 1 ++// CHECK_CLX_M64: #define __BMI__ 1 ++// CHECK_CLX_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_CLX_M64: #define __CLWB__ 1 ++// CHECK_CLX_M64: #define __F16C__ 1 ++// CHECK_CLX_M64: #define __FMA__ 1 ++// CHECK_CLX_M64: #define __INVPCID__ 1 ++// CHECK_CLX_M64: #define __LZCNT__ 1 ++// CHECK_CLX_M64: #define __MMX__ 1 ++// CHECK_CLX_M64: #define __MOVBE__ 1 ++// CHECK_CLX_M64: #define __PCLMUL__ 1 ++// CHECK_CLX_M64: #define __PKU__ 1 ++// CHECK_CLX_M64: #define __POPCNT__ 1 ++// CHECK_CLX_M64: #define __PRFCHW__ 1 ++// CHECK_CLX_M64: #define __RDRND__ 1 ++// CHECK_CLX_M64: #define __RDSEED__ 1 ++// CHECK_CLX_M64-NOT: #define __SGX__ 1 ++// CHECK_CLX_M64: #define __SSE2_MATH__ 1 ++// CHECK_CLX_M64: #define __SSE2__ 1 ++// CHECK_CLX_M64: #define __SSE3__ 1 ++// CHECK_CLX_M64: #define __SSE4_1__ 1 ++// CHECK_CLX_M64: #define __SSE4_2__ 1 ++// CHECK_CLX_M64: #define __SSE_MATH__ 1 ++// CHECK_CLX_M64: #define __SSE__ 1 ++// CHECK_CLX_M64: #define __SSSE3__ 1 ++// CHECK_CLX_M64: #define __XSAVEC__ 1 ++// CHECK_CLX_M64: #define __XSAVEOPT__ 1 ++// CHECK_CLX_M64: #define __XSAVES__ 1 ++// CHECK_CLX_M64: #define __XSAVE__ 1 ++// CHECK_CLX_M64: #define __amd64 1 ++// CHECK_CLX_M64: #define __amd64__ 1 ++// CHECK_CLX_M64: #define __corei7 1 ++// CHECK_CLX_M64: #define __corei7__ 1 ++// CHECK_CLX_M64: #define __tune_corei7__ 1 ++// CHECK_CLX_M64: #define __x86_64 1 ++// CHECK_CLX_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=cooperlake -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CPX_M32 ++// CHECK_CPX_M32: #define __AES__ 1 ++// CHECK_CPX_M32: #define __AVX2__ 1 ++// CHECK_CPX_M32: #define __AVX512BF16__ 1 ++// CHECK_CPX_M32: #define __AVX512BW__ 1 ++// CHECK_CPX_M32: #define __AVX512CD__ 1 ++// CHECK_CPX_M32: #define __AVX512DQ__ 1 ++// CHECK_CPX_M32: #define __AVX512F__ 1 ++// CHECK_CPX_M32: #define __AVX512VL__ 1 ++// CHECK_CPX_M32: #define __AVX512VNNI__ 1 ++// CHECK_CPX_M32: #define __AVX__ 1 ++// CHECK_CPX_M32: #define __BMI2__ 1 ++// CHECK_CPX_M32: #define __BMI__ 1 ++// CHECK_CPX_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_CPX_M32: #define __CLWB__ 1 ++// CHECK_CPX_M32: #define __F16C__ 1 ++// CHECK_CPX_M32: #define __FMA__ 1 ++// CHECK_CPX_M32: #define __INVPCID__ 1 ++// CHECK_CPX_M32: #define __LZCNT__ 1 ++// CHECK_CPX_M32: #define __MMX__ 1 ++// CHECK_CPX_M32: #define __MOVBE__ 1 ++// CHECK_CPX_M32: #define __PCLMUL__ 1 ++// CHECK_CPX_M32: #define __PKU__ 1 ++// CHECK_CPX_M32: #define __POPCNT__ 1 ++// CHECK_CPX_M32: #define __PRFCHW__ 1 ++// CHECK_CPX_M32: #define __RDRND__ 1 ++// CHECK_CPX_M32: #define __RDSEED__ 1 ++// CHECK_CPX_M32-NOT: #define __SGX__ 1 ++// CHECK_CPX_M32: #define __SSE2__ 1 ++// CHECK_CPX_M32: #define __SSE3__ 1 ++// CHECK_CPX_M32: #define __SSE4_1__ 1 ++// CHECK_CPX_M32: #define __SSE4_2__ 1 ++// CHECK_CPX_M32: #define __SSE__ 1 ++// CHECK_CPX_M32: #define __SSSE3__ 1 ++// CHECK_CPX_M32: #define __XSAVEC__ 1 ++// CHECK_CPX_M32: #define __XSAVEOPT__ 1 ++// CHECK_CPX_M32: #define __XSAVES__ 1 ++// CHECK_CPX_M32: #define __XSAVE__ 1 ++// CHECK_CPX_M32: #define __corei7 1 ++// CHECK_CPX_M32: #define __corei7__ 1 ++// CHECK_CPX_M32: #define __i386 1 ++// CHECK_CPX_M32: #define __i386__ 1 ++// CHECK_CPX_M32: #define __tune_corei7__ 1 ++// CHECK_CPX_M32: #define i386 1 ++ ++// RUN: %clang -march=cooperlake -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CPX_M64 ++// CHECK_CPX_M64: #define __AES__ 1 ++// CHECK_CPX_M64: #define __AVX2__ 1 ++// CHECK_CPX_M64: #define __AVX512BF16__ 1 ++// CHECK_CPX_M64: #define __AVX512BW__ 1 ++// CHECK_CPX_M64: #define __AVX512CD__ 1 ++// CHECK_CPX_M64: #define __AVX512DQ__ 1 ++// CHECK_CPX_M64: #define __AVX512F__ 1 ++// CHECK_CPX_M64: #define __AVX512VL__ 1 ++// CHECK_CPX_M64: #define __AVX512VNNI__ 1 ++// CHECK_CPX_M64: #define __AVX__ 1 ++// CHECK_CPX_M64: #define __BMI2__ 1 ++// CHECK_CPX_M64: #define __BMI__ 1 ++// CHECK_CPX_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_CPX_M64: #define __CLWB__ 1 ++// CHECK_CPX_M64: #define __F16C__ 1 ++// CHECK_CPX_M64: #define __FMA__ 1 ++// CHECK_CPX_M64: #define __INVPCID__ 1 ++// CHECK_CPX_M64: #define __LZCNT__ 1 ++// CHECK_CPX_M64: #define __MMX__ 1 ++// CHECK_CPX_M64: #define __MOVBE__ 1 ++// CHECK_CPX_M64: #define __PCLMUL__ 1 ++// CHECK_CPX_M64: #define __PKU__ 1 ++// CHECK_CPX_M64: #define __POPCNT__ 1 ++// CHECK_CPX_M64: #define __PRFCHW__ 1 ++// CHECK_CPX_M64: #define __RDRND__ 1 ++// CHECK_CPX_M64: #define __RDSEED__ 1 ++// CHECK_CPX_M64-NOT: #define __SGX__ 1 ++// CHECK_CPX_M64: #define __SSE2_MATH__ 1 ++// CHECK_CPX_M64: #define __SSE2__ 1 ++// CHECK_CPX_M64: #define __SSE3__ 1 ++// CHECK_CPX_M64: #define __SSE4_1__ 1 ++// CHECK_CPX_M64: #define __SSE4_2__ 1 ++// CHECK_CPX_M64: #define __SSE_MATH__ 1 ++// CHECK_CPX_M64: #define __SSE__ 1 ++// CHECK_CPX_M64: #define __SSSE3__ 1 ++// CHECK_CPX_M64: #define __XSAVEC__ 1 ++// CHECK_CPX_M64: #define __XSAVEOPT__ 1 ++// CHECK_CPX_M64: #define __XSAVES__ 1 ++// CHECK_CPX_M64: #define __XSAVE__ 1 ++// CHECK_CPX_M64: #define __amd64 1 ++// CHECK_CPX_M64: #define __amd64__ 1 ++// CHECK_CPX_M64: #define __corei7 1 ++// CHECK_CPX_M64: #define __corei7__ 1 ++// CHECK_CPX_M64: #define __tune_corei7__ 1 ++// CHECK_CPX_M64: #define __x86_64 1 ++// CHECK_CPX_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=cannonlake -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CNL_M32 ++// CHECK_CNL_M32: #define __AES__ 1 ++// CHECK_CNL_M32: #define __AVX2__ 1 ++// CHECK_CNL_M32: #define __AVX512BW__ 1 ++// CHECK_CNL_M32: #define __AVX512CD__ 1 ++// CHECK_CNL_M32: #define __AVX512DQ__ 1 ++// CHECK_CNL_M32: #define __AVX512F__ 1 ++// CHECK_CNL_M32: #define __AVX512IFMA__ 1 ++// CHECK_CNL_M32: #define __AVX512VBMI__ 1 ++// CHECK_CNL_M32: #define __AVX512VL__ 1 ++// CHECK_CNL_M32: #define __AVX__ 1 ++// CHECK_CNL_M32: #define __BMI2__ 1 ++// CHECK_CNL_M32: #define __BMI__ 1 ++// CHECK_CNL_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_CNL_M32-NOT: #define __CLWB__ 1 ++// CHECK_CNL_M32: #define __F16C__ 1 ++// CHECK_CNL_M32: #define __FMA__ 1 ++// CHECK_CNL_M32: #define __INVPCID__ 1 ++// CHECK_CNL_M32: #define __LZCNT__ 1 ++// CHECK_CNL_M32: #define __MMX__ 1 ++// CHECK_CNL_M32: #define __MOVBE__ 1 ++// CHECK_CNL_M32: #define __PCLMUL__ 1 ++// CHECK_CNL_M32: #define __PKU__ 1 ++// CHECK_CNL_M32: #define __POPCNT__ 1 ++// CHECK_CNL_M32: #define __PRFCHW__ 1 ++// CHECK_CNL_M32: #define __RDRND__ 1 ++// CHECK_CNL_M32: #define __RDSEED__ 1 ++// CHECK_CNL_M32: #define __SGX__ 1 ++// CHECK_CNL_M32: #define __SHA__ 1 ++// CHECK_CNL_M32: #define __SSE2__ 1 ++// CHECK_CNL_M32: #define __SSE3__ 1 ++// CHECK_CNL_M32: #define __SSE4_1__ 1 ++// CHECK_CNL_M32: #define __SSE4_2__ 1 ++// CHECK_CNL_M32: #define __SSE__ 1 ++// CHECK_CNL_M32: #define __SSSE3__ 1 ++// CHECK_CNL_M32: #define __XSAVEC__ 1 ++// CHECK_CNL_M32: #define __XSAVEOPT__ 1 ++// CHECK_CNL_M32: #define __XSAVES__ 1 ++// CHECK_CNL_M32: #define __XSAVE__ 1 ++// CHECK_CNL_M32: #define __corei7 1 ++// CHECK_CNL_M32: #define __corei7__ 1 ++// CHECK_CNL_M32: #define __i386 1 ++// CHECK_CNL_M32: #define __i386__ 1 ++// CHECK_CNL_M32: #define __tune_corei7__ 1 ++// CHECK_CNL_M32: #define i386 1 ++ ++// RUN: %clang -march=cannonlake -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_CNL_M64 ++// CHECK_CNL_M64: #define __AES__ 1 ++// CHECK_CNL_M64: #define __AVX2__ 1 ++// CHECK_CNL_M64: #define __AVX512BW__ 1 ++// CHECK_CNL_M64: #define __AVX512CD__ 1 ++// CHECK_CNL_M64: #define __AVX512DQ__ 1 ++// CHECK_CNL_M64: #define __AVX512F__ 1 ++// CHECK_CNL_M64: #define __AVX512IFMA__ 1 ++// CHECK_CNL_M64: #define __AVX512VBMI__ 1 ++// CHECK_CNL_M64: #define __AVX512VL__ 1 ++// CHECK_CNL_M64: #define __AVX__ 1 ++// CHECK_CNL_M64: #define __BMI2__ 1 ++// CHECK_CNL_M64: #define __BMI__ 1 ++// CHECK_CNL_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_CNL_M64-NOT: #define __CLWB__ 1 ++// CHECK_CNL_M64: #define __F16C__ 1 ++// CHECK_CNL_M64: #define __FMA__ 1 ++// CHECK_CNL_M64: #define __INVPCID__ 1 ++// CHECK_CNL_M64: #define __LZCNT__ 1 ++// CHECK_CNL_M64: #define __MMX__ 1 ++// CHECK_CNL_M64: #define __MOVBE__ 1 ++// CHECK_CNL_M64: #define __PCLMUL__ 1 ++// CHECK_CNL_M64: #define __PKU__ 1 ++// CHECK_CNL_M64: #define __POPCNT__ 1 ++// CHECK_CNL_M64: #define __PRFCHW__ 1 ++// CHECK_CNL_M64: #define __RDRND__ 1 ++// CHECK_CNL_M64: #define __RDSEED__ 1 ++// CHECK_CNL_M64: #define __SGX__ 1 ++// CHECK_CNL_M64: #define __SHA__ 1 ++// CHECK_CNL_M64: #define __SSE2__ 1 ++// CHECK_CNL_M64: #define __SSE3__ 1 ++// CHECK_CNL_M64: #define __SSE4_1__ 1 ++// CHECK_CNL_M64: #define __SSE4_2__ 1 ++// CHECK_CNL_M64: #define __SSE__ 1 ++// CHECK_CNL_M64: #define __SSSE3__ 1 ++// CHECK_CNL_M64: #define __XSAVEC__ 1 ++// CHECK_CNL_M64: #define __XSAVEOPT__ 1 ++// CHECK_CNL_M64: #define __XSAVES__ 1 ++// CHECK_CNL_M64: #define __XSAVE__ 1 ++// CHECK_CNL_M64: #define __amd64 1 ++// CHECK_CNL_M64: #define __amd64__ 1 ++// CHECK_CNL_M64: #define __corei7 1 ++// CHECK_CNL_M64: #define __corei7__ 1 ++// CHECK_CNL_M64: #define __tune_corei7__ 1 ++// CHECK_CNL_M64: #define __x86_64 1 ++// CHECK_CNL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=icelake-client -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ICL_M32 ++// CHECK_ICL_M32: #define __AES__ 1 ++// CHECK_ICL_M32: #define __AVX2__ 1 ++// CHECK_ICL_M32: #define __AVX512BITALG__ 1 ++// CHECK_ICL_M32: #define __AVX512BW__ 1 ++// CHECK_ICL_M32: #define __AVX512CD__ 1 ++// CHECK_ICL_M32: #define __AVX512DQ__ 1 ++// CHECK_ICL_M32: #define __AVX512F__ 1 ++// CHECK_ICL_M32: #define __AVX512IFMA__ 1 ++// CHECK_ICL_M32: #define __AVX512VBMI2__ 1 ++// CHECK_ICL_M32: #define __AVX512VBMI__ 1 ++// CHECK_ICL_M32: #define __AVX512VL__ 1 ++// CHECK_ICL_M32: #define __AVX512VNNI__ 1 ++// CHECK_ICL_M32: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_ICL_M32: #define __AVX__ 1 ++// CHECK_ICL_M32: #define __BMI2__ 1 ++// CHECK_ICL_M32: #define __BMI__ 1 ++// CHECK_ICL_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_ICL_M32: #define __CLWB__ 1 ++// CHECK_ICL_M32: #define __F16C__ 1 ++// CHECK_ICL_M32: #define __FMA__ 1 ++// CHECK_ICL_M32: #define __GFNI__ 1 ++// CHECK_ICL_M32: #define __INVPCID__ 1 ++// CHECK_ICL_M32: #define __LZCNT__ 1 ++// CHECK_ICL_M32: #define __MMX__ 1 ++// CHECK_ICL_M32: #define __MOVBE__ 1 ++// CHECK_ICL_M32: #define __PCLMUL__ 1 ++// CHECK_ICL_M32: #define __PKU__ 1 ++// CHECK_ICL_M32: #define __POPCNT__ 1 ++// CHECK_ICL_M32: #define __PRFCHW__ 1 ++// CHECK_ICL_M32: #define __RDPID__ 1 ++// CHECK_ICL_M32: #define __RDRND__ 1 ++// CHECK_ICL_M32: #define __RDSEED__ 1 ++// CHECK_ICL_M32: #define __SGX__ 1 ++// CHECK_ICL_M32: #define __SHA__ 1 ++// CHECK_ICL_M32: #define __SSE2__ 1 ++// CHECK_ICL_M32: #define __SSE3__ 1 ++// CHECK_ICL_M32: #define __SSE4_1__ 1 ++// CHECK_ICL_M32: #define __SSE4_2__ 1 ++// CHECK_ICL_M32: #define __SSE__ 1 ++// CHECK_ICL_M32: #define __SSSE3__ 1 ++// CHECK_ICL_M32: #define __VAES__ 1 ++// CHECK_ICL_M32: #define __VPCLMULQDQ__ 1 ++// CHECK_ICL_M32-NOT: #define __WBNOINVD__ 1 ++// CHECK_ICL_M32: #define __XSAVEC__ 1 ++// CHECK_ICL_M32: #define __XSAVEOPT__ 1 ++// CHECK_ICL_M32: #define __XSAVES__ 1 ++// CHECK_ICL_M32: #define __XSAVE__ 1 ++// CHECK_ICL_M32: #define __corei7 1 ++// CHECK_ICL_M32: #define __corei7__ 1 ++// CHECK_ICL_M32: #define __i386 1 ++// CHECK_ICL_M32: #define __i386__ 1 ++// CHECK_ICL_M32: #define __tune_corei7__ 1 ++// CHECK_ICL_M32: #define i386 1 ++ ++// RUN: %clang -march=icelake-client -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ICL_M64 ++// CHECK_ICL_M64: #define __AES__ 1 ++// CHECK_ICL_M64: #define __AVX2__ 1 ++// CHECK_ICL_M64: #define __AVX512BITALG__ 1 ++// CHECK_ICL_M64: #define __AVX512BW__ 1 ++// CHECK_ICL_M64: #define __AVX512CD__ 1 ++// CHECK_ICL_M64: #define __AVX512DQ__ 1 ++// CHECK_ICL_M64: #define __AVX512F__ 1 ++// CHECK_ICL_M64: #define __AVX512IFMA__ 1 ++// CHECK_ICL_M64: #define __AVX512VBMI2__ 1 ++// CHECK_ICL_M64: #define __AVX512VBMI__ 1 ++// CHECK_ICL_M64: #define __AVX512VL__ 1 ++// CHECK_ICL_M64: #define __AVX512VNNI__ 1 ++// CHECK_ICL_M64: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_ICL_M64: #define __AVX__ 1 ++// CHECK_ICL_M64: #define __BMI2__ 1 ++// CHECK_ICL_M64: #define __BMI__ 1 ++// CHECK_ICL_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_ICL_M64: #define __CLWB__ 1 ++// CHECK_ICL_M64: #define __F16C__ 1 ++// CHECK_ICL_M64: #define __FMA__ 1 ++// CHECK_ICL_M64: #define __GFNI__ 1 ++// CHECK_ICL_M64: #define __INVPCID__ 1 ++// CHECK_ICL_M64: #define __LZCNT__ 1 ++// CHECK_ICL_M64: #define __MMX__ 1 ++// CHECK_ICL_M64: #define __MOVBE__ 1 ++// CHECK_ICL_M64: #define __PCLMUL__ 1 ++// CHECK_ICL_M64: #define __PKU__ 1 ++// CHECK_ICL_M64: #define __POPCNT__ 1 ++// CHECK_ICL_M64: #define __PRFCHW__ 1 ++// CHECK_ICL_M64: #define __RDPID__ 1 ++// CHECK_ICL_M64: #define __RDRND__ 1 ++// CHECK_ICL_M64: #define __RDSEED__ 1 ++// CHECK_ICL_M64: #define __SGX__ 1 ++// CHECK_ICL_M64: #define __SHA__ 1 ++// CHECK_ICL_M64: #define __SSE2__ 1 ++// CHECK_ICL_M64: #define __SSE3__ 1 ++// CHECK_ICL_M64: #define __SSE4_1__ 1 ++// CHECK_ICL_M64: #define __SSE4_2__ 1 ++// CHECK_ICL_M64: #define __SSE__ 1 ++// CHECK_ICL_M64: #define __SSSE3__ 1 ++// CHECK_ICL_M64: #define __VAES__ 1 ++// CHECK_ICL_M64: #define __VPCLMULQDQ__ 1 ++// CHECK_ICL_M64-NOT: #define __WBNOINVD__ 1 ++// CHECK_ICL_M64: #define __XSAVEC__ 1 ++// CHECK_ICL_M64: #define __XSAVEOPT__ 1 ++// CHECK_ICL_M64: #define __XSAVES__ 1 ++// CHECK_ICL_M64: #define __XSAVE__ 1 ++// CHECK_ICL_M64: #define __amd64 1 ++// CHECK_ICL_M64: #define __amd64__ 1 ++// CHECK_ICL_M64: #define __corei7 1 ++// CHECK_ICL_M64: #define __corei7__ 1 ++// CHECK_ICL_M64: #define __tune_corei7__ 1 ++// CHECK_ICL_M64: #define __x86_64 1 ++// CHECK_ICL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=icelake-server -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ICX_M32 ++// CHECK_ICX_M32: #define __AES__ 1 ++// CHECK_ICX_M32: #define __AVX2__ 1 ++// CHECK_ICX_M32: #define __AVX512BITALG__ 1 ++// CHECK_ICX_M32: #define __AVX512BW__ 1 ++// CHECK_ICX_M32: #define __AVX512CD__ 1 ++// CHECK_ICX_M32: #define __AVX512DQ__ 1 ++// CHECK_ICX_M32: #define __AVX512F__ 1 ++// CHECK_ICX_M32: #define __AVX512IFMA__ 1 ++// CHECK_ICX_M32: #define __AVX512VBMI2__ 1 ++// CHECK_ICX_M32: #define __AVX512VBMI__ 1 ++// CHECK_ICX_M32: #define __AVX512VL__ 1 ++// CHECK_ICX_M32: #define __AVX512VNNI__ 1 ++// CHECK_ICX_M32: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_ICX_M32: #define __AVX__ 1 ++// CHECK_ICX_M32: #define __BMI2__ 1 ++// CHECK_ICX_M32: #define __BMI__ 1 ++// CHECK_ICX_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_ICX_M32: #define __CLWB__ 1 ++// CHECK_ICX_M32: #define __F16C__ 1 ++// CHECK_ICX_M32: #define __FMA__ 1 ++// CHECK_ICX_M32: #define __GFNI__ 1 ++// CHECK_ICX_M32: #define __INVPCID__ 1 ++// CHECK_ICX_M32: #define __LZCNT__ 1 ++// CHECK_ICX_M32: #define __MMX__ 1 ++// CHECK_ICX_M32: #define __MOVBE__ 1 ++// CHECK_ICX_M32: #define __PCLMUL__ 1 ++// CHECK_ICX_M32: #define __PCONFIG__ 1 ++// CHECK_ICX_M32: #define __PKU__ 1 ++// CHECK_ICX_M32: #define __POPCNT__ 1 ++// CHECK_ICX_M32: #define __PRFCHW__ 1 ++// CHECK_ICX_M32: #define __RDPID__ 1 ++// CHECK_ICX_M32: #define __RDRND__ 1 ++// CHECK_ICX_M32: #define __RDSEED__ 1 ++// CHECK_ICX_M32: #define __SGX__ 1 ++// CHECK_ICX_M32: #define __SHA__ 1 ++// CHECK_ICX_M32: #define __SSE2__ 1 ++// CHECK_ICX_M32: #define __SSE3__ 1 ++// CHECK_ICX_M32: #define __SSE4_1__ 1 ++// CHECK_ICX_M32: #define __SSE4_2__ 1 ++// CHECK_ICX_M32: #define __SSE__ 1 ++// CHECK_ICX_M32: #define __SSSE3__ 1 ++// CHECK_ICX_M32: #define __VAES__ 1 ++// CHECK_ICX_M32: #define __VPCLMULQDQ__ 1 ++// CHECK_ICX_M32: #define __WBNOINVD__ 1 ++// CHECK_ICX_M32: #define __XSAVEC__ 1 ++// CHECK_ICX_M32: #define __XSAVEOPT__ 1 ++// CHECK_ICX_M32: #define __XSAVES__ 1 ++// CHECK_ICX_M32: #define __XSAVE__ 1 ++// CHECK_ICX_M32: #define __corei7 1 ++// CHECK_ICX_M32: #define __corei7__ 1 ++// CHECK_ICX_M32: #define __i386 1 ++// CHECK_ICX_M32: #define __i386__ 1 ++// CHECK_ICX_M32: #define __tune_corei7__ 1 ++// CHECK_ICX_M32: #define i386 1 ++ ++// RUN: %clang -march=icelake-server -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ICX_M64 ++// CHECK_ICX_M64: #define __AES__ 1 ++// CHECK_ICX_M64: #define __AVX2__ 1 ++// CHECK_ICX_M64: #define __AVX512BITALG__ 1 ++// CHECK_ICX_M64: #define __AVX512BW__ 1 ++// CHECK_ICX_M64: #define __AVX512CD__ 1 ++// CHECK_ICX_M64: #define __AVX512DQ__ 1 ++// CHECK_ICX_M64: #define __AVX512F__ 1 ++// CHECK_ICX_M64: #define __AVX512IFMA__ 1 ++// CHECK_ICX_M64: #define __AVX512VBMI2__ 1 ++// CHECK_ICX_M64: #define __AVX512VBMI__ 1 ++// CHECK_ICX_M64: #define __AVX512VL__ 1 ++// CHECK_ICX_M64: #define __AVX512VNNI__ 1 ++// CHECK_ICX_M64: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_ICX_M64: #define __AVX__ 1 ++// CHECK_ICX_M64: #define __BMI2__ 1 ++// CHECK_ICX_M64: #define __BMI__ 1 ++// CHECK_ICX_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_ICX_M64: #define __CLWB__ 1 ++// CHECK_ICX_M64: #define __F16C__ 1 ++// CHECK_ICX_M64: #define __FMA__ 1 ++// CHECK_ICX_M64: #define __GFNI__ 1 ++// CHECK_ICX_M64: #define __INVPCID__ 1 ++// CHECK_ICX_M64: #define __LZCNT__ 1 ++// CHECK_ICX_M64: #define __MMX__ 1 ++// CHECK_ICX_M64: #define __MOVBE__ 1 ++// CHECK_ICX_M64: #define __PCLMUL__ 1 ++// CHECK_ICX_M64: #define __PCONFIG__ 1 ++// CHECK_ICX_M64: #define __PKU__ 1 ++// CHECK_ICX_M64: #define __POPCNT__ 1 ++// CHECK_ICX_M64: #define __PRFCHW__ 1 ++// CHECK_ICX_M64: #define __RDPID__ 1 ++// CHECK_ICX_M64: #define __RDRND__ 1 ++// CHECK_ICX_M64: #define __RDSEED__ 1 ++// CHECK_ICX_M64: #define __SGX__ 1 ++// CHECK_ICX_M64: #define __SHA__ 1 ++// CHECK_ICX_M64: #define __SSE2__ 1 ++// CHECK_ICX_M64: #define __SSE3__ 1 ++// CHECK_ICX_M64: #define __SSE4_1__ 1 ++// CHECK_ICX_M64: #define __SSE4_2__ 1 ++// CHECK_ICX_M64: #define __SSE__ 1 ++// CHECK_ICX_M64: #define __SSSE3__ 1 ++// CHECK_ICX_M64: #define __VAES__ 1 ++// CHECK_ICX_M64: #define __VPCLMULQDQ__ 1 ++// CHECK_ICX_M64: #define __WBNOINVD__ 1 ++// CHECK_ICX_M64: #define __XSAVEC__ 1 ++// CHECK_ICX_M64: #define __XSAVEOPT__ 1 ++// CHECK_ICX_M64: #define __XSAVES__ 1 ++// CHECK_ICX_M64: #define __XSAVE__ 1 ++// CHECK_ICX_M64: #define __amd64 1 ++// CHECK_ICX_M64: #define __amd64__ 1 ++// CHECK_ICX_M64: #define __corei7 1 ++// CHECK_ICX_M64: #define __corei7__ 1 ++// CHECK_ICX_M64: #define __tune_corei7__ 1 ++// CHECK_ICX_M64: #define __x86_64 1 ++// CHECK_ICX_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=tigerlake -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_TGL_M32 ++// CHECK_TGL_M32: #define __AES__ 1 ++// CHECK_TGL_M32: #define __AVX2__ 1 ++// CHECK_TGL_M32: #define __AVX512BITALG__ 1 ++// CHECK_TGL_M32: #define __AVX512BW__ 1 ++// CHECK_TGL_M32: #define __AVX512CD__ 1 ++// CHECK_TGL_M32: #define __AVX512DQ__ 1 ++// CHECK_TGL_M32: #define __AVX512F__ 1 ++// CHECK_TGL_M32: #define __AVX512IFMA__ 1 ++// CHECK_TGL_M32: #define __AVX512VBMI2__ 1 ++// CHECK_TGL_M32: #define __AVX512VBMI__ 1 ++// CHECK_TGL_M32: #define __AVX512VL__ 1 ++// CHECK_TGL_M32: #define __AVX512VNNI__ 1 ++// CHECK_TGL_M32: #define __AVX512VP2INTERSECT__ 1 ++// CHECK_TGL_M32: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_TGL_M32: #define __AVX__ 1 ++// CHECK_TGL_M32: #define __BMI2__ 1 ++// CHECK_TGL_M32: #define __BMI__ 1 ++// CHECK_TGL_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_TGL_M32: #define __CLWB__ 1 ++// CHECK_TGL_M32: #define __F16C__ 1 ++// CHECK_TGL_M32: #define __FMA__ 1 ++// CHECK_TGL_M32: #define __GFNI__ 1 ++// CHECK_TGL_M32: #define __INVPCID__ 1 ++// CHECK_TGL_M32: #define __LZCNT__ 1 ++// CHECK_TGL_M32: #define __MMX__ 1 ++// CHECK_TGL_M32: #define __MOVBE__ 1 ++// CHECK_TGL_M32: #define __MOVDIR64B__ 1 ++// CHECK_TGL_M32: #define __MOVDIRI__ 1 ++// CHECK_TGL_M32: #define __PCLMUL__ 1 ++// CHECK_TGL_M32-NOT: #define __PCONFIG__ 1 ++// CHECK_TGL_M32: #define __PKU__ 1 ++// CHECK_TGL_M32: #define __POPCNT__ 1 ++// CHECK_TGL_M32: #define __PRFCHW__ 1 ++// CHECK_TGL_M32: #define __RDPID__ 1 ++// CHECK_TGL_M32: #define __RDRND__ 1 ++// CHECK_TGL_M32: #define __RDSEED__ 1 ++// CHECK_TGL_M32: #define __SGX__ 1 ++// CHECK_TGL_M32: #define __SHA__ 1 ++// CHECK_TGL_M32: #define __SHSTK__ 1 ++// CHECK_TGL_M32: #define __SSE2__ 1 ++// CHECK_TGL_M32: #define __SSE3__ 1 ++// CHECK_TGL_M32: #define __SSE4_1__ 1 ++// CHECK_TGL_M32: #define __SSE4_2__ 1 ++// CHECK_TGL_M32: #define __SSE__ 1 ++// CHECK_TGL_M32: #define __SSSE3__ 1 ++// CHECK_TGL_M32: #define __VAES__ 1 ++// CHECK_TGL_M32: #define __VPCLMULQDQ__ 1 ++// CHECK_TGL_M32-NOT: #define __WBNOINVD__ 1 ++// CHECK_TGL_M32: #define __XSAVEC__ 1 ++// CHECK_TGL_M32: #define __XSAVEOPT__ 1 ++// CHECK_TGL_M32: #define __XSAVES__ 1 ++// CHECK_TGL_M32: #define __XSAVE__ 1 ++// CHECK_TGL_M32: #define __corei7 1 ++// CHECK_TGL_M32: #define __corei7__ 1 ++// CHECK_TGL_M32: #define __i386 1 ++// CHECK_TGL_M32: #define __i386__ 1 ++// CHECK_TGL_M32: #define __tune_corei7__ 1 ++// CHECK_TGL_M32: #define i386 1 ++ ++// RUN: %clang -march=tigerlake -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_TGL_M64 ++// CHECK_TGL_M64: #define __AES__ 1 ++// CHECK_TGL_M64: #define __AVX2__ 1 ++// CHECK_TGL_M64: #define __AVX512BITALG__ 1 ++// CHECK_TGL_M64: #define __AVX512BW__ 1 ++// CHECK_TGL_M64: #define __AVX512CD__ 1 ++// CHECK_TGL_M64: #define __AVX512DQ__ 1 ++// CHECK_TGL_M64: #define __AVX512F__ 1 ++// CHECK_TGL_M64: #define __AVX512IFMA__ 1 ++// CHECK_TGL_M64: #define __AVX512VBMI2__ 1 ++// CHECK_TGL_M64: #define __AVX512VBMI__ 1 ++// CHECK_TGL_M64: #define __AVX512VL__ 1 ++// CHECK_TGL_M64: #define __AVX512VNNI__ 1 ++// CHECK_TGL_M64: #define __AVX512VP2INTERSECT__ 1 ++// CHECK_TGL_M64: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_TGL_M64: #define __AVX__ 1 ++// CHECK_TGL_M64: #define __BMI2__ 1 ++// CHECK_TGL_M64: #define __BMI__ 1 ++// CHECK_TGL_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_TGL_M64: #define __CLWB__ 1 ++// CHECK_TGL_M64: #define __F16C__ 1 ++// CHECK_TGL_M64: #define __FMA__ 1 ++// CHECK_TGL_M64: #define __GFNI__ 1 ++// CHECK_TGL_M64: #define __INVPCID__ 1 ++// CHECK_TGL_M64: #define __LZCNT__ 1 ++// CHECK_TGL_M64: #define __MMX__ 1 ++// CHECK_TGL_M64: #define __MOVBE__ 1 ++// CHECK_TGL_M64: #define __MOVDIR64B__ 1 ++// CHECK_TGL_M64: #define __MOVDIRI__ 1 ++// CHECK_TGL_M64: #define __PCLMUL__ 1 ++// CHECK_TGL_M64-NOT: #define __PCONFIG__ 1 ++// CHECK_TGL_M64: #define __PKU__ 1 ++// CHECK_TGL_M64: #define __POPCNT__ 1 ++// CHECK_TGL_M64: #define __PRFCHW__ 1 ++// CHECK_TGL_M64: #define __RDPID__ 1 ++// CHECK_TGL_M64: #define __RDRND__ 1 ++// CHECK_TGL_M64: #define __RDSEED__ 1 ++// CHECK_TGL_M64: #define __SGX__ 1 ++// CHECK_TGL_M64: #define __SHA__ 1 ++// CHECK_TGL_M64: #define __SHSTK__ 1 ++// CHECK_TGL_M64: #define __SSE2__ 1 ++// CHECK_TGL_M64: #define __SSE3__ 1 ++// CHECK_TGL_M64: #define __SSE4_1__ 1 ++// CHECK_TGL_M64: #define __SSE4_2__ 1 ++// CHECK_TGL_M64: #define __SSE__ 1 ++// CHECK_TGL_M64: #define __SSSE3__ 1 ++// CHECK_TGL_M64: #define __VAES__ 1 ++// CHECK_TGL_M64: #define __VPCLMULQDQ__ 1 ++// CHECK_TGL_M64-NOT: #define __WBNOINVD__ 1 ++// CHECK_TGL_M64: #define __XSAVEC__ 1 ++// CHECK_TGL_M64: #define __XSAVEOPT__ 1 ++// CHECK_TGL_M64: #define __XSAVES__ 1 ++// CHECK_TGL_M64: #define __XSAVE__ 1 ++// CHECK_TGL_M64: #define __amd64 1 ++// CHECK_TGL_M64: #define __amd64__ 1 ++// CHECK_TGL_M64: #define __corei7 1 ++// CHECK_TGL_M64: #define __corei7__ 1 ++// CHECK_TGL_M64: #define __tune_corei7__ 1 ++// CHECK_TGL_M64: #define __x86_64 1 ++// CHECK_TGL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=sapphirerapids -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPR_M32 ++// CHECK_SPR_M32: #define __AES__ 1 ++// CHECK_SPR_M32: #define __AMXBF16__ 1 ++// CHECK_SPR_M32: #define __AMXINT8__ 1 ++// CHECK_SPR_M32: #define __AMXTILE__ 1 ++// CHECK_SPR_M32: #define __AVX2__ 1 ++// CHECK_SPR_M32: #define __AVX512BF16__ 1 ++// CHECK_SPR_M32: #define __AVX512BITALG__ 1 ++// CHECK_SPR_M32: #define __AVX512BW__ 1 ++// CHECK_SPR_M32: #define __AVX512CD__ 1 ++// CHECK_SPR_M32: #define __AVX512DQ__ 1 ++// CHECK_SPR_M32: #define __AVX512F__ 1 ++// CHECK_SPR_M32: #define __AVX512IFMA__ 1 ++// CHECK_SPR_M32: #define __AVX512VBMI2__ 1 ++// CHECK_SPR_M32: #define __AVX512VBMI__ 1 ++// CHECK_SPR_M32: #define __AVX512VL__ 1 ++// CHECK_SPR_M32: #define __AVX512VNNI__ 1 ++// CHECK_SPR_M32: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_SPR_M32: #define __AVXVNNI__ 1 ++// CHECK_SPR_M32: #define __AVX__ 1 ++// CHECK_SPR_M32: #define __BMI2__ 1 ++// CHECK_SPR_M32: #define __BMI__ 1 ++// CHECK_SPR_M32: #define __CLDEMOTE__ 1 ++// CHECK_SPR_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_SPR_M32: #define __CLWB__ 1 ++// CHECK_SPR_M32: #define __ENQCMD__ 1 ++// CHECK_SPR_M32: #define __F16C__ 1 ++// CHECK_SPR_M32: #define __FMA__ 1 ++// CHECK_SPR_M32: #define __GFNI__ 1 ++// CHECK_SPR_M32: #define __INVPCID__ 1 ++// CHECK_SPR_M32: #define __LZCNT__ 1 ++// CHECK_SPR_M32: #define __MMX__ 1 ++// CHECK_SPR_M32: #define __MOVBE__ 1 ++// CHECK_SPR_M32: #define __PCLMUL__ 1 ++// CHECK_SPR_M32: #define __PCONFIG__ 1 ++// CHECK_SPR_M32: #define __PKU__ 1 ++// CHECK_SPR_M32: #define __POPCNT__ 1 ++// CHECK_SPR_M32: #define __PRFCHW__ 1 ++// CHECK_SPR_M32: #define __PTWRITE__ 1 ++// CHECK_SPR_M32: #define __RDPID__ 1 ++// CHECK_SPR_M32: #define __RDRND__ 1 ++// CHECK_SPR_M32: #define __RDSEED__ 1 ++// CHECK_SPR_M32: #define __SERIALIZE__ 1 ++// CHECK_SPR_M32: #define __SGX__ 1 ++// CHECK_SPR_M32: #define __SHA__ 1 ++// CHECK_SPR_M32: #define __SHSTK__ 1 ++// CHECK_SPR_M32: #define __SSE2__ 1 ++// CHECK_SPR_M32: #define __SSE3__ 1 ++// CHECK_SPR_M32: #define __SSE4_1__ 1 ++// CHECK_SPR_M32: #define __SSE4_2__ 1 ++// CHECK_SPR_M32: #define __SSE__ 1 ++// CHECK_SPR_M32: #define __SSSE3__ 1 ++// CHECK_SPR_M32: #define __TSXLDTRK__ 1 ++// CHECK_SPR_M32: #define __UINTR__ 1 ++// CHECK_SPR_M32: #define __VAES__ 1 ++// CHECK_SPR_M32: #define __VPCLMULQDQ__ 1 ++// CHECK_SPR_M32: #define __WAITPKG__ 1 ++// CHECK_SPR_M32: #define __WBNOINVD__ 1 ++// CHECK_SPR_M32: #define __XSAVEC__ 1 ++// CHECK_SPR_M32: #define __XSAVEOPT__ 1 ++// CHECK_SPR_M32: #define __XSAVES__ 1 ++// CHECK_SPR_M32: #define __XSAVE__ 1 ++// CHECK_SPR_M32: #define __corei7 1 ++// CHECK_SPR_M32: #define __corei7__ 1 ++// CHECK_SPR_M32: #define __i386 1 ++// CHECK_SPR_M32: #define __i386__ 1 ++// CHECK_SPR_M32: #define __tune_corei7__ 1 ++// CHECK_SPR_M32: #define i386 1 ++ ++// RUN: %clang -march=sapphirerapids -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPR_M64 ++// CHECK_SPR_M64: #define __AES__ 1 ++// CHECK_SPR_M64: #define __AMXBF16__ 1 ++// CHECK_SPR_M64: #define __AMXINT8__ 1 ++// CHECK_SPR_M64: #define __AMXTILE__ 1 ++// CHECK_SPR_M64: #define __AVX2__ 1 ++// CHECK_SPR_M64: #define __AVX512BF16__ 1 ++// CHECK_SPR_M64: #define __AVX512BITALG__ 1 ++// CHECK_SPR_M64: #define __AVX512BW__ 1 ++// CHECK_SPR_M64: #define __AVX512CD__ 1 ++// CHECK_SPR_M64: #define __AVX512DQ__ 1 ++// CHECK_SPR_M64: #define __AVX512F__ 1 ++// CHECK_SPR_M64: #define __AVX512IFMA__ 1 ++// CHECK_SPR_M64: #define __AVX512VBMI2__ 1 ++// CHECK_SPR_M64: #define __AVX512VBMI__ 1 ++// CHECK_SPR_M64: #define __AVX512VL__ 1 ++// CHECK_SPR_M64: #define __AVX512VNNI__ 1 ++// CHECK_SPR_M64: #define __AVX512VPOPCNTDQ__ 1 ++// CHECK_SPR_M64: #define __AVXVNNI__ 1 ++// CHECK_SPR_M64: #define __AVX__ 1 ++// CHECK_SPR_M64: #define __BMI2__ 1 ++// CHECK_SPR_M64: #define __BMI__ 1 ++// CHECK_SPR_M64: #define __CLDEMOTE__ 1 ++// CHECK_SPR_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_SPR_M64: #define __CLWB__ 1 ++// CHECK_SPR_M64: #define __ENQCMD__ 1 ++// CHECK_SPR_M64: #define __F16C__ 1 ++// CHECK_SPR_M64: #define __FMA__ 1 ++// CHECK_SPR_M64: #define __GFNI__ 1 ++// CHECK_SPR_M64: #define __INVPCID__ 1 ++// CHECK_SPR_M64: #define __LZCNT__ 1 ++// CHECK_SPR_M64: #define __MMX__ 1 ++// CHECK_SPR_M64: #define __MOVBE__ 1 ++// CHECK_SPR_M64: #define __PCLMUL__ 1 ++// CHECK_SPR_M64: #define __PCONFIG__ 1 ++// CHECK_SPR_M64: #define __PKU__ 1 ++// CHECK_SPR_M64: #define __POPCNT__ 1 ++// CHECK_SPR_M64: #define __PRFCHW__ 1 ++// CHECK_SPR_M64: #define __PTWRITE__ 1 ++// CHECK_SPR_M64: #define __RDPID__ 1 ++// CHECK_SPR_M64: #define __RDRND__ 1 ++// CHECK_SPR_M64: #define __RDSEED__ 1 ++// CHECK_SPR_M64: #define __SERIALIZE__ 1 ++// CHECK_SPR_M64: #define __SGX__ 1 ++// CHECK_SPR_M64: #define __SHA__ 1 ++// CHECK_SPR_M64: #define __SHSTK__ 1 ++// CHECK_SPR_M64: #define __SSE2__ 1 ++// CHECK_SPR_M64: #define __SSE3__ 1 ++// CHECK_SPR_M64: #define __SSE4_1__ 1 ++// CHECK_SPR_M64: #define __SSE4_2__ 1 ++// CHECK_SPR_M64: #define __SSE__ 1 ++// CHECK_SPR_M64: #define __SSSE3__ 1 ++// CHECK_SPR_M64: #define __TSXLDTRK__ 1 ++// CHECK_SPR_M64: #define __UINTR__ 1 ++// CHECK_SPR_M64: #define __VAES__ 1 ++// CHECK_SPR_M64: #define __VPCLMULQDQ__ 1 ++// CHECK_SPR_M64: #define __WAITPKG__ 1 ++// CHECK_SPR_M64: #define __WBNOINVD__ 1 ++// CHECK_SPR_M64: #define __XSAVEC__ 1 ++// CHECK_SPR_M64: #define __XSAVEOPT__ 1 ++// CHECK_SPR_M64: #define __XSAVES__ 1 ++// CHECK_SPR_M64: #define __XSAVE__ 1 ++// CHECK_SPR_M64: #define __amd64 1 ++// CHECK_SPR_M64: #define __amd64__ 1 ++// CHECK_SPR_M64: #define __corei7 1 ++// CHECK_SPR_M64: #define __corei7__ 1 ++// CHECK_SPR_M64: #define __tune_corei7__ 1 ++// CHECK_SPR_M64: #define __x86_64 1 ++// CHECK_SPR_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=alderlake -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ADL_M32 ++// CHECK_ADL_M32: #define __ADX__ 1 ++// CHECK_ADL_M32: #define __AES__ 1 ++// CHECK_ADL_M32: #define __AVX2__ 1 ++// CHECK_ADL_M32-NOT: AVX512 ++// CHECK_ADL_M32: #define __AVXVNNI__ 1 ++// CHECK_ADL_M32: #define __AVX__ 1 ++// CHECK_ADL_M32: #define __BMI2__ 1 ++// CHECK_ADL_M32: #define __BMI__ 1 ++// CHECK_ADL_M32: #define __CLDEMOTE__ 1 ++// CHECK_ADL_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_ADL_M32: #define __F16C__ 1 ++// CHECK_ADL_M32: #define __FMA__ 1 ++// CHECK_ADL_M32: #define __HRESET__ 1 ++// CHECK_ADL_M32: #define __INVPCID__ 1 ++// CHECK_ADL_M32: #define __LZCNT__ 1 ++// CHECK_ADL_M32: #define __MMX__ 1 ++// CHECK_ADL_M32: #define __MOVBE__ 1 ++// CHECK_ADL_M32: #define __PCLMUL__ 1 ++// CHECK_ADL_M32: #define __POPCNT__ 1 ++// CHECK_ADL_M32: #define __PRFCHW__ 1 ++// CHECK_ADL_M32: #define __PTWRITE__ 1 ++// CHECK_ADL_M32: #define __RDRND__ 1 ++// CHECK_ADL_M32: #define __RDSEED__ 1 ++// CHECK_ADL_M32: #define __SERIALIZE__ 1 ++// CHECK_ADL_M32: #define __SGX__ 1 ++// CHECK_ADL_M32: #define __SSE2__ 1 ++// CHECK_ADL_M32: #define __SSE3__ 1 ++// CHECK_ADL_M32: #define __SSE4_1__ 1 ++// CHECK_ADL_M32: #define __SSE4_2__ 1 ++// CHECK_ADL_M32: #define __SSE__ 1 ++// CHECK_ADL_M32: #define __SSSE3__ 1 ++// CHECK_ADL_M32: #define __WAITPKG__ 1 ++// CHECK_ADL_M32: #define __XSAVEC__ 1 ++// CHECK_ADL_M32: #define __XSAVEOPT__ 1 ++// CHECK_ADL_M32: #define __XSAVES__ 1 ++// CHECK_ADL_M32: #define __XSAVE__ 1 ++// CHECK_ADL_M32: #define i386 1 ++ ++// RUN: %clang -march=alderlake -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ADL_M64 ++// CHECK_ADL_M64: #define __ADX__ 1 ++// CHECK_ADL_M64: #define __AES__ 1 ++// CHECK_ADL_M64: #define __AVX2__ 1 ++// CHECK_ADL_M64-NOT: AVX512 ++// CHECK_ADL_M64: #define __AVXVNNI__ 1 ++// CHECK_ADL_M64: #define __AVX__ 1 ++// CHECK_ADL_M64: #define __BMI2__ 1 ++// CHECK_ADL_M64: #define __BMI__ 1 ++// CHECK_ADL_M64: #define __CLDEMOTE__ 1 ++// CHECK_ADL_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_ADL_M64: #define __F16C__ 1 ++// CHECK_ADL_M64: #define __FMA__ 1 ++// CHECK_ADL_M64: #define __HRESET__ 1 ++// CHECK_ADL_M64: #define __INVPCID__ 1 ++// CHECK_ADL_M64: #define __LZCNT__ 1 ++// CHECK_ADL_M64: #define __MMX__ 1 ++// CHECK_ADL_M64: #define __MOVBE__ 1 ++// CHECK_ADL_M64: #define __PCLMUL__ 1 ++// CHECK_ADL_M64: #define __POPCNT__ 1 ++// CHECK_ADL_M64: #define __PRFCHW__ 1 ++// CHECK_ADL_M64: #define __PTWRITE__ 1 ++// CHECK_ADL_M64: #define __RDRND__ 1 ++// CHECK_ADL_M64: #define __RDSEED__ 1 ++// CHECK_ADL_M64: #define __SERIALIZE__ 1 ++// CHECK_ADL_M64: #define __SGX__ 1 ++// CHECK_ADL_M64: #define __SSE2_MATH__ 1 ++// CHECK_ADL_M64: #define __SSE2__ 1 ++// CHECK_ADL_M64: #define __SSE3__ 1 ++// CHECK_ADL_M64: #define __SSE4_1__ 1 ++// CHECK_ADL_M64: #define __SSE4_2__ 1 ++// CHECK_ADL_M64: #define __SSE_MATH__ 1 ++// CHECK_ADL_M64: #define __SSE__ 1 ++// CHECK_ADL_M64: #define __SSSE3__ 1 ++// CHECK_ADL_M64: #define __WAITPKG__ 1 ++// CHECK_ADL_M64: #define __XSAVEC__ 1 ++// CHECK_ADL_M64: #define __XSAVEOPT__ 1 ++// CHECK_ADL_M64: #define __XSAVES__ 1 ++// CHECK_ADL_M64: #define __XSAVE__ 1 ++// CHECK_ADL_M64: #define __amd64 1 ++// CHECK_ADL_M64: #define __amd64__ 1 ++// CHECK_ADL_M64: #define __x86_64 1 ++// CHECK_ADL_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=atom -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATOM_M32 ++// CHECK_ATOM_M32: #define __MMX__ 1 ++// CHECK_ATOM_M32: #define __MOVBE__ 1 ++// CHECK_ATOM_M32: #define __SSE2__ 1 ++// CHECK_ATOM_M32: #define __SSE3__ 1 ++// CHECK_ATOM_M32: #define __SSE__ 1 ++// CHECK_ATOM_M32: #define __SSSE3__ 1 ++// CHECK_ATOM_M32: #define __atom 1 ++// CHECK_ATOM_M32: #define __atom__ 1 ++// CHECK_ATOM_M32: #define __i386 1 ++// CHECK_ATOM_M32: #define __i386__ 1 ++// CHECK_ATOM_M32: #define __tune_atom__ 1 ++// CHECK_ATOM_M32: #define i386 1 ++ ++// RUN: %clang -march=atom -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATOM_M64 ++// CHECK_ATOM_M64: #define __MMX__ 1 ++// CHECK_ATOM_M64: #define __MOVBE__ 1 ++// CHECK_ATOM_M64: #define __SSE2_MATH__ 1 ++// CHECK_ATOM_M64: #define __SSE2__ 1 ++// CHECK_ATOM_M64: #define __SSE3__ 1 ++// CHECK_ATOM_M64: #define __SSE_MATH__ 1 ++// CHECK_ATOM_M64: #define __SSE__ 1 ++// CHECK_ATOM_M64: #define __SSSE3__ 1 ++// CHECK_ATOM_M64: #define __amd64 1 ++// CHECK_ATOM_M64: #define __amd64__ 1 ++// CHECK_ATOM_M64: #define __atom 1 ++// CHECK_ATOM_M64: #define __atom__ 1 ++// CHECK_ATOM_M64: #define __tune_atom__ 1 ++// CHECK_ATOM_M64: #define __x86_64 1 ++// CHECK_ATOM_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=goldmont -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_GLM_M32 ++// CHECK_GLM_M32: #define __AES__ 1 ++// CHECK_GLM_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_GLM_M32: #define __FSGSBASE__ 1 ++// CHECK_GLM_M32: #define __FXSR__ 1 ++// CHECK_GLM_M32: #define __MMX__ 1 ++// CHECK_GLM_M32: #define __MOVBE__ 1 ++// CHECK_GLM_M32: #define __PCLMUL__ 1 ++// CHECK_GLM_M32: #define __POPCNT__ 1 ++// CHECK_GLM_M32: #define __PRFCHW__ 1 ++// CHECK_GLM_M32: #define __RDRND__ 1 ++// CHECK_GLM_M32: #define __RDSEED__ 1 ++// CHECK_GLM_M32: #define __SHA__ 1 ++// CHECK_GLM_M32: #define __SSE2__ 1 ++// CHECK_GLM_M32: #define __SSE3__ 1 ++// CHECK_GLM_M32: #define __SSE4_1__ 1 ++// CHECK_GLM_M32: #define __SSE4_2__ 1 ++// CHECK_GLM_M32: #define __SSE_MATH__ 1 ++// CHECK_GLM_M32: #define __SSE__ 1 ++// CHECK_GLM_M32: #define __SSSE3__ 1 ++// CHECK_GLM_M32: #define __XSAVEC__ 1 ++// CHECK_GLM_M32: #define __XSAVEOPT__ 1 ++// CHECK_GLM_M32: #define __XSAVES__ 1 ++// CHECK_GLM_M32: #define __XSAVE__ 1 ++// CHECK_GLM_M32: #define __goldmont 1 ++// CHECK_GLM_M32: #define __goldmont__ 1 ++// CHECK_GLM_M32: #define __i386 1 ++// CHECK_GLM_M32: #define __i386__ 1 ++// CHECK_GLM_M32: #define __tune_goldmont__ 1 ++// CHECK_GLM_M32: #define i386 1 ++ ++// RUN: %clang -march=goldmont -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_GLM_M64 ++// CHECK_GLM_M64: #define __AES__ 1 ++// CHECK_GLM_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_GLM_M64: #define __FSGSBASE__ 1 ++// CHECK_GLM_M64: #define __FXSR__ 1 ++// CHECK_GLM_M64: #define __MMX__ 1 ++// CHECK_GLM_M64: #define __MOVBE__ 1 ++// CHECK_GLM_M64: #define __PCLMUL__ 1 ++// CHECK_GLM_M64: #define __POPCNT__ 1 ++// CHECK_GLM_M64: #define __PRFCHW__ 1 ++// CHECK_GLM_M64: #define __RDRND__ 1 ++// CHECK_GLM_M64: #define __RDSEED__ 1 ++// CHECK_GLM_M64: #define __SHA__ 1 ++// CHECK_GLM_M64: #define __SSE2__ 1 ++// CHECK_GLM_M64: #define __SSE3__ 1 ++// CHECK_GLM_M64: #define __SSE4_1__ 1 ++// CHECK_GLM_M64: #define __SSE4_2__ 1 ++// CHECK_GLM_M64: #define __SSE__ 1 ++// CHECK_GLM_M64: #define __SSSE3__ 1 ++// CHECK_GLM_M64: #define __XSAVEC__ 1 ++// CHECK_GLM_M64: #define __XSAVEOPT__ 1 ++// CHECK_GLM_M64: #define __XSAVES__ 1 ++// CHECK_GLM_M64: #define __XSAVE__ 1 ++// CHECK_GLM_M64: #define __goldmont 1 ++// CHECK_GLM_M64: #define __goldmont__ 1 ++// CHECK_GLM_M64: #define __tune_goldmont__ 1 ++// CHECK_GLM_M64: #define __x86_64 1 ++// CHECK_GLM_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=goldmont-plus -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_GLMP_M32 ++// CHECK_GLMP_M32: #define __AES__ 1 ++// CHECK_GLMP_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_GLMP_M32: #define __FSGSBASE__ 1 ++// CHECK_GLMP_M32: #define __FXSR__ 1 ++// CHECK_GLMP_M32: #define __MMX__ 1 ++// CHECK_GLMP_M32: #define __MOVBE__ 1 ++// CHECK_GLMP_M32: #define __PCLMUL__ 1 ++// CHECK_GLMP_M32: #define __POPCNT__ 1 ++// CHECK_GLMP_M32: #define __PRFCHW__ 1 ++// CHECK_GLMP_M32: #define __PTWRITE__ 1 ++// CHECK_GLMP_M32: #define __RDPID__ 1 ++// CHECK_GLMP_M32: #define __RDRND__ 1 ++// CHECK_GLMP_M32: #define __RDSEED__ 1 ++// CHECK_GLMP_M32: #define __SGX__ 1 ++// CHECK_GLMP_M32: #define __SHA__ 1 ++// CHECK_GLMP_M32: #define __SSE2__ 1 ++// CHECK_GLMP_M32: #define __SSE3__ 1 ++// CHECK_GLMP_M32: #define __SSE4_1__ 1 ++// CHECK_GLMP_M32: #define __SSE4_2__ 1 ++// CHECK_GLMP_M32: #define __SSE_MATH__ 1 ++// CHECK_GLMP_M32: #define __SSE__ 1 ++// CHECK_GLMP_M32: #define __SSSE3__ 1 ++// CHECK_GLMP_M32: #define __XSAVEC__ 1 ++// CHECK_GLMP_M32: #define __XSAVEOPT__ 1 ++// CHECK_GLMP_M32: #define __XSAVES__ 1 ++// CHECK_GLMP_M32: #define __XSAVE__ 1 ++// CHECK_GLMP_M32: #define __goldmont_plus 1 ++// CHECK_GLMP_M32: #define __goldmont_plus__ 1 ++// CHECK_GLMP_M32: #define __i386 1 ++// CHECK_GLMP_M32: #define __i386__ 1 ++// CHECK_GLMP_M32: #define __tune_goldmont_plus__ 1 ++// CHECK_GLMP_M32: #define i386 1 ++ ++// RUN: %clang -march=goldmont-plus -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_GLMP_M64 ++// CHECK_GLMP_M64: #define __AES__ 1 ++// CHECK_GLMP_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_GLMP_M64: #define __FSGSBASE__ 1 ++// CHECK_GLMP_M64: #define __FXSR__ 1 ++// CHECK_GLMP_M64: #define __MMX__ 1 ++// CHECK_GLMP_M64: #define __MOVBE__ 1 ++// CHECK_GLMP_M64: #define __PCLMUL__ 1 ++// CHECK_GLMP_M64: #define __POPCNT__ 1 ++// CHECK_GLMP_M64: #define __PRFCHW__ 1 ++// CHECK_GLMP_M64: #define __PTWRITE__ 1 ++// CHECK_GLMP_M64: #define __RDPID__ 1 ++// CHECK_GLMP_M64: #define __RDRND__ 1 ++// CHECK_GLMP_M64: #define __RDSEED__ 1 ++// CHECK_GLMP_M64: #define __SGX__ 1 ++// CHECK_GLMP_M64: #define __SHA__ 1 ++// CHECK_GLMP_M64: #define __SSE2__ 1 ++// CHECK_GLMP_M64: #define __SSE3__ 1 ++// CHECK_GLMP_M64: #define __SSE4_1__ 1 ++// CHECK_GLMP_M64: #define __SSE4_2__ 1 ++// CHECK_GLMP_M64: #define __SSE__ 1 ++// CHECK_GLMP_M64: #define __SSSE3__ 1 ++// CHECK_GLMP_M64: #define __XSAVEC__ 1 ++// CHECK_GLMP_M64: #define __XSAVEOPT__ 1 ++// CHECK_GLMP_M64: #define __XSAVES__ 1 ++// CHECK_GLMP_M64: #define __XSAVE__ 1 ++// CHECK_GLMP_M64: #define __goldmont_plus 1 ++// CHECK_GLMP_M64: #define __goldmont_plus__ 1 ++// CHECK_GLMP_M64: #define __tune_goldmont_plus__ 1 ++// CHECK_GLMP_M64: #define __x86_64 1 ++// CHECK_GLMP_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=tremont -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_TRM_M32 ++// CHECK_TRM_M32: #define __AES__ 1 ++// CHECK_TRM_M32-NOT: #define __CLDEMOTE__ 1 ++// CHECK_TRM_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_TRM_M32: #define __CLWB__ 1 ++// CHECK_TRM_M32: #define __FSGSBASE__ 1 ++// CHECK_TRM_M32: #define __FXSR__ 1 ++// CHECK_TRM_M32: #define __GFNI__ 1 ++// CHECK_TRM_M32: #define __MMX__ 1 ++// CHECK_TRM_M32: #define __MOVBE__ 1 ++// CHECK_TRM_M32-NOT: #define __MOVDIR64B__ 1 ++// CHECK_TRM_M32-NOT: #define __MOVDIRI__ 1 ++// CHECK_TRM_M32: #define __PCLMUL__ 1 ++// CHECK_TRM_M32: #define __POPCNT__ 1 ++// CHECK_TRM_M32: #define __PRFCHW__ 1 ++// CHECK_TRM_M32: #define __PTWRITE__ 1 ++// CHECK_TRM_M32: #define __RDPID__ 1 ++// CHECK_TRM_M32: #define __RDRND__ 1 ++// CHECK_TRM_M32: #define __RDSEED__ 1 ++// CHECK_TRM_M32: #define __SGX__ 1 ++// CHECK_TRM_M32: #define __SHA__ 1 ++// CHECK_TRM_M32: #define __SSE2__ 1 ++// CHECK_TRM_M32: #define __SSE3__ 1 ++// CHECK_TRM_M32: #define __SSE4_1__ 1 ++// CHECK_TRM_M32: #define __SSE4_2__ 1 ++// CHECK_TRM_M32: #define __SSE_MATH__ 1 ++// CHECK_TRM_M32: #define __SSE__ 1 ++// CHECK_TRM_M32: #define __SSSE3__ 1 ++// CHECK_TRM_M32-NOT: #define __WAITPKG__ 1 ++// CHECK_TRM_M32: #define __XSAVEC__ 1 ++// CHECK_TRM_M32: #define __XSAVEOPT__ 1 ++// CHECK_TRM_M32: #define __XSAVES__ 1 ++// CHECK_TRM_M32: #define __XSAVE__ 1 ++// CHECK_TRM_M32: #define __i386 1 ++// CHECK_TRM_M32: #define __i386__ 1 ++// CHECK_TRM_M32: #define __tremont 1 ++// CHECK_TRM_M32: #define __tremont__ 1 ++// CHECK_TRM_M32: #define __tune_tremont__ 1 ++// CHECK_TRM_M32: #define i386 1 ++ ++// RUN: %clang -march=tremont -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_TRM_M64 ++// CHECK_TRM_M64: #define __AES__ 1 ++// CHECK_TRM_M64-NOT: #define __CLDEMOTE__ 1 ++// CHECK_TRM_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_TRM_M64: #define __CLWB__ 1 ++// CHECK_TRM_M64: #define __FSGSBASE__ 1 ++// CHECK_TRM_M64: #define __FXSR__ 1 ++// CHECK_TRM_M64: #define __GFNI__ 1 ++// CHECK_TRM_M64: #define __MMX__ 1 ++// CHECK_TRM_M64: #define __MOVBE__ 1 ++// CHECK_TRM_M64-NOT: #define __MOVDIR64B__ 1 ++// CHECK_TRM_M64-NOT: #define __MOVDIRI__ 1 ++// CHECK_TRM_M64: #define __PCLMUL__ 1 ++// CHECK_TRM_M64: #define __POPCNT__ 1 ++// CHECK_TRM_M64: #define __PRFCHW__ 1 ++// CHECK_TRM_M64: #define __PTWRITE__ 1 ++// CHECK_TRM_M64: #define __RDPID__ 1 ++// CHECK_TRM_M64: #define __RDRND__ 1 ++// CHECK_TRM_M64: #define __RDSEED__ 1 ++// CHECK_TRM_M64: #define __SGX__ 1 ++// CHECK_TRM_M64: #define __SHA__ 1 ++// CHECK_TRM_M64: #define __SSE2__ 1 ++// CHECK_TRM_M64: #define __SSE3__ 1 ++// CHECK_TRM_M64: #define __SSE4_1__ 1 ++// CHECK_TRM_M64: #define __SSE4_2__ 1 ++// CHECK_TRM_M64: #define __SSE__ 1 ++// CHECK_TRM_M64: #define __SSSE3__ 1 ++// CHECK_TRM_M64-NOT: #define __WAITPKG__ 1 ++// CHECK_TRM_M64: #define __XSAVEC__ 1 ++// CHECK_TRM_M64: #define __XSAVEOPT__ 1 ++// CHECK_TRM_M64: #define __XSAVES__ 1 ++// CHECK_TRM_M64: #define __XSAVE__ 1 ++// CHECK_TRM_M64: #define __tremont 1 ++// CHECK_TRM_M64: #define __tremont__ 1 ++// CHECK_TRM_M64: #define __tune_tremont__ 1 ++// CHECK_TRM_M64: #define __x86_64 1 ++// CHECK_TRM_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=slm -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SLM_M32 ++// CHECK_SLM_M32: #define __FXSR__ 1 ++// CHECK_SLM_M32: #define __MMX__ 1 ++// CHECK_SLM_M32: #define __MOVBE__ 1 ++// CHECK_SLM_M32: #define __PCLMUL__ 1 ++// CHECK_SLM_M32: #define __POPCNT__ 1 ++// CHECK_SLM_M32: #define __PRFCHW__ 1 ++// CHECK_SLM_M32: #define __RDRND__ 1 ++// CHECK_SLM_M32: #define __SSE2__ 1 ++// CHECK_SLM_M32: #define __SSE3__ 1 ++// CHECK_SLM_M32: #define __SSE4_1__ 1 ++// CHECK_SLM_M32: #define __SSE4_2__ 1 ++// CHECK_SLM_M32: #define __SSE__ 1 ++// CHECK_SLM_M32: #define __SSSE3__ 1 ++// CHECK_SLM_M32: #define __i386 1 ++// CHECK_SLM_M32: #define __i386__ 1 ++// CHECK_SLM_M32: #define __slm 1 ++// CHECK_SLM_M32: #define __slm__ 1 ++// CHECK_SLM_M32: #define __tune_slm__ 1 ++// CHECK_SLM_M32: #define i386 1 ++ ++// RUN: %clang -march=slm -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SLM_M64 ++// CHECK_SLM_M64: #define __FXSR__ 1 ++// CHECK_SLM_M64: #define __MMX__ 1 ++// CHECK_SLM_M64: #define __MOVBE__ 1 ++// CHECK_SLM_M64: #define __PCLMUL__ 1 ++// CHECK_SLM_M64: #define __POPCNT__ 1 ++// CHECK_SLM_M64: #define __PRFCHW__ 1 ++// CHECK_SLM_M64: #define __RDRND__ 1 ++// CHECK_SLM_M64: #define __SSE2_MATH__ 1 ++// CHECK_SLM_M64: #define __SSE2__ 1 ++// CHECK_SLM_M64: #define __SSE3__ 1 ++// CHECK_SLM_M64: #define __SSE4_1__ 1 ++// CHECK_SLM_M64: #define __SSE4_2__ 1 ++// CHECK_SLM_M64: #define __SSE_MATH__ 1 ++// CHECK_SLM_M64: #define __SSE__ 1 ++// CHECK_SLM_M64: #define __SSSE3__ 1 ++// CHECK_SLM_M64: #define __amd64 1 ++// CHECK_SLM_M64: #define __amd64__ 1 ++// CHECK_SLM_M64: #define __slm 1 ++// CHECK_SLM_M64: #define __slm__ 1 ++// CHECK_SLM_M64: #define __tune_slm__ 1 ++// CHECK_SLM_M64: #define __x86_64 1 ++// CHECK_SLM_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=lakemont -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_LAKEMONT_M32 ++// CHECK_LAKEMONT_M32: #define __i386 1 ++// CHECK_LAKEMONT_M32: #define __i386__ 1 ++// CHECK_LAKEMONT_M32: #define __i586 1 ++// CHECK_LAKEMONT_M32: #define __i586__ 1 ++// CHECK_LAKEMONT_M32: #define __pentium 1 ++// CHECK_LAKEMONT_M32: #define __pentium__ 1 ++// CHECK_LAKEMONT_M32: #define __tune_lakemont__ 1 ++// CHECK_LAKEMONT_M32: #define i386 1 ++// RUN: not %clang -march=lakemont -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck %s -check-prefix=CHECK_LAKEMONT_M64 ++// CHECK_LAKEMONT_M64: error: ++ ++// RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_GEODE_M32 ++// CHECK_GEODE_M32: #define __3dNOW_A__ 1 ++// CHECK_GEODE_M32: #define __3dNOW__ 1 ++// CHECK_GEODE_M32: #define __MMX__ 1 ++// CHECK_GEODE_M32: #define __geode 1 ++// CHECK_GEODE_M32: #define __geode__ 1 ++// CHECK_GEODE_M32: #define __i386 1 ++// CHECK_GEODE_M32: #define __i386__ 1 ++// CHECK_GEODE_M32: #define __tune_geode__ 1 ++// CHECK_GEODE_M32: #define i386 1 ++// RUN: not %clang -march=geode -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_GEODE_M64 ++// CHECK_GEODE_M64: error: {{.*}} ++ ++// RUN: %clang -march=k6 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K6_M32 ++// CHECK_K6_M32: #define __MMX__ 1 ++// CHECK_K6_M32: #define __i386 1 ++// CHECK_K6_M32: #define __i386__ 1 ++// CHECK_K6_M32: #define __k6 1 ++// CHECK_K6_M32: #define __k6__ 1 ++// CHECK_K6_M32: #define __tune_k6__ 1 ++// CHECK_K6_M32: #define i386 1 ++// RUN: not %clang -march=k6 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K6_M64 ++// CHECK_K6_M64: error: {{.*}} ++ ++// RUN: %clang -march=k6-2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K6_2_M32 ++// CHECK_K6_2_M32: #define __3dNOW__ 1 ++// CHECK_K6_2_M32: #define __MMX__ 1 ++// CHECK_K6_2_M32: #define __i386 1 ++// CHECK_K6_2_M32: #define __i386__ 1 ++// CHECK_K6_2_M32: #define __k6 1 ++// CHECK_K6_2_M32: #define __k6_2__ 1 ++// CHECK_K6_2_M32: #define __k6__ 1 ++// CHECK_K6_2_M32: #define __tune_k6_2__ 1 ++// CHECK_K6_2_M32: #define __tune_k6__ 1 ++// CHECK_K6_2_M32: #define i386 1 ++// RUN: not %clang -march=k6-2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K6_2_M64 ++// CHECK_K6_2_M64: error: {{.*}} ++ ++// RUN: %clang -march=k6-3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K6_3_M32 ++// CHECK_K6_3_M32: #define __3dNOW__ 1 ++// CHECK_K6_3_M32: #define __MMX__ 1 ++// CHECK_K6_3_M32: #define __i386 1 ++// CHECK_K6_3_M32: #define __i386__ 1 ++// CHECK_K6_3_M32: #define __k6 1 ++// CHECK_K6_3_M32: #define __k6_3__ 1 ++// CHECK_K6_3_M32: #define __k6__ 1 ++// CHECK_K6_3_M32: #define __tune_k6_3__ 1 ++// CHECK_K6_3_M32: #define __tune_k6__ 1 ++// CHECK_K6_3_M32: #define i386 1 ++// RUN: not %clang -march=k6-3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K6_3_M64 ++// CHECK_K6_3_M64: error: {{.*}} ++ ++// RUN: %clang -march=athlon -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_M32 ++// CHECK_ATHLON_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON_M32: #define __MMX__ 1 ++// CHECK_ATHLON_M32: #define __athlon 1 ++// CHECK_ATHLON_M32: #define __athlon__ 1 ++// CHECK_ATHLON_M32: #define __i386 1 ++// CHECK_ATHLON_M32: #define __i386__ 1 ++// CHECK_ATHLON_M32: #define __tune_athlon__ 1 ++// CHECK_ATHLON_M32: #define i386 1 ++// RUN: not %clang -march=athlon -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_M64 ++// CHECK_ATHLON_M64: error: {{.*}} ++ ++// RUN: %clang -march=athlon-tbird -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_TBIRD_M32 ++// CHECK_ATHLON_TBIRD_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_TBIRD_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON_TBIRD_M32: #define __MMX__ 1 ++// CHECK_ATHLON_TBIRD_M32: #define __athlon 1 ++// CHECK_ATHLON_TBIRD_M32: #define __athlon__ 1 ++// CHECK_ATHLON_TBIRD_M32: #define __i386 1 ++// CHECK_ATHLON_TBIRD_M32: #define __i386__ 1 ++// CHECK_ATHLON_TBIRD_M32: #define __tune_athlon__ 1 ++// CHECK_ATHLON_TBIRD_M32: #define i386 1 ++// RUN: not %clang -march=athlon-tbird -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_TBIRD_M64 ++// CHECK_ATHLON_TBIRD_M64: error: {{.*}} ++ ++// RUN: %clang -march=athlon-4 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_4_M32 ++// CHECK_ATHLON_4_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_4_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON_4_M32: #define __MMX__ 1 ++// CHECK_ATHLON_4_M32: #define __SSE__ 1 ++// CHECK_ATHLON_4_M32: #define __athlon 1 ++// CHECK_ATHLON_4_M32: #define __athlon__ 1 ++// CHECK_ATHLON_4_M32: #define __athlon_sse__ 1 ++// CHECK_ATHLON_4_M32: #define __i386 1 ++// CHECK_ATHLON_4_M32: #define __i386__ 1 ++// CHECK_ATHLON_4_M32: #define __tune_athlon__ 1 ++// CHECK_ATHLON_4_M32: #define __tune_athlon_sse__ 1 ++// CHECK_ATHLON_4_M32: #define i386 1 ++// RUN: not %clang -march=athlon-4 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_4_M64 ++// CHECK_ATHLON_4_M64: error: {{.*}} ++ ++// RUN: %clang -march=athlon-xp -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_XP_M32 ++// CHECK_ATHLON_XP_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_XP_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON_XP_M32: #define __MMX__ 1 ++// CHECK_ATHLON_XP_M32: #define __SSE__ 1 ++// CHECK_ATHLON_XP_M32: #define __athlon 1 ++// CHECK_ATHLON_XP_M32: #define __athlon__ 1 ++// CHECK_ATHLON_XP_M32: #define __athlon_sse__ 1 ++// CHECK_ATHLON_XP_M32: #define __i386 1 ++// CHECK_ATHLON_XP_M32: #define __i386__ 1 ++// CHECK_ATHLON_XP_M32: #define __tune_athlon__ 1 ++// CHECK_ATHLON_XP_M32: #define __tune_athlon_sse__ 1 ++// CHECK_ATHLON_XP_M32: #define i386 1 ++// RUN: not %clang -march=athlon-xp -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_XP_M64 ++// CHECK_ATHLON_XP_M64: error: {{.*}} ++ ++// RUN: %clang -march=athlon-mp -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_MP_M32 ++// CHECK_ATHLON_MP_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_MP_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON_MP_M32: #define __MMX__ 1 ++// CHECK_ATHLON_MP_M32: #define __SSE__ 1 ++// CHECK_ATHLON_MP_M32: #define __athlon 1 ++// CHECK_ATHLON_MP_M32: #define __athlon__ 1 ++// CHECK_ATHLON_MP_M32: #define __athlon_sse__ 1 ++// CHECK_ATHLON_MP_M32: #define __i386 1 ++// CHECK_ATHLON_MP_M32: #define __i386__ 1 ++// CHECK_ATHLON_MP_M32: #define __tune_athlon__ 1 ++// CHECK_ATHLON_MP_M32: #define __tune_athlon_sse__ 1 ++// CHECK_ATHLON_MP_M32: #define i386 1 ++// RUN: not %clang -march=athlon-mp -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_MP_M64 ++// CHECK_ATHLON_MP_M64: error: {{.*}} ++ ++// RUN: %clang -march=x86-64 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_X86_64_M32 ++// CHECK_X86_64_M32: #define __MMX__ 1 ++// CHECK_X86_64_M32: #define __SSE2__ 1 ++// CHECK_X86_64_M32: #define __SSE__ 1 ++// CHECK_X86_64_M32: #define __i386 1 ++// CHECK_X86_64_M32: #define __i386__ 1 ++// CHECK_X86_64_M32: #define __k8 1 ++// CHECK_X86_64_M32: #define __k8__ 1 ++// CHECK_X86_64_M32: #define i386 1 ++ ++// RUN: %clang -march=k8 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K8_M32 ++// CHECK_K8_M32: #define __3dNOW_A__ 1 ++// CHECK_K8_M32: #define __3dNOW__ 1 ++// CHECK_K8_M32: #define __MMX__ 1 ++// CHECK_K8_M32: #define __SSE2__ 1 ++// CHECK_K8_M32: #define __SSE__ 1 ++// CHECK_K8_M32: #define __i386 1 ++// CHECK_K8_M32: #define __i386__ 1 ++// CHECK_K8_M32: #define __k8 1 ++// CHECK_K8_M32: #define __k8__ 1 ++// CHECK_K8_M32: #define __tune_k8__ 1 ++// CHECK_K8_M32: #define i386 1 ++ ++// RUN: %clang -march=k8 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K8_M64 ++// CHECK_K8_M64: #define __3dNOW_A__ 1 ++// CHECK_K8_M64: #define __3dNOW__ 1 ++// CHECK_K8_M64: #define __MMX__ 1 ++// CHECK_K8_M64: #define __SSE2_MATH__ 1 ++// CHECK_K8_M64: #define __SSE2__ 1 ++// CHECK_K8_M64: #define __SSE_MATH__ 1 ++// CHECK_K8_M64: #define __SSE__ 1 ++// CHECK_K8_M64: #define __amd64 1 ++// CHECK_K8_M64: #define __amd64__ 1 ++// CHECK_K8_M64: #define __k8 1 ++// CHECK_K8_M64: #define __k8__ 1 ++// CHECK_K8_M64: #define __tune_k8__ 1 ++// CHECK_K8_M64: #define __x86_64 1 ++// CHECK_K8_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=k8-sse3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K8_SSE3_M32 ++// CHECK_K8_SSE3_M32: #define __3dNOW_A__ 1 ++// CHECK_K8_SSE3_M32: #define __3dNOW__ 1 ++// CHECK_K8_SSE3_M32: #define __MMX__ 1 ++// CHECK_K8_SSE3_M32: #define __SSE2__ 1 ++// CHECK_K8_SSE3_M32: #define __SSE3__ 1 ++// CHECK_K8_SSE3_M32: #define __SSE__ 1 ++// CHECK_K8_SSE3_M32: #define __i386 1 ++// CHECK_K8_SSE3_M32: #define __i386__ 1 ++// CHECK_K8_SSE3_M32: #define __k8 1 ++// CHECK_K8_SSE3_M32: #define __k8__ 1 ++// CHECK_K8_SSE3_M32: #define __tune_k8__ 1 ++// CHECK_K8_SSE3_M32: #define i386 1 ++ ++// RUN: %clang -march=k8-sse3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_K8_SSE3_M64 ++// CHECK_K8_SSE3_M64: #define __3dNOW_A__ 1 ++// CHECK_K8_SSE3_M64: #define __3dNOW__ 1 ++// CHECK_K8_SSE3_M64: #define __MMX__ 1 ++// CHECK_K8_SSE3_M64: #define __SSE2_MATH__ 1 ++// CHECK_K8_SSE3_M64: #define __SSE2__ 1 ++// CHECK_K8_SSE3_M64: #define __SSE3__ 1 ++// CHECK_K8_SSE3_M64: #define __SSE_MATH__ 1 ++// CHECK_K8_SSE3_M64: #define __SSE__ 1 ++// CHECK_K8_SSE3_M64: #define __amd64 1 ++// CHECK_K8_SSE3_M64: #define __amd64__ 1 ++// CHECK_K8_SSE3_M64: #define __k8 1 ++// CHECK_K8_SSE3_M64: #define __k8__ 1 ++// CHECK_K8_SSE3_M64: #define __tune_k8__ 1 ++// CHECK_K8_SSE3_M64: #define __x86_64 1 ++// CHECK_K8_SSE3_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=opteron -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_OPTERON_M32 ++// CHECK_OPTERON_M32: #define __3dNOW_A__ 1 ++// CHECK_OPTERON_M32: #define __3dNOW__ 1 ++// CHECK_OPTERON_M32: #define __MMX__ 1 ++// CHECK_OPTERON_M32: #define __SSE2__ 1 ++// CHECK_OPTERON_M32: #define __SSE__ 1 ++// CHECK_OPTERON_M32: #define __i386 1 ++// CHECK_OPTERON_M32: #define __i386__ 1 ++// CHECK_OPTERON_M32: #define __k8 1 ++// CHECK_OPTERON_M32: #define __k8__ 1 ++// CHECK_OPTERON_M32: #define __tune_k8__ 1 ++// CHECK_OPTERON_M32: #define i386 1 ++ ++// RUN: %clang -march=opteron -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_OPTERON_M64 ++// CHECK_OPTERON_M64: #define __3dNOW_A__ 1 ++// CHECK_OPTERON_M64: #define __3dNOW__ 1 ++// CHECK_OPTERON_M64: #define __MMX__ 1 ++// CHECK_OPTERON_M64: #define __SSE2_MATH__ 1 ++// CHECK_OPTERON_M64: #define __SSE2__ 1 ++// CHECK_OPTERON_M64: #define __SSE_MATH__ 1 ++// CHECK_OPTERON_M64: #define __SSE__ 1 ++// CHECK_OPTERON_M64: #define __amd64 1 ++// CHECK_OPTERON_M64: #define __amd64__ 1 ++// CHECK_OPTERON_M64: #define __k8 1 ++// CHECK_OPTERON_M64: #define __k8__ 1 ++// CHECK_OPTERON_M64: #define __tune_k8__ 1 ++// CHECK_OPTERON_M64: #define __x86_64 1 ++// CHECK_OPTERON_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=opteron-sse3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_OPTERON_SSE3_M32 ++// CHECK_OPTERON_SSE3_M32: #define __3dNOW_A__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __3dNOW__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __MMX__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __SSE2__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __SSE3__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __SSE__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __i386 1 ++// CHECK_OPTERON_SSE3_M32: #define __i386__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __k8 1 ++// CHECK_OPTERON_SSE3_M32: #define __k8__ 1 ++// CHECK_OPTERON_SSE3_M32: #define __tune_k8__ 1 ++// CHECK_OPTERON_SSE3_M32: #define i386 1 ++ ++// RUN: %clang -march=opteron-sse3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_OPTERON_SSE3_M64 ++// CHECK_OPTERON_SSE3_M64: #define __3dNOW_A__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __3dNOW__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __MMX__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __SSE2_MATH__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __SSE2__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __SSE3__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __SSE_MATH__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __SSE__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __amd64 1 ++// CHECK_OPTERON_SSE3_M64: #define __amd64__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __k8 1 ++// CHECK_OPTERON_SSE3_M64: #define __k8__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __tune_k8__ 1 ++// CHECK_OPTERON_SSE3_M64: #define __x86_64 1 ++// CHECK_OPTERON_SSE3_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=athlon64 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON64_M32 ++// CHECK_ATHLON64_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON64_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON64_M32: #define __MMX__ 1 ++// CHECK_ATHLON64_M32: #define __SSE2__ 1 ++// CHECK_ATHLON64_M32: #define __SSE__ 1 ++// CHECK_ATHLON64_M32: #define __i386 1 ++// CHECK_ATHLON64_M32: #define __i386__ 1 ++// CHECK_ATHLON64_M32: #define __k8 1 ++// CHECK_ATHLON64_M32: #define __k8__ 1 ++// CHECK_ATHLON64_M32: #define __tune_k8__ 1 ++// CHECK_ATHLON64_M32: #define i386 1 ++ ++// RUN: %clang -march=athlon64 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON64_M64 ++// CHECK_ATHLON64_M64: #define __3dNOW_A__ 1 ++// CHECK_ATHLON64_M64: #define __3dNOW__ 1 ++// CHECK_ATHLON64_M64: #define __MMX__ 1 ++// CHECK_ATHLON64_M64: #define __SSE2_MATH__ 1 ++// CHECK_ATHLON64_M64: #define __SSE2__ 1 ++// CHECK_ATHLON64_M64: #define __SSE_MATH__ 1 ++// CHECK_ATHLON64_M64: #define __SSE__ 1 ++// CHECK_ATHLON64_M64: #define __amd64 1 ++// CHECK_ATHLON64_M64: #define __amd64__ 1 ++// CHECK_ATHLON64_M64: #define __k8 1 ++// CHECK_ATHLON64_M64: #define __k8__ 1 ++// CHECK_ATHLON64_M64: #define __tune_k8__ 1 ++// CHECK_ATHLON64_M64: #define __x86_64 1 ++// CHECK_ATHLON64_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=athlon64-sse3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON64_SSE3_M32 ++// CHECK_ATHLON64_SSE3_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __MMX__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __SSE2__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __SSE3__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __SSE__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __i386 1 ++// CHECK_ATHLON64_SSE3_M32: #define __i386__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __k8 1 ++// CHECK_ATHLON64_SSE3_M32: #define __k8__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define __tune_k8__ 1 ++// CHECK_ATHLON64_SSE3_M32: #define i386 1 ++ ++// RUN: %clang -march=athlon64-sse3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON64_SSE3_M64 ++// CHECK_ATHLON64_SSE3_M64: #define __3dNOW_A__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __3dNOW__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __MMX__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __SSE2_MATH__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __SSE2__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __SSE3__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __SSE_MATH__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __SSE__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __amd64 1 ++// CHECK_ATHLON64_SSE3_M64: #define __amd64__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __k8 1 ++// CHECK_ATHLON64_SSE3_M64: #define __k8__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __tune_k8__ 1 ++// CHECK_ATHLON64_SSE3_M64: #define __x86_64 1 ++// CHECK_ATHLON64_SSE3_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=athlon-fx -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_FX_M32 ++// CHECK_ATHLON_FX_M32: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_FX_M32: #define __3dNOW__ 1 ++// CHECK_ATHLON_FX_M32: #define __MMX__ 1 ++// CHECK_ATHLON_FX_M32: #define __SSE2__ 1 ++// CHECK_ATHLON_FX_M32: #define __SSE__ 1 ++// CHECK_ATHLON_FX_M32: #define __i386 1 ++// CHECK_ATHLON_FX_M32: #define __i386__ 1 ++// CHECK_ATHLON_FX_M32: #define __k8 1 ++// CHECK_ATHLON_FX_M32: #define __k8__ 1 ++// CHECK_ATHLON_FX_M32: #define __tune_k8__ 1 ++// CHECK_ATHLON_FX_M32: #define i386 1 ++ ++// RUN: %clang -march=athlon-fx -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATHLON_FX_M64 ++// CHECK_ATHLON_FX_M64: #define __3dNOW_A__ 1 ++// CHECK_ATHLON_FX_M64: #define __3dNOW__ 1 ++// CHECK_ATHLON_FX_M64: #define __MMX__ 1 ++// CHECK_ATHLON_FX_M64: #define __SSE2_MATH__ 1 ++// CHECK_ATHLON_FX_M64: #define __SSE2__ 1 ++// CHECK_ATHLON_FX_M64: #define __SSE_MATH__ 1 ++// CHECK_ATHLON_FX_M64: #define __SSE__ 1 ++// CHECK_ATHLON_FX_M64: #define __amd64 1 ++// CHECK_ATHLON_FX_M64: #define __amd64__ 1 ++// CHECK_ATHLON_FX_M64: #define __k8 1 ++// CHECK_ATHLON_FX_M64: #define __k8__ 1 ++// CHECK_ATHLON_FX_M64: #define __tune_k8__ 1 ++// CHECK_ATHLON_FX_M64: #define __x86_64 1 ++// CHECK_ATHLON_FX_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=amdfam10 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_AMDFAM10_M32 ++// CHECK_AMDFAM10_M32: #define __3dNOW_A__ 1 ++// CHECK_AMDFAM10_M32: #define __3dNOW__ 1 ++// CHECK_AMDFAM10_M32: #define __LAHF_SAHF__ 1 ++// CHECK_AMDFAM10_M32: #define __LZCNT__ 1 ++// CHECK_AMDFAM10_M32: #define __MMX__ 1 ++// CHECK_AMDFAM10_M32: #define __POPCNT__ 1 ++// CHECK_AMDFAM10_M32: #define __PRFCHW__ 1 ++// CHECK_AMDFAM10_M32: #define __SSE2_MATH__ 1 ++// CHECK_AMDFAM10_M32: #define __SSE2__ 1 ++// CHECK_AMDFAM10_M32: #define __SSE3__ 1 ++// CHECK_AMDFAM10_M32: #define __SSE4A__ 1 ++// CHECK_AMDFAM10_M32: #define __SSE_MATH__ 1 ++// CHECK_AMDFAM10_M32: #define __SSE__ 1 ++// CHECK_AMDFAM10_M32-NOT: #define __SSSE3__ 1 ++// CHECK_AMDFAM10_M32: #define __amdfam10 1 ++// CHECK_AMDFAM10_M32: #define __amdfam10__ 1 ++// CHECK_AMDFAM10_M32: #define __i386 1 ++// CHECK_AMDFAM10_M32: #define __i386__ 1 ++// CHECK_AMDFAM10_M32: #define __tune_amdfam10__ 1 ++ ++// RUN: %clang -march=amdfam10 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_AMDFAM10_M64 ++// CHECK_AMDFAM10_M64: #define __3dNOW_A__ 1 ++// CHECK_AMDFAM10_M64: #define __3dNOW__ 1 ++// CHECK_AMDFAM10_M64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1 ++// CHECK_AMDFAM10_M64: #define __LAHF_SAHF__ 1 ++// CHECK_AMDFAM10_M64: #define __LZCNT__ 1 ++// CHECK_AMDFAM10_M64: #define __MMX__ 1 ++// CHECK_AMDFAM10_M64: #define __POPCNT__ 1 ++// CHECK_AMDFAM10_M64: #define __PRFCHW__ 1 ++// CHECK_AMDFAM10_M64: #define __SSE2_MATH__ 1 ++// CHECK_AMDFAM10_M64: #define __SSE2__ 1 ++// CHECK_AMDFAM10_M64: #define __SSE3__ 1 ++// CHECK_AMDFAM10_M64: #define __SSE4A__ 1 ++// CHECK_AMDFAM10_M64: #define __SSE_MATH__ 1 ++// CHECK_AMDFAM10_M64: #define __SSE__ 1 ++// CHECK_AMDFAM10_M64-NOT: #define __SSSE3__ 1 ++// CHECK_AMDFAM10_M64: #define __amd64 1 ++// CHECK_AMDFAM10_M64: #define __amd64__ 1 ++// CHECK_AMDFAM10_M64: #define __amdfam10 1 ++// CHECK_AMDFAM10_M64: #define __amdfam10__ 1 ++// CHECK_AMDFAM10_M64: #define __tune_amdfam10__ 1 ++// CHECK_AMDFAM10_M64: #define __x86_64 1 ++// CHECK_AMDFAM10_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=btver1 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BTVER1_M32 ++// CHECK_BTVER1_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_BTVER1_M32-NOT: #define __3dNOW__ 1 ++// CHECK_BTVER1_M32: #define __LAHF_SAHF__ 1 ++// CHECK_BTVER1_M32: #define __LZCNT__ 1 ++// CHECK_BTVER1_M32: #define __MMX__ 1 ++// CHECK_BTVER1_M32: #define __POPCNT__ 1 ++// CHECK_BTVER1_M32: #define __PRFCHW__ 1 ++// CHECK_BTVER1_M32: #define __SSE2_MATH__ 1 ++// CHECK_BTVER1_M32: #define __SSE2__ 1 ++// CHECK_BTVER1_M32: #define __SSE3__ 1 ++// CHECK_BTVER1_M32: #define __SSE4A__ 1 ++// CHECK_BTVER1_M32: #define __SSE_MATH__ 1 ++// CHECK_BTVER1_M32: #define __SSE__ 1 ++// CHECK_BTVER1_M32: #define __SSSE3__ 1 ++// CHECK_BTVER1_M32: #define __btver1 1 ++// CHECK_BTVER1_M32: #define __btver1__ 1 ++// CHECK_BTVER1_M32: #define __i386 1 ++// CHECK_BTVER1_M32: #define __i386__ 1 ++// CHECK_BTVER1_M32: #define __tune_btver1__ 1 ++ ++// RUN: %clang -march=btver1 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BTVER1_M64 ++// CHECK_BTVER1_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_BTVER1_M64-NOT: #define __3dNOW__ 1 ++// CHECK_BTVER1_M64: #define __LAHF_SAHF__ 1 ++// CHECK_BTVER1_M64: #define __LZCNT__ 1 ++// CHECK_BTVER1_M64: #define __MMX__ 1 ++// CHECK_BTVER1_M64: #define __POPCNT__ 1 ++// CHECK_BTVER1_M64: #define __PRFCHW__ 1 ++// CHECK_BTVER1_M64: #define __SSE2_MATH__ 1 ++// CHECK_BTVER1_M64: #define __SSE2__ 1 ++// CHECK_BTVER1_M64: #define __SSE3__ 1 ++// CHECK_BTVER1_M64: #define __SSE4A__ 1 ++// CHECK_BTVER1_M64: #define __SSE_MATH__ 1 ++// CHECK_BTVER1_M64: #define __SSE__ 1 ++// CHECK_BTVER1_M64: #define __SSSE3__ 1 ++// CHECK_BTVER1_M64: #define __amd64 1 ++// CHECK_BTVER1_M64: #define __amd64__ 1 ++// CHECK_BTVER1_M64: #define __btver1 1 ++// CHECK_BTVER1_M64: #define __btver1__ 1 ++// CHECK_BTVER1_M64: #define __tune_btver1__ 1 ++// CHECK_BTVER1_M64: #define __x86_64 1 ++// CHECK_BTVER1_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=btver2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BTVER2_M32 ++// CHECK_BTVER2_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_BTVER2_M32-NOT: #define __3dNOW__ 1 ++// CHECK_BTVER2_M32: #define __AES__ 1 ++// CHECK_BTVER2_M32: #define __AVX__ 1 ++// CHECK_BTVER2_M32: #define __BMI__ 1 ++// CHECK_BTVER2_M32: #define __F16C__ 1 ++// CHECK_BTVER2_M32: #define __LZCNT__ 1 ++// CHECK_BTVER2_M32: #define __MMX__ 1 ++// CHECK_BTVER2_M32: #define __MOVBE__ 1 ++// CHECK_BTVER2_M32: #define __PCLMUL__ 1 ++// CHECK_BTVER2_M32: #define __POPCNT__ 1 ++// CHECK_BTVER2_M32: #define __PRFCHW__ 1 ++// CHECK_BTVER2_M32: #define __SSE2_MATH__ 1 ++// CHECK_BTVER2_M32: #define __SSE2__ 1 ++// CHECK_BTVER2_M32: #define __SSE3__ 1 ++// CHECK_BTVER2_M32: #define __SSE4A__ 1 ++// CHECK_BTVER2_M32: #define __SSE_MATH__ 1 ++// CHECK_BTVER2_M32: #define __SSE__ 1 ++// CHECK_BTVER2_M32: #define __SSSE3__ 1 ++// CHECK_BTVER2_M32: #define __XSAVEOPT__ 1 ++// CHECK_BTVER2_M32: #define __XSAVE__ 1 ++// CHECK_BTVER2_M32: #define __btver2 1 ++// CHECK_BTVER2_M32: #define __btver2__ 1 ++// CHECK_BTVER2_M32: #define __i386 1 ++// CHECK_BTVER2_M32: #define __i386__ 1 ++// CHECK_BTVER2_M32: #define __tune_btver2__ 1 ++ ++// RUN: %clang -march=btver2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BTVER2_M64 ++// CHECK_BTVER2_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_BTVER2_M64-NOT: #define __3dNOW__ 1 ++// CHECK_BTVER2_M64: #define __AES__ 1 ++// CHECK_BTVER2_M64: #define __AVX__ 1 ++// CHECK_BTVER2_M64: #define __BMI__ 1 ++// CHECK_BTVER2_M64: #define __F16C__ 1 ++// CHECK_BTVER2_M64: #define __LZCNT__ 1 ++// CHECK_BTVER2_M64: #define __MMX__ 1 ++// CHECK_BTVER2_M64: #define __MOVBE__ 1 ++// CHECK_BTVER2_M64: #define __PCLMUL__ 1 ++// CHECK_BTVER2_M64: #define __POPCNT__ 1 ++// CHECK_BTVER2_M64: #define __PRFCHW__ 1 ++// CHECK_BTVER2_M64: #define __SSE2_MATH__ 1 ++// CHECK_BTVER2_M64: #define __SSE2__ 1 ++// CHECK_BTVER2_M64: #define __SSE3__ 1 ++// CHECK_BTVER2_M64: #define __SSE4A__ 1 ++// CHECK_BTVER2_M64: #define __SSE_MATH__ 1 ++// CHECK_BTVER2_M64: #define __SSE__ 1 ++// CHECK_BTVER2_M64: #define __SSSE3__ 1 ++// CHECK_BTVER2_M64: #define __XSAVEOPT__ 1 ++// CHECK_BTVER2_M64: #define __XSAVE__ 1 ++// CHECK_BTVER2_M64: #define __amd64 1 ++// CHECK_BTVER2_M64: #define __amd64__ 1 ++// CHECK_BTVER2_M64: #define __btver2 1 ++// CHECK_BTVER2_M64: #define __btver2__ 1 ++// CHECK_BTVER2_M64: #define __tune_btver2__ 1 ++// CHECK_BTVER2_M64: #define __x86_64 1 ++// CHECK_BTVER2_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=bdver1 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER1_M32 ++// CHECK_BDVER1_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER1_M32-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER1_M32: #define __AES__ 1 ++// CHECK_BDVER1_M32: #define __AVX__ 1 ++// CHECK_BDVER1_M32: #define __FMA4__ 1 ++// CHECK_BDVER1_M32: #define __LWP__ 1 ++// CHECK_BDVER1_M32: #define __LZCNT__ 1 ++// CHECK_BDVER1_M32: #define __MMX__ 1 ++// CHECK_BDVER1_M32: #define __PCLMUL__ 1 ++// CHECK_BDVER1_M32: #define __POPCNT__ 1 ++// CHECK_BDVER1_M32: #define __PRFCHW__ 1 ++// CHECK_BDVER1_M32: #define __SSE2_MATH__ 1 ++// CHECK_BDVER1_M32: #define __SSE2__ 1 ++// CHECK_BDVER1_M32: #define __SSE3__ 1 ++// CHECK_BDVER1_M32: #define __SSE4A__ 1 ++// CHECK_BDVER1_M32: #define __SSE4_1__ 1 ++// CHECK_BDVER1_M32: #define __SSE4_2__ 1 ++// CHECK_BDVER1_M32: #define __SSE_MATH__ 1 ++// CHECK_BDVER1_M32: #define __SSE__ 1 ++// CHECK_BDVER1_M32: #define __SSSE3__ 1 ++// CHECK_BDVER1_M32: #define __XOP__ 1 ++// CHECK_BDVER1_M32: #define __XSAVE__ 1 ++// CHECK_BDVER1_M32: #define __bdver1 1 ++// CHECK_BDVER1_M32: #define __bdver1__ 1 ++// CHECK_BDVER1_M32: #define __i386 1 ++// CHECK_BDVER1_M32: #define __i386__ 1 ++// CHECK_BDVER1_M32: #define __tune_bdver1__ 1 ++ ++// RUN: %clang -march=bdver1 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER1_M64 ++// CHECK_BDVER1_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER1_M64-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER1_M64: #define __AES__ 1 ++// CHECK_BDVER1_M64: #define __AVX__ 1 ++// CHECK_BDVER1_M64: #define __FMA4__ 1 ++// CHECK_BDVER1_M64: #define __LWP__ 1 ++// CHECK_BDVER1_M64: #define __LZCNT__ 1 ++// CHECK_BDVER1_M64: #define __MMX__ 1 ++// CHECK_BDVER1_M64: #define __PCLMUL__ 1 ++// CHECK_BDVER1_M64: #define __POPCNT__ 1 ++// CHECK_BDVER1_M64: #define __PRFCHW__ 1 ++// CHECK_BDVER1_M64: #define __SSE2_MATH__ 1 ++// CHECK_BDVER1_M64: #define __SSE2__ 1 ++// CHECK_BDVER1_M64: #define __SSE3__ 1 ++// CHECK_BDVER1_M64: #define __SSE4A__ 1 ++// CHECK_BDVER1_M64: #define __SSE4_1__ 1 ++// CHECK_BDVER1_M64: #define __SSE4_2__ 1 ++// CHECK_BDVER1_M64: #define __SSE_MATH__ 1 ++// CHECK_BDVER1_M64: #define __SSE__ 1 ++// CHECK_BDVER1_M64: #define __SSSE3__ 1 ++// CHECK_BDVER1_M64: #define __XOP__ 1 ++// CHECK_BDVER1_M64: #define __XSAVE__ 1 ++// CHECK_BDVER1_M64: #define __amd64 1 ++// CHECK_BDVER1_M64: #define __amd64__ 1 ++// CHECK_BDVER1_M64: #define __bdver1 1 ++// CHECK_BDVER1_M64: #define __bdver1__ 1 ++// CHECK_BDVER1_M64: #define __tune_bdver1__ 1 ++// CHECK_BDVER1_M64: #define __x86_64 1 ++// CHECK_BDVER1_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=bdver2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER2_M32 ++// CHECK_BDVER2_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER2_M32-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER2_M32: #define __AES__ 1 ++// CHECK_BDVER2_M32: #define __AVX__ 1 ++// CHECK_BDVER2_M32: #define __BMI__ 1 ++// CHECK_BDVER2_M32: #define __F16C__ 1 ++// CHECK_BDVER2_M32: #define __FMA4__ 1 ++// CHECK_BDVER2_M32: #define __FMA__ 1 ++// CHECK_BDVER2_M32: #define __LWP__ 1 ++// CHECK_BDVER2_M32: #define __LZCNT__ 1 ++// CHECK_BDVER2_M32: #define __MMX__ 1 ++// CHECK_BDVER2_M32: #define __PCLMUL__ 1 ++// CHECK_BDVER2_M32: #define __POPCNT__ 1 ++// CHECK_BDVER2_M32: #define __PRFCHW__ 1 ++// CHECK_BDVER2_M32: #define __SSE2_MATH__ 1 ++// CHECK_BDVER2_M32: #define __SSE2__ 1 ++// CHECK_BDVER2_M32: #define __SSE3__ 1 ++// CHECK_BDVER2_M32: #define __SSE4A__ 1 ++// CHECK_BDVER2_M32: #define __SSE4_1__ 1 ++// CHECK_BDVER2_M32: #define __SSE4_2__ 1 ++// CHECK_BDVER2_M32: #define __SSE_MATH__ 1 ++// CHECK_BDVER2_M32: #define __SSE__ 1 ++// CHECK_BDVER2_M32: #define __SSSE3__ 1 ++// CHECK_BDVER2_M32: #define __TBM__ 1 ++// CHECK_BDVER2_M32: #define __XOP__ 1 ++// CHECK_BDVER2_M32: #define __XSAVE__ 1 ++// CHECK_BDVER2_M32: #define __bdver2 1 ++// CHECK_BDVER2_M32: #define __bdver2__ 1 ++// CHECK_BDVER2_M32: #define __i386 1 ++// CHECK_BDVER2_M32: #define __i386__ 1 ++// CHECK_BDVER2_M32: #define __tune_bdver2__ 1 ++ ++// RUN: %clang -march=bdver2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER2_M64 ++// CHECK_BDVER2_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER2_M64-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER2_M64: #define __AES__ 1 ++// CHECK_BDVER2_M64: #define __AVX__ 1 ++// CHECK_BDVER2_M64: #define __BMI__ 1 ++// CHECK_BDVER2_M64: #define __F16C__ 1 ++// CHECK_BDVER2_M64: #define __FMA4__ 1 ++// CHECK_BDVER2_M64: #define __FMA__ 1 ++// CHECK_BDVER2_M64: #define __LWP__ 1 ++// CHECK_BDVER2_M64: #define __LZCNT__ 1 ++// CHECK_BDVER2_M64: #define __MMX__ 1 ++// CHECK_BDVER2_M64: #define __PCLMUL__ 1 ++// CHECK_BDVER2_M64: #define __POPCNT__ 1 ++// CHECK_BDVER2_M64: #define __PRFCHW__ 1 ++// CHECK_BDVER2_M64: #define __SSE2_MATH__ 1 ++// CHECK_BDVER2_M64: #define __SSE2__ 1 ++// CHECK_BDVER2_M64: #define __SSE3__ 1 ++// CHECK_BDVER2_M64: #define __SSE4A__ 1 ++// CHECK_BDVER2_M64: #define __SSE4_1__ 1 ++// CHECK_BDVER2_M64: #define __SSE4_2__ 1 ++// CHECK_BDVER2_M64: #define __SSE_MATH__ 1 ++// CHECK_BDVER2_M64: #define __SSE__ 1 ++// CHECK_BDVER2_M64: #define __SSSE3__ 1 ++// CHECK_BDVER2_M64: #define __TBM__ 1 ++// CHECK_BDVER2_M64: #define __XOP__ 1 ++// CHECK_BDVER2_M64: #define __XSAVE__ 1 ++// CHECK_BDVER2_M64: #define __amd64 1 ++// CHECK_BDVER2_M64: #define __amd64__ 1 ++// CHECK_BDVER2_M64: #define __bdver2 1 ++// CHECK_BDVER2_M64: #define __bdver2__ 1 ++// CHECK_BDVER2_M64: #define __tune_bdver2__ 1 ++// CHECK_BDVER2_M64: #define __x86_64 1 ++// CHECK_BDVER2_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=bdver3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER3_M32 ++// CHECK_BDVER3_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER3_M32-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER3_M32: #define __AES__ 1 ++// CHECK_BDVER3_M32: #define __AVX__ 1 ++// CHECK_BDVER3_M32: #define __BMI__ 1 ++// CHECK_BDVER3_M32: #define __F16C__ 1 ++// CHECK_BDVER3_M32: #define __FMA4__ 1 ++// CHECK_BDVER3_M32: #define __FMA__ 1 ++// CHECK_BDVER3_M32: #define __FSGSBASE__ 1 ++// CHECK_BDVER3_M32: #define __LWP__ 1 ++// CHECK_BDVER3_M32: #define __LZCNT__ 1 ++// CHECK_BDVER3_M32: #define __MMX__ 1 ++// CHECK_BDVER3_M32: #define __PCLMUL__ 1 ++// CHECK_BDVER3_M32: #define __POPCNT__ 1 ++// CHECK_BDVER3_M32: #define __PRFCHW__ 1 ++// CHECK_BDVER3_M32: #define __SSE2_MATH__ 1 ++// CHECK_BDVER3_M32: #define __SSE2__ 1 ++// CHECK_BDVER3_M32: #define __SSE3__ 1 ++// CHECK_BDVER3_M32: #define __SSE4A__ 1 ++// CHECK_BDVER3_M32: #define __SSE4_1__ 1 ++// CHECK_BDVER3_M32: #define __SSE4_2__ 1 ++// CHECK_BDVER3_M32: #define __SSE_MATH__ 1 ++// CHECK_BDVER3_M32: #define __SSE__ 1 ++// CHECK_BDVER3_M32: #define __SSSE3__ 1 ++// CHECK_BDVER3_M32: #define __TBM__ 1 ++// CHECK_BDVER3_M32: #define __XOP__ 1 ++// CHECK_BDVER3_M32: #define __XSAVEOPT__ 1 ++// CHECK_BDVER3_M32: #define __XSAVE__ 1 ++// CHECK_BDVER3_M32: #define __bdver3 1 ++// CHECK_BDVER3_M32: #define __bdver3__ 1 ++// CHECK_BDVER3_M32: #define __i386 1 ++// CHECK_BDVER3_M32: #define __i386__ 1 ++// CHECK_BDVER3_M32: #define __tune_bdver3__ 1 ++ ++// RUN: %clang -march=bdver3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER3_M64 ++// CHECK_BDVER3_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER3_M64-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER3_M64: #define __AES__ 1 ++// CHECK_BDVER3_M64: #define __AVX__ 1 ++// CHECK_BDVER3_M64: #define __BMI__ 1 ++// CHECK_BDVER3_M64: #define __F16C__ 1 ++// CHECK_BDVER3_M64: #define __FMA4__ 1 ++// CHECK_BDVER3_M64: #define __FMA__ 1 ++// CHECK_BDVER3_M64: #define __FSGSBASE__ 1 ++// CHECK_BDVER3_M64: #define __LWP__ 1 ++// CHECK_BDVER3_M64: #define __LZCNT__ 1 ++// CHECK_BDVER3_M64: #define __MMX__ 1 ++// CHECK_BDVER3_M64: #define __PCLMUL__ 1 ++// CHECK_BDVER3_M64: #define __POPCNT__ 1 ++// CHECK_BDVER3_M64: #define __PRFCHW__ 1 ++// CHECK_BDVER3_M64: #define __SSE2_MATH__ 1 ++// CHECK_BDVER3_M64: #define __SSE2__ 1 ++// CHECK_BDVER3_M64: #define __SSE3__ 1 ++// CHECK_BDVER3_M64: #define __SSE4A__ 1 ++// CHECK_BDVER3_M64: #define __SSE4_1__ 1 ++// CHECK_BDVER3_M64: #define __SSE4_2__ 1 ++// CHECK_BDVER3_M64: #define __SSE_MATH__ 1 ++// CHECK_BDVER3_M64: #define __SSE__ 1 ++// CHECK_BDVER3_M64: #define __SSSE3__ 1 ++// CHECK_BDVER3_M64: #define __TBM__ 1 ++// CHECK_BDVER3_M64: #define __XOP__ 1 ++// CHECK_BDVER3_M64: #define __XSAVEOPT__ 1 ++// CHECK_BDVER3_M64: #define __XSAVE__ 1 ++// CHECK_BDVER3_M64: #define __amd64 1 ++// CHECK_BDVER3_M64: #define __amd64__ 1 ++// CHECK_BDVER3_M64: #define __bdver3 1 ++// CHECK_BDVER3_M64: #define __bdver3__ 1 ++// CHECK_BDVER3_M64: #define __tune_bdver3__ 1 ++// CHECK_BDVER3_M64: #define __x86_64 1 ++// CHECK_BDVER3_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=bdver4 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER4_M32 ++// CHECK_BDVER4_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER4_M32-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER4_M32: #define __AES__ 1 ++// CHECK_BDVER4_M32: #define __AVX2__ 1 ++// CHECK_BDVER4_M32: #define __AVX__ 1 ++// CHECK_BDVER4_M32: #define __BMI2__ 1 ++// CHECK_BDVER4_M32: #define __BMI__ 1 ++// CHECK_BDVER4_M32: #define __F16C__ 1 ++// CHECK_BDVER4_M32: #define __FMA4__ 1 ++// CHECK_BDVER4_M32: #define __FMA__ 1 ++// CHECK_BDVER4_M32: #define __FSGSBASE__ 1 ++// CHECK_BDVER4_M32: #define __LWP__ 1 ++// CHECK_BDVER4_M32: #define __LZCNT__ 1 ++// CHECK_BDVER4_M32: #define __MMX__ 1 ++// CHECK_BDVER4_M32: #define __MOVBE__ 1 ++// CHECK_BDVER4_M32: #define __PCLMUL__ 1 ++// CHECK_BDVER4_M32: #define __POPCNT__ 1 ++// CHECK_BDVER4_M32: #define __PRFCHW__ 1 ++// CHECK_BDVER4_M32: #define __RDRND__ 1 ++// CHECK_BDVER4_M32: #define __SSE2_MATH__ 1 ++// CHECK_BDVER4_M32: #define __SSE2__ 1 ++// CHECK_BDVER4_M32: #define __SSE3__ 1 ++// CHECK_BDVER4_M32: #define __SSE4A__ 1 ++// CHECK_BDVER4_M32: #define __SSE4_1__ 1 ++// CHECK_BDVER4_M32: #define __SSE4_2__ 1 ++// CHECK_BDVER4_M32: #define __SSE_MATH__ 1 ++// CHECK_BDVER4_M32: #define __SSE__ 1 ++// CHECK_BDVER4_M32: #define __SSSE3__ 1 ++// CHECK_BDVER4_M32: #define __TBM__ 1 ++// CHECK_BDVER4_M32: #define __XOP__ 1 ++// CHECK_BDVER4_M32: #define __XSAVE__ 1 ++// CHECK_BDVER4_M32: #define __bdver4 1 ++// CHECK_BDVER4_M32: #define __bdver4__ 1 ++// CHECK_BDVER4_M32: #define __i386 1 ++// CHECK_BDVER4_M32: #define __i386__ 1 ++// CHECK_BDVER4_M32: #define __tune_bdver4__ 1 ++ ++// RUN: %clang -march=bdver4 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_BDVER4_M64 ++// CHECK_BDVER4_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_BDVER4_M64-NOT: #define __3dNOW__ 1 ++// CHECK_BDVER4_M64: #define __AES__ 1 ++// CHECK_BDVER4_M64: #define __AVX2__ 1 ++// CHECK_BDVER4_M64: #define __AVX__ 1 ++// CHECK_BDVER4_M64: #define __BMI2__ 1 ++// CHECK_BDVER4_M64: #define __BMI__ 1 ++// CHECK_BDVER4_M64: #define __F16C__ 1 ++// CHECK_BDVER4_M64: #define __FMA4__ 1 ++// CHECK_BDVER4_M64: #define __FMA__ 1 ++// CHECK_BDVER4_M64: #define __FSGSBASE__ 1 ++// CHECK_BDVER4_M64: #define __LWP__ 1 ++// CHECK_BDVER4_M64: #define __LZCNT__ 1 ++// CHECK_BDVER4_M64: #define __MMX__ 1 ++// CHECK_BDVER4_M64: #define __MOVBE__ 1 ++// CHECK_BDVER4_M64: #define __PCLMUL__ 1 ++// CHECK_BDVER4_M64: #define __POPCNT__ 1 ++// CHECK_BDVER4_M64: #define __PRFCHW__ 1 ++// CHECK_BDVER4_M64: #define __RDRND__ 1 ++// CHECK_BDVER4_M64: #define __SSE2_MATH__ 1 ++// CHECK_BDVER4_M64: #define __SSE2__ 1 ++// CHECK_BDVER4_M64: #define __SSE3__ 1 ++// CHECK_BDVER4_M64: #define __SSE4A__ 1 ++// CHECK_BDVER4_M64: #define __SSE4_1__ 1 ++// CHECK_BDVER4_M64: #define __SSE4_2__ 1 ++// CHECK_BDVER4_M64: #define __SSE_MATH__ 1 ++// CHECK_BDVER4_M64: #define __SSE__ 1 ++// CHECK_BDVER4_M64: #define __SSSE3__ 1 ++// CHECK_BDVER4_M64: #define __TBM__ 1 ++// CHECK_BDVER4_M64: #define __XOP__ 1 ++// CHECK_BDVER4_M64: #define __XSAVE__ 1 ++// CHECK_BDVER4_M64: #define __amd64 1 ++// CHECK_BDVER4_M64: #define __amd64__ 1 ++// CHECK_BDVER4_M64: #define __bdver4 1 ++// CHECK_BDVER4_M64: #define __bdver4__ 1 ++// CHECK_BDVER4_M64: #define __tune_bdver4__ 1 ++// CHECK_BDVER4_M64: #define __x86_64 1 ++// CHECK_BDVER4_M64: #define __x86_64__ 1 ++ ++// RUN: %clang -march=znver1 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ZNVER1_M32 ++// CHECK_ZNVER1_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_ZNVER1_M32-NOT: #define __3dNOW__ 1 ++// CHECK_ZNVER1_M32: #define __ADX__ 1 ++// CHECK_ZNVER1_M32: #define __AES__ 1 ++// CHECK_ZNVER1_M32: #define __AVX2__ 1 ++// CHECK_ZNVER1_M32: #define __AVX__ 1 ++// CHECK_ZNVER1_M32: #define __BMI2__ 1 ++// CHECK_ZNVER1_M32: #define __BMI__ 1 ++// CHECK_ZNVER1_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_ZNVER1_M32: #define __CLZERO__ 1 ++// CHECK_ZNVER1_M32: #define __F16C__ 1 ++// CHECK_ZNVER1_M32-NOT: #define __FMA4__ 1 ++// CHECK_ZNVER1_M32: #define __FMA__ 1 ++// CHECK_ZNVER1_M32: #define __FSGSBASE__ 1 ++// CHECK_ZNVER1_M32: #define __LZCNT__ 1 ++// CHECK_ZNVER1_M32: #define __MMX__ 1 ++// CHECK_ZNVER1_M32: #define __MOVBE__ 1 ++// CHECK_ZNVER1_M32: #define __PCLMUL__ 1 ++// CHECK_ZNVER1_M32: #define __POPCNT__ 1 ++// CHECK_ZNVER1_M32: #define __PRFCHW__ 1 ++// CHECK_ZNVER1_M32: #define __RDRND__ 1 ++// CHECK_ZNVER1_M32: #define __RDSEED__ 1 ++// CHECK_ZNVER1_M32: #define __SHA__ 1 ++// CHECK_ZNVER1_M32: #define __SSE2_MATH__ 1 ++// CHECK_ZNVER1_M32: #define __SSE2__ 1 ++// CHECK_ZNVER1_M32: #define __SSE3__ 1 ++// CHECK_ZNVER1_M32: #define __SSE4A__ 1 ++// CHECK_ZNVER1_M32: #define __SSE4_1__ 1 ++// CHECK_ZNVER1_M32: #define __SSE4_2__ 1 ++// CHECK_ZNVER1_M32: #define __SSE_MATH__ 1 ++// CHECK_ZNVER1_M32: #define __SSE__ 1 ++// CHECK_ZNVER1_M32: #define __SSSE3__ 1 ++// CHECK_ZNVER1_M32-NOT: #define __TBM__ 1 ++// CHECK_ZNVER1_M32-NOT: #define __XOP__ 1 ++// CHECK_ZNVER1_M32: #define __XSAVEC__ 1 ++// CHECK_ZNVER1_M32: #define __XSAVEOPT__ 1 ++// CHECK_ZNVER1_M32: #define __XSAVES__ 1 ++// CHECK_ZNVER1_M32: #define __XSAVE__ 1 ++// CHECK_ZNVER1_M32: #define __i386 1 ++// CHECK_ZNVER1_M32: #define __i386__ 1 ++// CHECK_ZNVER1_M32: #define __tune_znver1__ 1 ++// CHECK_ZNVER1_M32: #define __znver1 1 ++// CHECK_ZNVER1_M32: #define __znver1__ 1 ++ ++// RUN: %clang -march=znver1 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ZNVER1_M64 ++// CHECK_ZNVER1_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_ZNVER1_M64-NOT: #define __3dNOW__ 1 ++// CHECK_ZNVER1_M64: #define __ADX__ 1 ++// CHECK_ZNVER1_M64: #define __AES__ 1 ++// CHECK_ZNVER1_M64: #define __AVX2__ 1 ++// CHECK_ZNVER1_M64: #define __AVX__ 1 ++// CHECK_ZNVER1_M64: #define __BMI2__ 1 ++// CHECK_ZNVER1_M64: #define __BMI__ 1 ++// CHECK_ZNVER1_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_ZNVER1_M64: #define __CLZERO__ 1 ++// CHECK_ZNVER1_M64: #define __F16C__ 1 ++// CHECK_ZNVER1_M64-NOT: #define __FMA4__ 1 ++// CHECK_ZNVER1_M64: #define __FMA__ 1 ++// CHECK_ZNVER1_M64: #define __FSGSBASE__ 1 ++// CHECK_ZNVER1_M64: #define __LAHF_SAHF__ 1 ++// CHECK_ZNVER1_M64: #define __LZCNT__ 1 ++// CHECK_ZNVER1_M64: #define __MMX__ 1 ++// CHECK_ZNVER1_M64: #define __MOVBE__ 1 ++// CHECK_ZNVER1_M64: #define __PCLMUL__ 1 ++// CHECK_ZNVER1_M64: #define __POPCNT__ 1 ++// CHECK_ZNVER1_M64: #define __PRFCHW__ 1 ++// CHECK_ZNVER1_M64: #define __RDRND__ 1 ++// CHECK_ZNVER1_M64: #define __RDSEED__ 1 ++// CHECK_ZNVER1_M64: #define __SHA__ 1 ++// CHECK_ZNVER1_M64: #define __SSE2_MATH__ 1 ++// CHECK_ZNVER1_M64: #define __SSE2__ 1 ++// CHECK_ZNVER1_M64: #define __SSE3__ 1 ++// CHECK_ZNVER1_M64: #define __SSE4A__ 1 ++// CHECK_ZNVER1_M64: #define __SSE4_1__ 1 ++// CHECK_ZNVER1_M64: #define __SSE4_2__ 1 ++// CHECK_ZNVER1_M64: #define __SSE_MATH__ 1 ++// CHECK_ZNVER1_M64: #define __SSE__ 1 ++// CHECK_ZNVER1_M64: #define __SSSE3__ 1 ++// CHECK_ZNVER1_M64-NOT: #define __TBM__ 1 ++// CHECK_ZNVER1_M64-NOT: #define __XOP__ 1 ++// CHECK_ZNVER1_M64: #define __XSAVEC__ 1 ++// CHECK_ZNVER1_M64: #define __XSAVEOPT__ 1 ++// CHECK_ZNVER1_M64: #define __XSAVES__ 1 ++// CHECK_ZNVER1_M64: #define __XSAVE__ 1 ++// CHECK_ZNVER1_M64: #define __amd64 1 ++// CHECK_ZNVER1_M64: #define __amd64__ 1 ++// CHECK_ZNVER1_M64: #define __tune_znver1__ 1 ++// CHECK_ZNVER1_M64: #define __x86_64 1 ++// CHECK_ZNVER1_M64: #define __x86_64__ 1 ++// CHECK_ZNVER1_M64: #define __znver1 1 ++// CHECK_ZNVER1_M64: #define __znver1__ 1 ++ ++// RUN: %clang -march=znver2 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ZNVER2_M32 ++// CHECK_ZNVER2_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_ZNVER2_M32-NOT: #define __3dNOW__ 1 ++// CHECK_ZNVER2_M32: #define __ADX__ 1 ++// CHECK_ZNVER2_M32: #define __AES__ 1 ++// CHECK_ZNVER2_M32: #define __AVX2__ 1 ++// CHECK_ZNVER2_M32: #define __AVX__ 1 ++// CHECK_ZNVER2_M32: #define __BMI2__ 1 ++// CHECK_ZNVER2_M32: #define __BMI__ 1 ++// CHECK_ZNVER2_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_ZNVER2_M32: #define __CLWB__ 1 ++// CHECK_ZNVER2_M32: #define __CLZERO__ 1 ++// CHECK_ZNVER2_M32: #define __F16C__ 1 ++// CHECK_ZNVER2_M32-NOT: #define __FMA4__ 1 ++// CHECK_ZNVER2_M32: #define __FMA__ 1 ++// CHECK_ZNVER2_M32: #define __FSGSBASE__ 1 ++// CHECK_ZNVER2_M32: #define __LAHF_SAHF__ 1 ++// CHECK_ZNVER2_M32: #define __LZCNT__ 1 ++// CHECK_ZNVER2_M32: #define __MMX__ 1 ++// CHECK_ZNVER2_M32: #define __PCLMUL__ 1 ++// CHECK_ZNVER2_M32: #define __POPCNT__ 1 ++// CHECK_ZNVER2_M32: #define __PRFCHW__ 1 ++// CHECK_ZNVER2_M32: #define __RDPID__ 1 ++// CHECK_ZNVER2_M32: #define __RDRND__ 1 ++// CHECK_ZNVER2_M32: #define __RDSEED__ 1 ++// CHECK_ZNVER2_M32: #define __SHA__ 1 ++// CHECK_ZNVER2_M32: #define __SSE2_MATH__ 1 ++// CHECK_ZNVER2_M32: #define __SSE2__ 1 ++// CHECK_ZNVER2_M32: #define __SSE3__ 1 ++// CHECK_ZNVER2_M32: #define __SSE4A__ 1 ++// CHECK_ZNVER2_M32: #define __SSE4_1__ 1 ++// CHECK_ZNVER2_M32: #define __SSE4_2__ 1 ++// CHECK_ZNVER2_M32: #define __SSE_MATH__ 1 ++// CHECK_ZNVER2_M32: #define __SSE__ 1 ++// CHECK_ZNVER2_M32: #define __SSSE3__ 1 ++// CHECK_ZNVER2_M32-NOT: #define __TBM__ 1 ++// CHECK_ZNVER2_M32: #define __WBNOINVD__ 1 ++// CHECK_ZNVER2_M32-NOT: #define __XOP__ 1 ++// CHECK_ZNVER2_M32: #define __XSAVEC__ 1 ++// CHECK_ZNVER2_M32: #define __XSAVEOPT__ 1 ++// CHECK_ZNVER2_M32: #define __XSAVES__ 1 ++// CHECK_ZNVER2_M32: #define __XSAVE__ 1 ++// CHECK_ZNVER2_M32: #define __i386 1 ++// CHECK_ZNVER2_M32: #define __i386__ 1 ++// CHECK_ZNVER2_M32: #define __tune_znver2__ 1 ++// CHECK_ZNVER2_M32: #define __znver2 1 ++// CHECK_ZNVER2_M32: #define __znver2__ 1 ++ ++// RUN: %clang -march=znver2 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ZNVER2_M64 ++// CHECK_ZNVER2_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_ZNVER2_M64-NOT: #define __3dNOW__ 1 ++// CHECK_ZNVER2_M64: #define __ADX__ 1 ++// CHECK_ZNVER2_M64: #define __AES__ 1 ++// CHECK_ZNVER2_M64: #define __AVX2__ 1 ++// CHECK_ZNVER2_M64: #define __AVX__ 1 ++// CHECK_ZNVER2_M64: #define __BMI2__ 1 ++// CHECK_ZNVER2_M64: #define __BMI__ 1 ++// CHECK_ZNVER2_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_ZNVER2_M64: #define __CLWB__ 1 ++// CHECK_ZNVER2_M64: #define __CLZERO__ 1 ++// CHECK_ZNVER2_M64: #define __F16C__ 1 ++// CHECK_ZNVER2_M64-NOT: #define __FMA4__ 1 ++// CHECK_ZNVER2_M64: #define __FMA__ 1 ++// CHECK_ZNVER2_M64: #define __FSGSBASE__ 1 ++// CHECK_ZNVER2_M64: #define __LAHF_SAHF__ 1 ++// CHECK_ZNVER2_M64: #define __LZCNT__ 1 ++// CHECK_ZNVER2_M64: #define __MMX__ 1 ++// CHECK_ZNVER2_M64: #define __PCLMUL__ 1 ++// CHECK_ZNVER2_M64: #define __POPCNT__ 1 ++// CHECK_ZNVER2_M64: #define __PRFCHW__ 1 ++// CHECK_ZNVER2_M64: #define __RDPID__ 1 ++// CHECK_ZNVER2_M64: #define __RDRND__ 1 ++// CHECK_ZNVER2_M64: #define __RDSEED__ 1 ++// CHECK_ZNVER2_M64: #define __SHA__ 1 ++// CHECK_ZNVER2_M64: #define __SSE2_MATH__ 1 ++// CHECK_ZNVER2_M64: #define __SSE2__ 1 ++// CHECK_ZNVER2_M64: #define __SSE3__ 1 ++// CHECK_ZNVER2_M64: #define __SSE4A__ 1 ++// CHECK_ZNVER2_M64: #define __SSE4_1__ 1 ++// CHECK_ZNVER2_M64: #define __SSE4_2__ 1 ++// CHECK_ZNVER2_M64: #define __SSE_MATH__ 1 ++// CHECK_ZNVER2_M64: #define __SSE__ 1 ++// CHECK_ZNVER2_M64: #define __SSSE3__ 1 ++// CHECK_ZNVER2_M64-NOT: #define __TBM__ 1 ++// CHECK_ZNVER2_M64: #define __WBNOINVD__ 1 ++// CHECK_ZNVER2_M64-NOT: #define __XOP__ 1 ++// CHECK_ZNVER2_M64: #define __XSAVEC__ 1 ++// CHECK_ZNVER2_M64: #define __XSAVEOPT__ 1 ++// CHECK_ZNVER2_M64: #define __XSAVES__ 1 ++// CHECK_ZNVER2_M64: #define __XSAVE__ 1 ++// CHECK_ZNVER2_M64: #define __amd64 1 ++// CHECK_ZNVER2_M64: #define __amd64__ 1 ++// CHECK_ZNVER2_M64: #define __tune_znver2__ 1 ++// CHECK_ZNVER2_M64: #define __x86_64 1 ++// CHECK_ZNVER2_M64: #define __x86_64__ 1 ++// CHECK_ZNVER2_M64: #define __znver2 1 ++// CHECK_ZNVER2_M64: #define __znver2__ 1 ++ ++// RUN: %clang -march=znver3 -m32 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ZNVER3_M32 ++// CHECK_ZNVER3_M32-NOT: #define __3dNOW_A__ 1 ++// CHECK_ZNVER3_M32-NOT: #define __3dNOW__ 1 ++// CHECK_ZNVER3_M32: #define __ADX__ 1 ++// CHECK_ZNVER3_M32: #define __AES__ 1 ++// CHECK_ZNVER3_M32: #define __AVX2__ 1 ++// CHECK_ZNVER3_M32: #define __AVX__ 1 ++// CHECK_ZNVER3_M32: #define __BMI2__ 1 ++// CHECK_ZNVER3_M32: #define __BMI__ 1 ++// CHECK_ZNVER3_M32: #define __CLFLUSHOPT__ 1 ++// CHECK_ZNVER3_M32: #define __CLWB__ 1 ++// CHECK_ZNVER3_M32: #define __CLZERO__ 1 ++// CHECK_ZNVER3_M32: #define __F16C__ 1 ++// CHECK_ZNVER3_M32-NOT: #define __FMA4__ 1 ++// CHECK_ZNVER3_M32: #define __FMA__ 1 ++// CHECK_ZNVER3_M32: #define __FSGSBASE__ 1 ++// CHECK_ZNVER3_M32: #define __LZCNT__ 1 ++// CHECK_ZNVER3_M32: #define __MMX__ 1 ++// CHECK_ZNVER3_M32: #define __PCLMUL__ 1 ++// CHECK_ZNVER3_M32: #define __PKU__ 1 ++// CHECK_ZNVER3_M32: #define __POPCNT__ 1 ++// CHECK_ZNVER3_M32: #define __PRFCHW__ 1 ++// CHECK_ZNVER3_M32: #define __RDPID__ 1 ++// CHECK_ZNVER3_M32: #define __RDRND__ 1 ++// CHECK_ZNVER3_M32: #define __RDSEED__ 1 ++// CHECK_ZNVER3_M32: #define __SHA__ 1 ++// CHECK_ZNVER3_M32: #define __SSE2_MATH__ 1 ++// CHECK_ZNVER3_M32: #define __SSE2__ 1 ++// CHECK_ZNVER3_M32: #define __SSE3__ 1 ++// CHECK_ZNVER3_M32: #define __SSE4A__ 1 ++// CHECK_ZNVER3_M32: #define __SSE4_1__ 1 ++// CHECK_ZNVER3_M32: #define __SSE4_2__ 1 ++// CHECK_ZNVER3_M32: #define __SSE_MATH__ 1 ++// CHECK_ZNVER3_M32: #define __SSE__ 1 ++// CHECK_ZNVER3_M32: #define __SSSE3__ 1 ++// CHECK_ZNVER3_M32-NOT: #define __TBM__ 1 ++// CHECK_ZNVER3_M32: #define __WBNOINVD__ 1 ++// CHECK_ZNVER3_M32-NOT: #define __XOP__ 1 ++// CHECK_ZNVER3_M32: #define __XSAVEC__ 1 ++// CHECK_ZNVER3_M32: #define __XSAVEOPT__ 1 ++// CHECK_ZNVER3_M32: #define __XSAVES__ 1 ++// CHECK_ZNVER3_M32: #define __XSAVE__ 1 ++// CHECK_ZNVER3_M32: #define __i386 1 ++// CHECK_ZNVER3_M32: #define __i386__ 1 ++// CHECK_ZNVER3_M32: #define __tune_znver3__ 1 ++// CHECK_ZNVER3_M32: #define __znver3 1 ++// CHECK_ZNVER3_M32: #define __znver3__ 1 ++ ++// RUN: %clang -march=znver3 -m64 -E -dM %s -o - 2>&1 \ ++// RUN: -target i386-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ZNVER3_M64 ++// CHECK_ZNVER3_M64-NOT: #define __3dNOW_A__ 1 ++// CHECK_ZNVER3_M64-NOT: #define __3dNOW__ 1 ++// CHECK_ZNVER3_M64: #define __ADX__ 1 ++// CHECK_ZNVER3_M64: #define __AES__ 1 ++// CHECK_ZNVER3_M64: #define __AVX2__ 1 ++// CHECK_ZNVER3_M64: #define __AVX__ 1 ++// CHECK_ZNVER3_M64: #define __BMI2__ 1 ++// CHECK_ZNVER3_M64: #define __BMI__ 1 ++// CHECK_ZNVER3_M64: #define __CLFLUSHOPT__ 1 ++// CHECK_ZNVER3_M64: #define __CLWB__ 1 ++// CHECK_ZNVER3_M64: #define __CLZERO__ 1 ++// CHECK_ZNVER3_M64: #define __F16C__ 1 ++// CHECK_ZNVER3_M64-NOT: #define __FMA4__ 1 ++// CHECK_ZNVER3_M64: #define __FMA__ 1 ++// CHECK_ZNVER3_M64: #define __FSGSBASE__ 1 ++// CHECK_ZNVER3_M64: #define __LZCNT__ 1 ++// CHECK_ZNVER3_M64: #define __MMX__ 1 ++// CHECK_ZNVER3_M64: #define __PCLMUL__ 1 ++// CHECK_ZNVER3_M64: #define __PKU__ 1 ++// CHECK_ZNVER3_M64: #define __POPCNT__ 1 ++// CHECK_ZNVER3_M64: #define __PRFCHW__ 1 ++// CHECK_ZNVER3_M64: #define __RDPID__ 1 ++// CHECK_ZNVER3_M64: #define __RDRND__ 1 ++// CHECK_ZNVER3_M64: #define __RDSEED__ 1 ++// CHECK_ZNVER3_M64: #define __SHA__ 1 ++// CHECK_ZNVER3_M64: #define __SSE2_MATH__ 1 ++// CHECK_ZNVER3_M64: #define __SSE2__ 1 ++// CHECK_ZNVER3_M64: #define __SSE3__ 1 ++// CHECK_ZNVER3_M64: #define __SSE4A__ 1 ++// CHECK_ZNVER3_M64: #define __SSE4_1__ 1 ++// CHECK_ZNVER3_M64: #define __SSE4_2__ 1 ++// CHECK_ZNVER3_M64: #define __SSE_MATH__ 1 ++// CHECK_ZNVER3_M64: #define __SSE__ 1 ++// CHECK_ZNVER3_M64: #define __SSSE3__ 1 ++// CHECK_ZNVER3_M64-NOT: #define __TBM__ 1 ++// CHECK_ZNVER3_M64: #define __VAES__ 1 ++// CHECK_ZNVER3_M64: #define __VPCLMULQDQ__ 1 ++// CHECK_ZNVER3_M64: #define __WBNOINVD__ 1 ++// CHECK_ZNVER3_M64-NOT: #define __XOP__ 1 ++// CHECK_ZNVER3_M64: #define __XSAVEC__ 1 ++// CHECK_ZNVER3_M64: #define __XSAVEOPT__ 1 ++// CHECK_ZNVER3_M64: #define __XSAVES__ 1 ++// CHECK_ZNVER3_M64: #define __XSAVE__ 1 ++// CHECK_ZNVER3_M64: #define __amd64 1 ++// CHECK_ZNVER3_M64: #define __amd64__ 1 ++// CHECK_ZNVER3_M64: #define __tune_znver3__ 1 ++// CHECK_ZNVER3_M64: #define __x86_64 1 ++// CHECK_ZNVER3_M64: #define __x86_64__ 1 ++// CHECK_ZNVER3_M64: #define __znver3 1 ++// CHECK_ZNVER3_M64: #define __znver3__ 1 ++ ++// End X86/GCC/Linux tests ------------------ ++ ++// Begin PPC/GCC/Linux tests ---------------- ++// Check that VSX also turns on altivec. ++// RUN: %clang -mvsx -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_VSX_M32 ++// CHECK_PPC_VSX_M32: #define __ALTIVEC__ 1 ++// CHECK_PPC_VSX_M32: #define __VSX__ 1 ++ ++// RUN: %clang -mvsx -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_VSX_M64 ++// CHECK_PPC_VSX_M64: #define __VSX__ 1 ++ ++// RUN: %clang -mpower8-vector -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_POWER8_VECTOR_M64 ++// CHECK_PPC_POWER8_VECTOR_M64: #define __POWER8_VECTOR__ 1 ++ ++// RUN: %clang -mpower9-vector -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_POWER9_VECTOR_M64 ++// CHECK_PPC_POWER9_VECTOR_M64: #define __POWER9_VECTOR__ 1 ++ ++// RUN: %clang -mcrypto -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_CRYPTO_M64 ++// CHECK_PPC_CRYPTO_M64: #define __CRYPTO__ 1 ++ ++// HTM is available on power8 or later which includes all of powerpc64le as an ++// ABI choice. Test that, the cpus, and the option. ++// RUN: %clang -mhtm -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_HTM ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64le-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_HTM ++// RUN: %clang -mcpu=pwr8 -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_HTM ++// RUN: %clang -mcpu=pwr9 -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_HTM ++// CHECK_PPC_HTM: #define __HTM__ 1 ++ ++// RUN: %clang -mcpu=ppc64 -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-unknown \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_GCC_ATOMICS ++// RUN: %clang -mcpu=pwr8 -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64-unknown-unknown \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_GCC_ATOMICS ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target powerpc64le-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_GCC_ATOMICS ++// CHECK_PPC_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_PPC_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_PPC_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_PPC_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++ ++// End PPC/GCC/Linux tests ------------------ ++ ++// Begin Sparc/GCC/Linux tests ---------------- ++ ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target sparc-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARC ++// CHECK_SPARC: #define __BIG_ENDIAN__ 1 ++// CHECK_SPARC: #define __sparc 1 ++// CHECK_SPARC: #define __sparc__ 1 ++// CHECK_SPARC-NOT: #define __sparcv9 1 ++// CHECK_SPARC-NOT: #define __sparcv9__ 1 ++// CHECK_SPARC: #define __sparcv8 1 ++// CHECK_SPARC-NOT: #define __sparcv9 1 ++// CHECK_SPARC-NOT: #define __sparcv9__ 1 ++ ++// RUN: %clang -mcpu=v9 -E -dM %s -o - 2>&1 \ ++// RUN: -target sparc-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARC-V9 ++// CHECK_SPARC-V9-NOT: #define __sparcv8 1 ++// CHECK_SPARC-V9-NOT: #define __sparcv8__ 1 ++// CHECK_SPARC-V9: #define __sparc_v9__ 1 ++// CHECK_SPARC-V9: #define __sparcv9 1 ++// CHECK_SPARC-V9: #define __sparcv9__ 1 ++ ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target sparc-sun-solaris \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARC_SOLARIS_GCC_ATOMICS ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++ ++// RUN: %clang -mcpu=v8 -E -dM %s -o - 2>&1 \ ++// RUN: -target sparc-sun-solaris \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARC_SOLARIS_GCC_ATOMICS-V8 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS-V8-NOT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS-V8-NOT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS-V8-NOT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SPARC_SOLARIS_GCC_ATOMICS-V8-NOT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++ ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target sparcel-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARCEL ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.1 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-1 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.2 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.3 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2100 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-1 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2150 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2155 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2450 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2455 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2x5x 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2080 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2085 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2480 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2485 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2x8x 2>&1 \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-3 \ ++// RUN: -check-prefix=CHECK_SPARCEL -check-prefix=CHECK_MYRIAD2 ++// CHECK_SPARCEL: #define __LITTLE_ENDIAN__ 1 ++// CHECK_MYRIAD2: #define __leon__ 1 ++// CHECK_MYRIAD2-1: #define __myriad2 1 ++// CHECK_MYRIAD2-1: #define __myriad2__ 1 ++// CHECK_MYRIAD2-2: #define __ma2x5x 1 ++// CHECK_MYRIAD2-2: #define __ma2x5x__ 1 ++// CHECK_MYRIAD2-2: #define __myriad2 2 ++// CHECK_MYRIAD2-2: #define __myriad2__ 2 ++// CHECK_MYRIAD2-3: #define __ma2x8x 1 ++// CHECK_MYRIAD2-3: #define __ma2x8x__ 1 ++// CHECK_MYRIAD2-3: #define __myriad2 3 ++// CHECK_MYRIAD2-3: #define __myriad2__ 3 ++// CHECK_SPARCEL: #define __sparc 1 ++// CHECK_SPARCEL: #define __sparc__ 1 ++// CHECK_MYRIAD2: #define __sparc_v8__ 1 ++// CHECK_SPARCEL: #define __sparcv8 1 ++ ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target sparcv9-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARCV9 ++// CHECK_SPARCV9: #define __BIG_ENDIAN__ 1 ++// CHECK_SPARCV9: #define __sparc 1 ++// CHECK_SPARCV9: #define __sparc64__ 1 ++// CHECK_SPARCV9: #define __sparc__ 1 ++// CHECK_SPARCV9: #define __sparc_v9__ 1 ++// CHECK_SPARCV9: #define __sparcv9 1 ++// CHECK_SPARCV9: #define __sparcv9__ 1 ++ ++// RUN: %clang -E -dM %s -o - 2>&1 \ ++// RUN: -target sparcv9-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SPARCV9_GCC_ATOMICS ++// CHECK_SPARCV9_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SPARCV9_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SPARCV9_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SPARCV9_GCC_ATOMICS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++ ++// Begin SystemZ/GCC/Linux tests ---------------- ++ ++// RUN: %clang -march=arch8 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH8 ++// RUN: %clang -march=z10 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH8 ++// CHECK_SYSTEMZ_ARCH8: #define __ARCH__ 8 ++// CHECK_SYSTEMZ_ARCH8: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SYSTEMZ_ARCH8: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SYSTEMZ_ARCH8: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SYSTEMZ_ARCH8: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++// CHECK_SYSTEMZ_ARCH8: #define __LONG_DOUBLE_128__ 1 ++// CHECK_SYSTEMZ_ARCH8: #define __s390__ 1 ++// CHECK_SYSTEMZ_ARCH8: #define __s390x__ 1 ++// CHECK_SYSTEMZ_ARCH8: #define __zarch__ 1 ++ ++// RUN: %clang -march=arch9 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH9 ++// RUN: %clang -march=z196 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH9 ++// CHECK_SYSTEMZ_ARCH9: #define __ARCH__ 9 ++// CHECK_SYSTEMZ_ARCH9: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SYSTEMZ_ARCH9: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SYSTEMZ_ARCH9: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SYSTEMZ_ARCH9: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++// CHECK_SYSTEMZ_ARCH9: #define __LONG_DOUBLE_128__ 1 ++// CHECK_SYSTEMZ_ARCH9: #define __s390__ 1 ++// CHECK_SYSTEMZ_ARCH9: #define __s390x__ 1 ++// CHECK_SYSTEMZ_ARCH9: #define __zarch__ 1 ++ ++// RUN: %clang -march=arch10 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH10 ++// RUN: %clang -march=zEC12 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH10 ++// CHECK_SYSTEMZ_ARCH10: #define __ARCH__ 10 ++// CHECK_SYSTEMZ_ARCH10: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SYSTEMZ_ARCH10: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SYSTEMZ_ARCH10: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SYSTEMZ_ARCH10: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++// CHECK_SYSTEMZ_ARCH10: #define __HTM__ 1 ++// CHECK_SYSTEMZ_ARCH10: #define __LONG_DOUBLE_128__ 1 ++// CHECK_SYSTEMZ_ARCH10: #define __s390__ 1 ++// CHECK_SYSTEMZ_ARCH10: #define __s390x__ 1 ++// CHECK_SYSTEMZ_ARCH10: #define __zarch__ 1 ++ ++// RUN: %clang -march=arch11 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH11 ++// RUN: %clang -march=z13 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH11 ++// CHECK_SYSTEMZ_ARCH11: #define __ARCH__ 11 ++// CHECK_SYSTEMZ_ARCH11: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SYSTEMZ_ARCH11: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SYSTEMZ_ARCH11: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SYSTEMZ_ARCH11: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++// CHECK_SYSTEMZ_ARCH11: #define __HTM__ 1 ++// CHECK_SYSTEMZ_ARCH11: #define __LONG_DOUBLE_128__ 1 ++// CHECK_SYSTEMZ_ARCH11: #define __VX__ 1 ++// CHECK_SYSTEMZ_ARCH11: #define __s390__ 1 ++// CHECK_SYSTEMZ_ARCH11: #define __s390x__ 1 ++// CHECK_SYSTEMZ_ARCH11: #define __zarch__ 1 ++ ++// RUN: %clang -march=arch12 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH12 ++// RUN: %clang -march=z14 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH12 ++// CHECK_SYSTEMZ_ARCH12: #define __ARCH__ 12 ++// CHECK_SYSTEMZ_ARCH12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SYSTEMZ_ARCH12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SYSTEMZ_ARCH12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SYSTEMZ_ARCH12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++// CHECK_SYSTEMZ_ARCH12: #define __HTM__ 1 ++// CHECK_SYSTEMZ_ARCH12: #define __LONG_DOUBLE_128__ 1 ++// CHECK_SYSTEMZ_ARCH12: #define __VX__ 1 ++// CHECK_SYSTEMZ_ARCH12: #define __s390__ 1 ++// CHECK_SYSTEMZ_ARCH12: #define __s390x__ 1 ++// CHECK_SYSTEMZ_ARCH12: #define __zarch__ 1 ++ ++// RUN: %clang -march=arch13 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH13 ++// RUN: %clang -march=z15 -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH13 ++// CHECK_SYSTEMZ_ARCH13: #define __ARCH__ 13 ++// CHECK_SYSTEMZ_ARCH13: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 ++// CHECK_SYSTEMZ_ARCH13: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 ++// CHECK_SYSTEMZ_ARCH13: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 ++// CHECK_SYSTEMZ_ARCH13: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 ++// CHECK_SYSTEMZ_ARCH13: #define __HTM__ 1 ++// CHECK_SYSTEMZ_ARCH13: #define __LONG_DOUBLE_128__ 1 ++// CHECK_SYSTEMZ_ARCH13: #define __VX__ 1 ++// CHECK_SYSTEMZ_ARCH13: #define __s390__ 1 ++// CHECK_SYSTEMZ_ARCH13: #define __s390x__ 1 ++// CHECK_SYSTEMZ_ARCH13: #define __zarch__ 1 ++ ++// RUN: %clang -mhtm -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_HTM ++// CHECK_SYSTEMZ_HTM: #define __HTM__ 1 ++ ++// RUN: %clang -mvx -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_VX ++// CHECK_SYSTEMZ_VX: #define __VX__ 1 ++ ++// RUN: %clang -fzvector -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ZVECTOR ++// RUN: %clang -mzvector -E -dM %s -o - 2>&1 \ ++// RUN: -target s390x-unknown-linux \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ZVECTOR ++// CHECK_SYSTEMZ_ZVECTOR: #define __VEC__ 10303 ++ ++// Begin amdgcn tests ---------------- ++ ++// RUN: %clang -march=amdgcn -E -dM %s -o - 2>&1 \ ++// RUN: -target amdgcn-unknown-unknown \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_AMDGCN ++// CHECK_AMDGCN: #define __AMDGCN__ 1 ++// CHECK_AMDGCN: #define __HAS_FMAF__ 1 ++// CHECK_AMDGCN: #define __HAS_FP64__ 1 ++// CHECK_AMDGCN: #define __HAS_LDEXPF__ 1 ++ ++// Begin r600 tests ---------------- ++ ++// RUN: %clang -march=amdgcn -E -dM %s -o - 2>&1 \ ++// RUN: -target r600-unknown-unknown \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600 ++// CHECK_R600: #define __R600__ 1 ++// CHECK_R600-NOT: #define __HAS_FMAF__ 1 ++ ++// RUN: %clang -march=amdgcn -mcpu=cypress -E -dM %s -o - 2>&1 \ ++// RUN: -target r600-unknown-unknown \ ++// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600_FP64 ++// CHECK_R600_FP64-DAG: #define __R600__ 1 ++// CHECK_R600_FP64-DAG: #define __HAS_FMAF__ 1 diff -Nru llvm-toolchain-11-11.0.1/debian/patches/sparc/sparc-D98575-compiler-rt.patch llvm-toolchain-11-11.1.0/debian/patches/sparc/sparc-D98575-compiler-rt.patch --- llvm-toolchain-11-11.0.1/debian/patches/sparc/sparc-D98575-compiler-rt.patch 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/sparc/sparc-D98575-compiler-rt.patch 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,17 @@ +--- llvm-toolchain-12-12.0.1~+rc1.orig/compiler-rt/cmake/base-config-ix.cmake ++++ llvm-toolchain-12-12.0.1~+rc1/compiler-rt/cmake/base-config-ix.cmake +@@ -189,8 +189,12 @@ macro(test_targets) + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x") + test_target_arch(s390x "" "") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "sparc") +- test_target_arch(sparc "" "-m32") +- test_target_arch(sparcv9 "" "-m64") ++ if (CMAKE_SIZEOF_VOID_P EQUAL 4) ++ test_target_arch(sparc "" "-mcpu=v9" "-m32") ++ append("-latomic" CMAKE_LD_FLAGS) ++ else() ++ test_target_arch(sparcv9 "" "-m64") ++ endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el") + # Gcc doesn't accept -m32/-m64 so we do the next best thing and use + # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match diff -Nru llvm-toolchain-11-11.0.1/debian/patches/test-disable-lldb-i386.diff llvm-toolchain-11-11.1.0/debian/patches/test-disable-lldb-i386.diff --- llvm-toolchain-11-11.0.1/debian/patches/test-disable-lldb-i386.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/test-disable-lldb-i386.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,24 @@ +Index: llvm-toolchain-13-13.0.0~+rc3/integration-test-suite/tests/basic_lldb.c +=================================================================== +--- llvm-toolchain-13-13.0.0~+rc3.orig/integration-test-suite/tests/basic_lldb.c ++++ llvm-toolchain-13-13.0.0~+rc3/integration-test-suite/tests/basic_lldb.c +@@ -1,6 +1,7 @@ + // RUN: %clang -g -o %t %s + // RUN: %lldb -s %S/basic_lldb.in %t | grep "main at basic_lldb.c:" + // REQUIRES: lldb, clang ++ // XFAIL: i686, i386 + + int main() { + int a=0; +Index: llvm-toolchain-13-13.0.0~+rc3/integration-test-suite/tests/basic_lldb2.cpp +=================================================================== +--- llvm-toolchain-13-13.0.0~+rc3.orig/integration-test-suite/tests/basic_lldb2.cpp ++++ llvm-toolchain-13-13.0.0~+rc3/integration-test-suite/tests/basic_lldb2.cpp +@@ -1,6 +1,7 @@ + // RUN: %clangxx -g -o %t %s + // RUN: %lldb -s %S/basic_lldb2.in %t | grep "stop reason = step over" + // REQUIRES: lldb, clangxx ++ // XFAIL: i686, i386 + + #include + int main (void) diff -Nru llvm-toolchain-11-11.0.1/debian/patches/unbreak-atomic-mips.diff llvm-toolchain-11-11.1.0/debian/patches/unbreak-atomic-mips.diff --- llvm-toolchain-11-11.0.1/debian/patches/unbreak-atomic-mips.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/unbreak-atomic-mips.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,19 @@ +Index: llvm-toolchain-13-13.0.0/compiler-rt/lib/scudo/standalone/CMakeLists.txt +=================================================================== +--- llvm-toolchain-13-13.0.0.orig/compiler-rt/lib/scudo/standalone/CMakeLists.txt ++++ llvm-toolchain-13-13.0.0/compiler-rt/lib/scudo/standalone/CMakeLists.txt +@@ -137,6 +137,13 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREA + + append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) + ++if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips" OR ++ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" OR ++ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mipsel" OR ++ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64el") ++ list(APPEND SCUDO_LINK_LIBS atomic) ++endif() ++ + if(COMPILER_RT_HAS_SCUDO_STANDALONE) + add_compiler_rt_object_libraries(RTScudoStandalone + ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} + diff -Nru llvm-toolchain-11-11.0.1/debian/patches/workaround-bug-48259.diff llvm-toolchain-11-11.1.0/debian/patches/workaround-bug-48259.diff --- llvm-toolchain-11-11.0.1/debian/patches/workaround-bug-48259.diff 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/patches/workaround-bug-48259.diff 2022-01-24 08:15:24.000000000 +0000 @@ -0,0 +1,15 @@ +Index: llvm-toolchain-snapshot_12~++20201124100523+245052ac3080/llvm/include/llvm/Support/Recycler.h +=================================================================== +--- llvm-toolchain-snapshot_12~++20201124100523+245052ac3080.orig/llvm/include/llvm/Support/Recycler.h ++++ llvm-toolchain-snapshot_12~++20201124100523+245052ac3080/llvm/include/llvm/Support/Recycler.h +@@ -83,8 +83,8 @@ public: + SubClass *Allocate(AllocatorType &Allocator) { + static_assert(alignof(SubClass) <= Align, + "Recycler allocation alignment is less than object align!"); +- static_assert(sizeof(SubClass) <= Size, +- "Recycler allocation size is less than object size!"); ++// static_assert(sizeof(SubClass) <= Size, ++// "Recycler allocation size is less than object size!"); + return FreeList ? reinterpret_cast(pop_val()) + : static_cast(Allocator.Allocate(Size, Align)); + } diff -Nru llvm-toolchain-11-11.0.1/debian/qualify-clang.sh llvm-toolchain-11-11.1.0/debian/qualify-clang.sh --- llvm-toolchain-11-11.0.1/debian/qualify-clang.sh 2020-11-07 14:53:16.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/qualify-clang.sh 2022-01-27 21:21:16.000000000 +0000 @@ -84,7 +84,7 @@ rm -rf cmaketest && mkdir cmaketest cat > cmaketest/CMakeLists.txt < cmaketest/CMakeLists.txt < foo.log +#if grep -q "no libxml2"; then +# echo "llvm-mt isn't compiled with libxml" +# exit 1 +#fi + echo '#include ' > foo.c clang-$VERSION -c foo.c @@ -1198,9 +1205,9 @@ rm -rf cmaketest && mkdir cmaketest cat > cmaketest/CMakeLists.txt < cmaketest/CMakeLists.txt < CMakeLists.txt -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 3.7) project(cmake-test) -find_package(LLVM 11.0.0 REQUIRED +find_package(LLVM 11.1 REQUIRED COMPONENTS Analysis BitReader diff -Nru llvm-toolchain-11-11.0.1/debian/tests/control llvm-toolchain-11-11.1.0/debian/tests/control --- llvm-toolchain-11-11.0.1/debian/tests/control 2020-09-07 11:31:03.000000000 +0000 +++ llvm-toolchain-11-11.1.0/debian/tests/control 2022-01-24 08:11:48.000000000 +0000 @@ -10,7 +10,7 @@ Restrictions: allow-stderr Tests: cmake-test -Depends: gcc, build-essential, cmake, llvm-11-dev, libclang-common-11-dev +Depends: gcc, build-essential, cmake, llvm-11-dev Test-Command: python3 -c "import lldb; print(lldb.__file__); print(lldb)" Depends: python3-lldb-11 diff -Nru llvm-toolchain-11-11.0.1/.github/workflows/clang-tests.yml llvm-toolchain-11-11.1.0/.github/workflows/clang-tests.yml --- llvm-toolchain-11-11.0.1/.github/workflows/clang-tests.yml 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/.github/workflows/clang-tests.yml 2021-06-23 16:15:53.000000000 +0000 @@ -28,16 +28,16 @@ steps: - name: Setup Windows if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@master + uses: llvm/actions/setup-windows@main with: arch: amd64 - name: Install Ninja - uses: llvm/actions/install-ninja@master + uses: llvm/actions/install-ninja@main - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Test clang - uses: llvm/actions/build-test-llvm-project@master + uses: llvm/actions/build-test-llvm-project@main with: cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release build_target: check-clang diff -Nru llvm-toolchain-11-11.0.1/.github/workflows/libclang-abi-tests.yml llvm-toolchain-11-11.1.0/.github/workflows/libclang-abi-tests.yml --- llvm-toolchain-11-11.0.1/.github/workflows/libclang-abi-tests.yml 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/.github/workflows/libclang-abi-tests.yml 2021-06-23 16:15:53.000000000 +0000 @@ -0,0 +1,132 @@ +name: libclang ABI Tests + +on: + push: + branches: + - 'release/**' + paths: + - 'clang/**' + - '.github/workflows/libclang-abi-tests.yml' + pull_request: + paths: + - 'clang/**' + - '.github/workflows/libclang-abi-tests.yml' + +jobs: + abi-dump-setup: + runs-on: ubuntu-latest + outputs: + BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} + ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} + ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }} + BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }} + LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} + LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }} + LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }} + steps: + - name: Checkout source + uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Get LLVM version + id: version + uses: llvm/actions/get-llvm-version@main + + - name: Setup Variables + id: vars + run: | + if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 -o ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then + echo ::set-output name=BASELINE_VERSION_MAJOR::$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1)) + echo ::set-output name=ABI_HEADERS::clang-c + echo ::set-output name=ABI_LIBS::libclang.so + else + echo ::set-output name=BASELINE_VERSION_MAJOR::${{ steps.version.outputs.LLVM_VERSION_MAJOR }} + echo ::set-output name=ABI_HEADERS::. + echo ::set-output name=ABI_LIBS::libclang.so libclang-cpp.so + fi + + abi-dump: + needs: abi-dump-setup + runs-on: ubuntu-latest + strategy: + matrix: + name: + - build-baseline + - build-latest + include: + - name: build-baseline + llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }} + ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.0.0 + repo: llvm/llvm-project + - name: build-latest + llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }} + ref: ${{ github.sha }} + repo: ${{ github.repository }} + steps: + - name: Install Ninja + uses: llvm/actions/install-ninja@main + - name: Install abi-compliance-checker + run: | + sudo apt-get install abi-dumper autoconf pkg-config + - name: Install universal-ctags + run: | + git clone https://github.com/universal-ctags/ctags.git + cd ctags + ./autogen.sh + ./configure + sudo make install + - name: Download source code + uses: llvm/actions/get-llvm-project-src@main + with: + ref: ${{ matrix.ref }} + repo: ${{ matrix.repo }} + - name: Configure + run: | + mkdir install + cmake -B build -S llvm -G Ninja -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g -Og" -DCMAKE_INSTALL_PREFIX=`pwd`/install llvm + - name: Build + run: ninja -C build/ ${{ needs.abi-dump-setup.outputs.ABI_LIBS }} install-clang-headers + - name: Dump ABI + run: | + parallel abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o {}-${{ matrix.ref }}.abi ./build/lib/{} ::: ${{ needs.abi-dump-setup.outputs.ABI_LIBS }} + for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do + # Remove symbol versioning from dumps, so we can compare across major versions. + sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' $lib-${{ matrix.ref }}.abi + tar -czf $lib-${{ matrix.ref }}.abi.tar.gz $lib-${{ matrix.ref }}.abi + done + - name: Upload ABI file + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.name }} + path: "*${{ matrix.ref }}.abi.tar.gz" + + abi-compare: + runs-on: ubuntu-latest + needs: + - abi-dump-setup + - abi-dump + steps: + - name: Download baseline + uses: actions/download-artifact@v1 + with: + name: build-baseline + - name: Download latest + uses: actions/download-artifact@v1 + with: + name: build-latest + + - name: Install abi-compliance-checker + run: sudo apt-get install abi-compliance-checker + - name: Compare ABI + run: | + for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do + abi-compliance-checker -lib $lib -old build-baseline/$lib*.abi.tar.gz -new build-latest/$lib*.abi.tar.gz + done + - name: Upload ABI Comparison + if: always() + uses: actions/upload-artifact@v2 + with: + name: compat-report-${{ github.sha }} + path: compat_reports/ + diff -Nru llvm-toolchain-11-11.0.1/.github/workflows/libclc-tests.yml llvm-toolchain-11-11.1.0/.github/workflows/libclc-tests.yml --- llvm-toolchain-11-11.0.1/.github/workflows/libclc-tests.yml 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/.github/workflows/libclc-tests.yml 2021-06-23 16:15:53.000000000 +0000 @@ -31,16 +31,16 @@ steps: - name: Setup Windows if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@master + uses: llvm/actions/setup-windows@main with: arch: amd64 - name: Install Ninja - uses: llvm/actions/install-ninja@master + uses: llvm/actions/install-ninja@main - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Build clang - uses: llvm/actions/build-test-llvm-project@master + uses: llvm/actions/build-test-llvm-project@main with: cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release build_target: "" diff -Nru llvm-toolchain-11-11.0.1/.github/workflows/lldb-tests.yml llvm-toolchain-11-11.1.0/.github/workflows/lldb-tests.yml --- llvm-toolchain-11-11.0.1/.github/workflows/lldb-tests.yml 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/.github/workflows/lldb-tests.yml 2021-06-23 16:15:53.000000000 +0000 @@ -20,27 +20,29 @@ build_lldb: name: lldb build runs-on: ${{ matrix.os }} + # Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274 + env: + CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include strategy: fail-fast: false matrix: os: - ubuntu-latest - windows-latest - # macOS build disabled due to: llvm.org/PR46190 - #- macOS-latest + - macOS-latest steps: - name: Setup Windows if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@master + uses: llvm/actions/setup-windows@main with: arch: amd64 - name: Install Ninja - uses: llvm/actions/install-ninja@master + uses: llvm/actions/install-ninja@main - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Build lldb - uses: llvm/actions/build-test-llvm-project@master + uses: llvm/actions/build-test-llvm-project@main with: # Mac OS requries that libcxx is enabled for lldb tests, so we need to disable them. cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF diff -Nru llvm-toolchain-11-11.0.1/.github/workflows/lld-tests.yml llvm-toolchain-11-11.1.0/.github/workflows/lld-tests.yml --- llvm-toolchain-11-11.0.1/.github/workflows/lld-tests.yml 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/.github/workflows/lld-tests.yml 2021-06-23 16:15:53.000000000 +0000 @@ -28,16 +28,16 @@ steps: - name: Setup Windows if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@master + uses: llvm/actions/setup-windows@main with: arch: amd64 - name: Install Ninja - uses: llvm/actions/install-ninja@master + uses: llvm/actions/install-ninja@main - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Test lld - uses: llvm/actions/build-test-llvm-project@master + uses: llvm/actions/build-test-llvm-project@main with: cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="lld" -DCMAKE_BUILD_TYPE=Release build_target: check-lld diff -Nru llvm-toolchain-11-11.0.1/.github/workflows/llvm-tests.yml llvm-toolchain-11-11.1.0/.github/workflows/llvm-tests.yml --- llvm-toolchain-11-11.0.1/.github/workflows/llvm-tests.yml 2021-01-06 08:18:19.000000000 +0000 +++ llvm-toolchain-11-11.1.0/.github/workflows/llvm-tests.yml 2021-06-23 16:15:53.000000000 +0000 @@ -29,16 +29,16 @@ steps: - name: Setup Windows if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@master + uses: llvm/actions/setup-windows@main with: arch: amd64 - name: Install Ninja - uses: llvm/actions/install-ninja@master + uses: llvm/actions/install-ninja@main - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Test llvm - uses: llvm/actions/build-test-llvm-project@master + uses: llvm/actions/build-test-llvm-project@main with: cmake_args: -G Ninja -DCMAKE_BUILD_TYPE=Release @@ -60,7 +60,7 @@ repo: ${{ github.repository }} steps: - name: Install Ninja - uses: llvm/actions/install-ninja@master + uses: llvm/actions/install-ninja@main - name: Install abi-compliance-checker run: | sudo apt-get install abi-dumper autoconf pkg-config @@ -72,7 +72,7 @@ ./configure sudo make install - name: Download source code - uses: llvm/actions/get-llvm-project-src@master + uses: llvm/actions/get-llvm-project-src@main with: ref: ${{ matrix.ref }} repo: ${{ matrix.repo }} diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/CMakeLists.txt llvm-toolchain-11-11.1.0/integration-test-suite/CMakeLists.txt --- llvm-toolchain-11-11.0.1/integration-test-suite/CMakeLists.txt 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/CMakeLists.txt 2021-06-23 16:15:58.000000000 +0000 @@ -19,6 +19,7 @@ find_program_or_warn(CLANG_BINARY clang) find_program_or_warn(CLANG_TIDY_BINARY clang-tidy) find_program_or_warn(CLANG_FORMAT_BINARY clang-format) +find_program_or_warn(CLANG_FORMAT_DIFF_BINARY clang-format-diff) find_program_or_warn(OPT_BINARY opt) find_program_or_warn(LLVMNM llvm-nm) find_program_or_warn(LLVMPROFDATA llvm-profdata) diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/.github/workflows/CI.yml llvm-toolchain-11-11.1.0/integration-test-suite/.github/workflows/CI.yml --- llvm-toolchain-11-11.0.1/integration-test-suite/.github/workflows/CI.yml 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/.github/workflows/CI.yml 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,52 @@ +name: Build with different version +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04] + version: [10, 11, 12, 13] + steps: + - uses: actions/checkout@v2 + + - name: Set Ubuntu codename (Bionic) + if: ${{ matrix.os == 'ubuntu-18.04'}} + run: echo "UBUNTU_CODENAME=bionic" >> $GITHUB_ENV + - name: Set Ubuntu codename (Focal) + if: ${{ matrix.os == 'ubuntu-20.04'}} + run: echo "UBUNTU_CODENAME=focal" >> $GITHUB_ENV + - name: Install Dependencies + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + if test ${{ matrix.version }} == 13; then + sudo apt-add-repository "deb http://apt.llvm.org/${{ env.UBUNTU_CODENAME }}/ llvm-toolchain-${{ env.UBUNTU_CODENAME }} main" + else + sudo apt-add-repository "deb http://apt.llvm.org/${{ env.UBUNTU_CODENAME }}/ llvm-toolchain-${{ env.UBUNTU_CODENAME }}-${{ matrix.version }} main" + fi + sudo apt-get update + sudo apt-get install -y clang-${{ matrix.version }} clang-tidy-${{ matrix.version }} clang-format-${{ matrix.version }} clang-tools-${{ matrix.version }} llvm-${{ matrix.version }}-dev lld-${{ matrix.version }} lldb-${{ matrix.version }} llvm-${{ matrix.version }}-tools libomp-${{ matrix.version }}-dev libc++-${{ matrix.version }}-dev libc++abi-${{ matrix.version }}-dev libclang-common-${{ matrix.version }}-dev libclang-${{ matrix.version }}-dev libclang-cpp${{ matrix.version }}-dev + - name: Run the testsuite + shell: bash + run: | + mkdir build && cd build + cmake -DLIT=/usr/lib/llvm-${{ matrix.version }}/build/utils/lit/lit.py \ + -DCLANG_BINARY=/usr/bin/clang-${{ matrix.version }} \ + -DCLANGXX_BINARY=/usr/bin/clang++-${{ matrix.version }} \ + -DCLANG_TIDY_BINARY=/usr/bin/clang-tidy-${{ matrix.version }} \ + -DCLANG_FORMAT_BINARY=/usr/bin/clang-format-${{ matrix.version }} \ + -DCLANG_FORMAT_DIFF_BINARY=/usr/bin/clang-format-diff-${{ matrix.version }} \ + -DLLD_BINARY=/usr/bin/lld-${{ matrix.version }} \ + -DLLDB_BINARY=/usr/bin/lldb-${{ matrix.version }} \ + -DLLVMCONFIG_BINARY=/usr/bin/llvm-config-${{ matrix.version }} \ + -DOPT_BINARY=/usr/bin/opt-${{ matrix.version }} \ + -DSCANBUILD=/usr/bin/scan-build-${{ matrix.version }} \ + -DCLANG_TIDY_BINARY=/usr/bin/clang-tidy-${{ matrix.version }} \ + -DSCANVIEW=/usr/bin/scan-view-${{ matrix.version }} \ + -DLLVMNM=/usr/bin/llvm-nm-${{ matrix.version }} \ + -DLLVMPROFDATA=/usr/bin/llvm-profdata-${{ matrix.version }} \ + -DENABLE_COMPILER_RT=ON \ + -DENABLE_LIBCXX=ON \ + ../ + make check diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/basic_debuginfo.c llvm-toolchain-11-11.1.0/integration-test-suite/tests/basic_debuginfo.c --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/basic_debuginfo.c 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/basic_debuginfo.c 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,34 @@ +// Test that debuginfo produced by clang is compatible with basic dwarf tool +// from https://rosettacode.org/wiki/Guess_the_number#C + +// RUN: %clang -g3 %s -o %t && objdump -g --dwarf-check %t | grep -E 'DWARF Version:\s*4' +// REQUIRES: clang + +#include +#include +#include + +int main(void) +{ + srand(time(NULL)); + int n = 1 + (rand() % 10); + + puts("I'm thinking of a number between 1 and 10."); + puts("Try to guess it:"); + + int g; + while (1) { + if (scanf("%d", &g) != 1) { + /* ignore one char, in case user gave a non-number */ + char c; + scanf("%c", &c); + continue; + } + + if (g == n) { + puts("Correct!"); + return 0; + } + puts("That's not my number. Try another guess:"); + } +} diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/format_diff.c llvm-toolchain-11-11.1.0/integration-test-suite/tests/format_diff.c --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/format_diff.c 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/format_diff.c 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,15 @@ +// Make sure clang-format-diff works as expected +// +// REQUIRES: clang-format-diff, clang +// RUN: %clang -E -Wp,-P %s -DV0 > %t.0.c +// RUN: %clang -E -Wp,-P %s -DV1 > %t.1.c +// RUN: diff -u %t.0.c %t.1.c || true > %t.patch +// RUN: %clang-format-diff -i < %t.patch + +#if defined(V0) +int main() { +} +#elif defined(V1) +int main() { return 0; +} +#endif diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/from_chars_libc++.cpp llvm-toolchain-11-11.1.0/integration-test-suite/tests/from_chars_libc++.cpp --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/from_chars_libc++.cpp 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/from_chars_libc++.cpp 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,21 @@ +// Test charconv integration, see https://bugzilla.redhat.com/show_bug.cgi?id=1657544 +// But uses libc++ +// REQUIRES: clang, libc++ +// RUN: %clangxx -stdlib=libc++ %s -o %t +// RUN: %t 100 | grep 100 + +#include +#include +#include + +using namespace std; + +int main(int argc, char **argv) +{ + size_t r=0; + const char *begin = argv[1]; + const char *end = begin + strlen(begin); + from_chars(begin, end, r); + cout << r << '\n'; + return 0; +} diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/libclang_cpp.cpp llvm-toolchain-11-11.1.0/integration-test-suite/tests/libclang_cpp.cpp --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/libclang_cpp.cpp 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/libclang_cpp.cpp 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,36 @@ +// Test the link against libclang-cppXX +// +// REQUIRES: clang, llvm-config +// RUN: %clangxx -lclang-cpp -v %s -o %t `%llvm-config --cxxflags --libs` +// RUN: ldd %t 2>&1|grep -q libclang-cpp + +#include "clang/Tooling/CommonOptionsParser.h" +#include "llvm/Support/CommandLine.h" + +using namespace clang::tooling; +using clang::tooling::CommonOptionsParser; + +// Apply a custom category to all command-line options so that they are the +// only ones displayed. +static llvm::cl::OptionCategory MyToolCategory("my-tool options"); + +int main(int argc, const char **argv) { + // CommonOptionsParser constructor will parse arguments and create a + // CompilationDatabase. In case of error it will terminate the program. + +#if __clang_major__ < 13 + clang::tooling::CommonOptionsParser OptionsParser(argc, argv, + MyToolCategory); +#else + auto ExpectedParser = CommonOptionsParser::create(argc, argv, MyToolCategory); + if (!ExpectedParser) { + // Fail gracefully for unsupported options. + llvm::errs() << ExpectedParser.takeError(); + return 1; + } + CommonOptionsParser& OptionsParser = ExpectedParser.get(); +#endif + + // Use OptionsParser.getCompilations() and OptionsParser.getSourcePathList() + // to retrieve CompilationDatabase and the list of input file paths. +} diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/libc++_link_static.cpp llvm-toolchain-11-11.1.0/integration-test-suite/tests/libc++_link_static.cpp --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/libc++_link_static.cpp 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/libc++_link_static.cpp 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,17 @@ +// Test lib(std)c++ static +// https://bugs.llvm.org/show_bug.cgi?id=43604 +// +// Check linking with libstdc++ +// RUN: %clangxx -o %t %s -pie -static-libstdc++ +// RUN: %t +// RUN: ldd %t 2>&1|grep -qv libstdc++ +// +// Check linking with libc++. As of now, this fails: +// FAIL: %clangxx -o %t -fPIC %s -pie -stdlib=libc++ -static-libstdc++ +// +// REQUIRES: clangxx, libc++ + +#include +int main () { + std::cout << "Hello World!" << std::endl; +} diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/lit.site.cfg.in llvm-toolchain-11-11.1.0/integration-test-suite/tests/lit.site.cfg.in --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/lit.site.cfg.in 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/lit.site.cfg.in 2021-06-23 16:15:58.000000000 +0000 @@ -18,6 +18,7 @@ # The order matters enable_program('clang-tidy', "@CLANG_TIDY_BINARY@") +enable_program('clang-format-diff', "@CLANG_FORMAT_DIFF_BINARY@") enable_program('clang-format', "@CLANG_FORMAT_BINARY@") enable_program('clangxx', "@CLANGXX_BINARY@") enable_program('clang', "@CLANG_BINARY@") diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/lto_and_lld.c llvm-toolchain-11-11.1.0/integration-test-suite/tests/lto_and_lld.c --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/lto_and_lld.c 1970-01-01 00:00:00.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/lto_and_lld.c 2021-06-23 16:15:58.000000000 +0000 @@ -0,0 +1,20 @@ +// Test LTO support within lld +// REQUIRES: clang, lld +// RUN: %clang -c -flto %s -DLIB -o %t-obj.o +// RUN: %clang -c -flto %s -ULIB -o %t-main.o +// RUN: %clang -fuse-ld=lld -flto %t-obj.o %t-main.o -o %t +// RUN: %t | grep "hello lita" + +#ifdef LIB +#include +void greet() { + puts("hello lita"); +} +#else +extern void greet(); + +int main() { + greet(); + return 0; +} +#endif diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/rpass_inline.cpp llvm-toolchain-11-11.1.0/integration-test-suite/tests/rpass_inline.cpp --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/rpass_inline.cpp 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/rpass_inline.cpp 2021-06-23 16:15:58.000000000 +0000 @@ -1,9 +1,17 @@ // Test a Rpass=inline // // RUN: %clangxx -O2 -Rpass=inline %s -c &> %t.log -// RUN: grep -q "cost=always" %t.log +// RUN: grep -q -E "(inlined into main with|cost=always)" %t.log // REQUIRES: clangxx 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); } + +int sum = 0; + +int main(int argc, const char *argv[]) { + for (int i = 0; i < 30; i++) + bar(argc); + return sum; +} diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/tests/whole-toolchain.cpp llvm-toolchain-11-11.1.0/integration-test-suite/tests/whole-toolchain.cpp --- llvm-toolchain-11-11.0.1/integration-test-suite/tests/whole-toolchain.cpp 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/tests/whole-toolchain.cpp 2021-06-23 16:15:58.000000000 +0000 @@ -1,6 +1,9 @@ // Tests all components of the toolchain // REQUIRES: clang, lld, compiler-rt, libc++ -// RUN: %clangxx -fuse-ld=lld -rtlib=compiler-rt -stdlib=libc++ %s -o %t +// +// NOTE: Adding -lgcc_eh here is required to provide unwinding information. An +// alternative would be to force usage of LLVM unwinder when building compiler-rt. +// RUN: %clangxx -fuse-ld=lld -rtlib=compiler-rt -stdlib=libc++ -lgcc_eh %s -o %t // RUN: %t | grep "Hello World" #include @@ -8,4 +11,3 @@ std::cout << "Hello World" << std::endl; return 0; } - diff -Nru llvm-toolchain-11-11.0.1/integration-test-suite/.travis.yml llvm-toolchain-11-11.1.0/integration-test-suite/.travis.yml --- llvm-toolchain-11-11.0.1/integration-test-suite/.travis.yml 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/integration-test-suite/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -language: minimal -jobs: - include: - - os: linux - dist: bionic - addons: - apt: - sources: - - sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - ubuntu-toolchain-r-test - packages: - - clang-10 - - clang-tidy-10 - - clang-format-10 - - clang-tools-10 - - llvm-10-dev - - lld-10 - - lldb-10 - - llvm-10-tools - - libomp-10-dev - - libc++-10-dev - - libc++abi-10-dev - - libstdc++-9-dev - - libclang-common-10-dev - -script: | - mkdir build && cd build && \ - cmake -DLIT=/usr/lib/llvm-10/build/utils/lit/lit.py \ - -DCLANG_BINARY=/usr/bin/clang-10 \ - -DCLANGXX_BINARY=/usr/bin/clang++-10 \ - -DCLANG_TIDY_BINARY=/usr/bin/clang-tidy-10 \ - -DCLANG_FORMAT_BINARY=/usr/bin/clang-format-10 \ - -DLLD_BINARY=/usr/bin/lld-10 \ - -DLLDB_BINARY=/usr/bin/lldb-10 \ - -DLLVMCONFIG_BINARY=/usr/bin/llvm-config-10 \ - -DOPT_BINARY=/usr/bin/opt-10 \ - -DSCANBUILD=/usr/bin/scan-build-10 \ - -DCLANG_TIDY_BINARY=/usr/bin/clang-tidy-10 \ - -DSCANVIEW=/usr/bin/scan-view-10 \ - -DLLVMNM=/usr/bin/llvm-nm-10 \ - -DLLVMPROFDATA=/usr/bin/llvm-profdata-10 \ - -DENABLE_COMPILER_RT=OFF \ - -DENABLE_LIBCXX=ON \ - ../ && \ - make check diff -Nru llvm-toolchain-11-11.0.1/libcxx/CMakeLists.txt llvm-toolchain-11-11.1.0/libcxx/CMakeLists.txt --- llvm-toolchain-11-11.0.1/libcxx/CMakeLists.txt 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/libcxx/CMakeLists.txt 2021-06-23 16:15:54.000000000 +0000 @@ -32,7 +32,7 @@ project(libcxx CXX C) set(PACKAGE_NAME libcxx) - set(PACKAGE_VERSION 11.0.1) + set(PACKAGE_VERSION 11.1.0) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") diff -Nru llvm-toolchain-11-11.0.1/libcxxabi/CMakeLists.txt llvm-toolchain-11-11.1.0/libcxxabi/CMakeLists.txt --- llvm-toolchain-11-11.0.1/libcxxabi/CMakeLists.txt 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/libcxxabi/CMakeLists.txt 2021-06-23 16:15:55.000000000 +0000 @@ -25,7 +25,7 @@ project(libcxxabi CXX C) set(PACKAGE_NAME libcxxabi) - set(PACKAGE_VERSION 11.0.1) + set(PACKAGE_VERSION 11.1.0) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") diff -Nru llvm-toolchain-11-11.0.1/libunwind/CMakeLists.txt llvm-toolchain-11-11.1.0/libunwind/CMakeLists.txt --- llvm-toolchain-11-11.0.1/libunwind/CMakeLists.txt 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/libunwind/CMakeLists.txt 2021-06-23 16:15:55.000000000 +0000 @@ -83,7 +83,7 @@ endif() set(PACKAGE_NAME libunwind) - set(PACKAGE_VERSION 11.0.1) + set(PACKAGE_VERSION 11.1.0) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp 2021-06-23 16:15:55.000000000 +0000 @@ -282,7 +282,7 @@ Status PlatformAppleTVSimulator::GetSharedModule( const ModuleSpec &module_spec, lldb_private::Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, - ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { + llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) { // For AppleTV, the SDK files are all cached locally on the host system. So // first we ask for the file in the cached SDK, then we attempt to get a // shared module for the right architecture with the right UUID. @@ -296,9 +296,9 @@ module_search_paths_ptr); } else { const bool always_create = false; - error = ModuleList::GetSharedModule( - module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, - did_create_ptr, always_create); + error = ModuleList::GetSharedModule(module_spec, module_sp, + module_search_paths_ptr, old_modules, + did_create_ptr, always_create); } if (module_sp) module_sp->SetPlatformFileSpec(platform_file); diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h 2021-06-23 16:15:55.000000000 +0000 @@ -55,7 +55,7 @@ GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, - lldb::ModuleSP *old_module_sp_ptr, + llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) override; uint32_t diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp 2021-06-23 16:15:55.000000000 +0000 @@ -283,7 +283,7 @@ Status PlatformAppleWatchSimulator::GetSharedModule( const ModuleSpec &module_spec, lldb_private::Process *process, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, - ModuleSP *old_module_sp_ptr, bool *did_create_ptr) { + llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) { // For AppleWatch, the SDK files are all cached locally on the host system. // So first we ask for the file in the cached SDK, then we attempt to get a // shared module for the right architecture with the right UUID. @@ -297,9 +297,9 @@ module_search_paths_ptr); } else { const bool always_create = false; - error = ModuleList::GetSharedModule( - module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, - did_create_ptr, always_create); + error = ModuleList::GetSharedModule(module_spec, module_sp, + module_search_paths_ptr, old_modules, + did_create_ptr, always_create); } if (module_sp) module_sp->SetPlatformFileSpec(platform_file); diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h 2021-06-23 16:15:55.000000000 +0000 @@ -55,7 +55,7 @@ GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, - lldb::ModuleSP *old_module_sp_ptr, + llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) override; uint32_t diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp 2021-06-23 16:15:55.000000000 +0000 @@ -730,7 +730,7 @@ // framework on macOS systems, a chance. error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp, module_search_paths_ptr, - old_module_sp_ptr, did_create_ptr); + old_modules, did_create_ptr); if (error.Success() && module_sp.get()) { return error; } diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp 2021-06-23 16:15:55.000000000 +0000 @@ -286,8 +286,8 @@ Status PlatformiOSSimulator::GetSharedModule( const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, - bool *did_create_ptr) { + const FileSpecList *module_search_paths_ptr, + llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) { // For iOS, the SDK files are all cached locally on the host system. So first // we ask for the file in the cached SDK, then we attempt to get a shared // module for the right architecture with the right UUID. @@ -301,9 +301,9 @@ module_search_paths_ptr); } else { const bool always_create = false; - error = ModuleList::GetSharedModule( - module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, - did_create_ptr, always_create); + error = ModuleList::GetSharedModule(module_spec, module_sp, + module_search_paths_ptr, old_modules, + did_create_ptr, always_create); } if (module_sp) module_sp->SetPlatformFileSpec(platform_file); diff -Nru llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h --- llvm-toolchain-11-11.0.1/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h 2021-06-23 16:15:55.000000000 +0000 @@ -57,7 +57,7 @@ GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, - lldb::ModuleSP *old_module_sp_ptr, + llvm::SmallVectorImpl *old_modules, bool *did_create_ptr) override; uint32_t diff -Nru llvm-toolchain-11-11.0.1/llvm/CMakeLists.txt llvm-toolchain-11-11.1.0/llvm/CMakeLists.txt --- llvm-toolchain-11-11.0.1/llvm/CMakeLists.txt 2021-01-06 08:18:20.000000000 +0000 +++ llvm-toolchain-11-11.1.0/llvm/CMakeLists.txt 2021-06-23 16:15:55.000000000 +0000 @@ -27,10 +27,10 @@ set(LLVM_VERSION_MAJOR 11) endif() if(NOT DEFINED LLVM_VERSION_MINOR) - set(LLVM_VERSION_MINOR 0) + set(LLVM_VERSION_MINOR 1) endif() if(NOT DEFINED LLVM_VERSION_PATCH) - set(LLVM_VERSION_PATCH 1) + set(LLVM_VERSION_PATCH 0) endif() if(NOT DEFINED LLVM_VERSION_SUFFIX) set(LLVM_VERSION_SUFFIX "") diff -Nru llvm-toolchain-11-11.0.1/llvm/utils/gn/secondary/llvm/version.gni llvm-toolchain-11-11.1.0/llvm/utils/gn/secondary/llvm/version.gni --- llvm-toolchain-11-11.0.1/llvm/utils/gn/secondary/llvm/version.gni 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/llvm/utils/gn/secondary/llvm/version.gni 2021-06-23 16:15:57.000000000 +0000 @@ -1,4 +1,4 @@ llvm_version_major = 11 -llvm_version_minor = 0 -llvm_version_patch = 1 +llvm_version_minor = 1 +llvm_version_patch = 0 llvm_version = "$llvm_version_major.$llvm_version_minor.$llvm_version_patch" diff -Nru llvm-toolchain-11-11.0.1/llvm/utils/release/build_llvm_package.bat llvm-toolchain-11-11.1.0/llvm/utils/release/build_llvm_package.bat --- llvm-toolchain-11-11.0.1/llvm/utils/release/build_llvm_package.bat 2021-01-06 08:18:21.000000000 +0000 +++ llvm-toolchain-11-11.1.0/llvm/utils/release/build_llvm_package.bat 2021-06-23 16:15:57.000000000 +0000 @@ -27,8 +27,8 @@ for /f "usebackq" %%i in (`PowerShell ^(Get-Date^).ToString^('yyyyMMdd'^)`) do set datestamp=%%i set revision=%1 -set package_version=11.0.1-%revision:~0,8% -set clang_format_vs_version=11.0.1.%datestamp% +set package_version=11.1.0-%revision:~0,8% +set clang_format_vs_version=11.1.0.%datestamp% set build_dir=llvm_package_%revision:~0,8% echo Revision: %revision%