summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver
Commit message (Collapse)AuthorAgeFilesLines
* make -fprofile-instr-generate and -fprofile-instr-use work with clang-clBob Haarman2016-11-301-0/+13
| | | | | | | | | Summary: Makes -fprofile-instr-generate and -fprofile-instr-use work with clang-cl so that profile-guided optimization can be used. Differential Revision: https://reviews.llvm.org/D27086 llvm-svn: 288230
* darwin: Unconditionally pass -lto_library, remove -Wliblto warning.Nico Weber2016-11-221-10/+4
| | | | | | | | | | | | | | | | | | | | | https://reviews.llvm.org/D25932 made it so that clang always checks if libLTO.dylib is present on disk, even if -flto is not being used. The motivation for that change was that if a dependency happens to contain bitcode, ld64 will try to load libLTO without -flto explicitly being enabled. However, the change had the undesirable side effect of warning if libLTO.dylib doesn't exist even if it isn't needed. Change things so that -lto_library is always passes, independent of if it exists or not. ld64 only looks at this flag if it uses LTO. If the dylib exists, all is well. If it doesn't, and LTO is not being used, all is well too. If ld64 does end up using LTO and the dylib does not exist, ld64 will print something like ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64 https://reviews.llvm.org/D26984 llvm-svn: 287685
* Rename option to -lto-pass-remarks-outputAdam Nemet2016-11-221-3/+3
| | | | | | | The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because of the duplicate option name with opt. llvm-svn: 287628
* [XRay] Support AArch64 in ClangDean Michael Berris2016-11-212-2/+2
| | | | | | | | | | | | | | | | | | This patch adds XRay support in Clang for AArch64 target. This patch is one of a series: LLVM: https://reviews.llvm.org/D26412 compiler-rt: https://reviews.llvm.org/D26413 Author: rSerge Reviewers: rengolin, dberris Subscribers: aemerson, cfe-commits, iid_iunknown Differential Revision: https://reviews.llvm.org/D26415 llvm-svn: 287518
* LTO support for -fsave-optimization-record on DarwinAdam Nemet2016-11-181-0/+9
| | | | | | | | I guess this would have to be added for each linker. Differential Revision: https://reviews.llvm.org/D26833 llvm-svn: 287358
* [CUDA] Driver changes to support CUDA compilation on MacOS.Justin Lebar2016-11-188-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Compiling CUDA device code requires us to know the host toolchain, because CUDA device-side compiles pull in e.g. host headers. When we only supported Linux compilation, this worked because CudaToolChain, which is responsible for device-side CUDA compilation, inherited from the Linux toolchain. But in order to support MacOS, CudaToolChain needs to take a HostToolChain pointer. Because a CUDA toolchain now requires a host TC, we no longer will create a CUDA toolchain from Driver::getToolChain -- you have to go through CreateOffloadingDeviceToolChains. I am *pretty* sure this is correct, and that previously any attempt to create a CUDA toolchain through getToolChain() would eventually have resulted in us throwing "error: unsupported use of NVPTX for host compilation". In any case hacking getToolChain to create a CUDA+host toolchain would be wrong, because a Driver can be reused for multiple compilations, potentially with different host TCs, and getToolChain will cache the result, causing us to potentially use a stale host TC. So that's the main change in this patch. In addition, we have to pull CudaInstallationDetector out of Generic_GCC and into a top-level class. It's now used by the Generic_GCC and MachO toolchains. Reviewers: tra Subscribers: rryan, hfinkel, sfantao Differential Revision: https://reviews.llvm.org/D26774 llvm-svn: 287285
* [CrashReproducer][Darwin] Suggest attaching .crash diagnostic fileBruno Cardoso Lopes2016-11-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | In addition to the preprocessed sources file and reproducer script, also point to the .crash diagnostic files on Darwin. Example: PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cpp clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cache clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.sh clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.crash When no match is found for the .crash, point the user to a directory where those can be found. Example: clang-4.0: note: diagnostic msg: Crash backtrace is located in clang-4.0: note: diagnostic msg: /Users/bruno/Library/Logs/DiagnosticReports/clang-4.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash clang-4.0: note: diagnostic msg: (choose the .crash file that corresponds to your crash) rdar://problem/27286266 llvm-svn: 287262
* [Driver] Infer the correct option to ld64 for -fembed-bitcodeSteven Wu2016-11-161-0/+12
| | | | | | | | | | | | | | | | | | Summary: -fembed-bitcode infers -bitcode_bundle to ld64 but it is not correctly passed when using LTO. LTO is a special case of -fembed-bitcode which it doesn't require embed the bitcode in a special section in the object file but it requires linker to save that as part of the final executable. rdar://problem/29274226 Reviewers: mehdi_amini Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26690 llvm-svn: 287084
* [AArch64] Add driver tests for Qualcomm's Falkor CPU.Chad Rosier2016-11-151-0/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D26674 llvm-svn: 287037
* Fix the unit test darwin-multiarch-arm.c for windowsSumanth Gundapaneni2016-11-141-1/+1
| | | | llvm-svn: 286842
* Revert r286735 due to test failureBrad Smith2016-11-131-23/+0
| | | | llvm-svn: 286736
* Link static PIE programs against rcrt0.o on OpenBSDBrad Smith2016-11-121-0/+23
| | | | | | Patch by Stefan Kempf. llvm-svn: 286735
* Tread TSan LLVM flags to driver: add TSan controlling flags to clang.Evgeniy Stepanov2016-11-111-0/+29
| | | | | | | | | | | | | | | | | | Summary: New clang flags, all default to true: -f[no-]sanitize-thread-data-races -f[no-]sanitize-thread-stack-traces -f[no-]sanitize-thread-atomics Reviewers: dvyukov, pcc, eugenis Subscribers: pcc, cfe-commits Patch by Alex Shlyapnikov. Differential Revision: https://reviews.llvm.org/D26461 llvm-svn: 286669
* [cfi] Enable cfi-icall on ARM and AArch64.Evgeniy Stepanov2016-11-111-0/+4
| | | | llvm-svn: 286613
* [test] Remove implicit deps on libLTO.dylib on Darwin (NFC)Vedant Kumar2016-11-101-5/+5
| | | | | | This un-breaks the `check-clang` target. llvm-svn: 286512
* clang-cl: Pass /Zc:threadSafeInit through to MSVC with /fallback (PR30948)Hans Wennborg2016-11-091-0/+6
| | | | llvm-svn: 286324
* Revert "Define __ANDROID_API__ for all Android builds."Stephen Hines2016-11-081-83/+0
| | | | | | | | | | Summary: This reverts commit a8804ddd9fe71304b28e5b834d134fe93e568ee0. Subscribers: cfe-commits, pirama, eugenis, tberghammer, danalbert Differential Revision: https://reviews.llvm.org/D26422 llvm-svn: 286298
* Define __ANDROID_API__ for all Android builds.Stephen Hines2016-11-081-0/+83
| | | | | | | | | | | | | | | | | | Summary: Bug: https://llvm.org/bugs/show_bug.cgi?id=30940 This macro (along with __ANDROID__) should always be defined for Android targets. We set it to the major (only) version of the Android API being compiled for. The Android version is able to be set as an integer suffix for any valid Android target. Reviewers: danalbert, eugenis Subscribers: cfe-commits, pirama, eugenis, tberghammer, danalbert Differential Revision: https://reviews.llvm.org/D26385 llvm-svn: 286295
* [SystemZ] Add -march=archX aliasesUlrich Weigand2016-10-311-0/+10
| | | | | | | | | | | | | | | For compatibility with other compilers on the platform, allow specifying levels of the z/Architecture instead of model names with -march. In particular, the following aliases are now supported: -march=arch8 equals -march=z10 -march=arch9 equals -march=z196 -march=arch10 equals -march=zEC12 -march=arch11 equals -march=z13 This parallels the equivalent (and prerequisite) LLVM change in r285577. llvm-svn: 285578
* Fix this test when we have clang-offload-bundler.exe.Rafael Espindola2016-10-311-10/+10
| | | | llvm-svn: 285561
* [Modules] Add a command line option for loading the clang builtins modulemap.Elad Cohen2016-10-311-0/+4
| | | | | | | | | -fbuiltin-module-map loads the clang builtins modulemap file. (This is equivalent to -fmodule-map-file=<resource dir>/include/module.modulemap) Differential Revision: https://reviews.llvm.org/D25767 llvm-svn: 285548
* clang/test/Driver/openmp-offload.c: Relax expressions if "ld.exe" exists, ↵NAKAMURA Takumi2016-10-301-18/+18
| | | | | | like mingw. llvm-svn: 285511
* Define extra variable in OpenMP offloading driver tests.Samuel Antao2016-10-281-5/+8
| | | | llvm-svn: 285408
* Change OpenMP offload driver tests so that it doesn't use the full file path ↵Samuel Antao2016-10-281-87/+197
| | | | | | | | during tests. This was causing failures on windows bots. llvm-svn: 285404
* [openmp] Remove test assumption that canonical binary name contains "clang"Benjamin Kramer2016-10-281-15/+15
| | | | | | | | Patch by Sam McCall! Differential Revision: https://reviews.llvm.org/D26067 llvm-svn: 285388
* Use -fopenmp=libomp in all OpenMP offloading tests.Samuel Antao2016-10-271-24/+20
| | | | | | This will make sure the right features are being tested even for machines that default to libgomp. llvm-svn: 285327
* [Driver][OpenMP] Add support to create jobs for unbundling actions.Samuel Antao2016-10-273-12/+101
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the support to create jobs for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool to unbundle input files. Unlike other actions, unbundling actions have multiple outputs. Therefore, this patch adds the required changes to have a variant of `Tool::ConstructJob` with multiple outputs. The way the naming of the results is implemented is also slightly modified so that the same action can use a different offloading prefix for each use by the different offloading actions. With this patch, it is possible to compile a functional OpenMP binary with offloading support, even with separate compilation. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21857 llvm-svn: 285326
* [Driver][OpenMP] Add support to create jobs for bundling actions.Samuel Antao2016-10-271-0/+34
| | | | | | | | | | | | Summary: This patch adds the support to create a job for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21856 llvm-svn: 285325
* [Driver][OpenMP] Update actions builder to create unbundling action when ↵Samuel Antao2016-10-271-0/+53
| | | | | | | | | | | | | | | | | necessary. Summary: Each time that offloading support is requested by the user and the input file is not a source file, an action `OffloadUnbundlingAction` is created to signal that the input file may contain bundles, so that the proper tool is then invoked to attempt to extract the components of the bundle. This patch adds the logic to create that action in offload action builder. The job creation for the new action will be proposed in a separate patch. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21853 llvm-svn: 285324
* [Driver][OpenMP] Update actions builder to create bundling action when ↵Samuel Antao2016-10-271-0/+28
| | | | | | | | | | | | | | | | | necessary. Summary: In order to save the user from dealing with multiple output files (for host and device) while using separate compilation, a new action `OffloadBundlingAction` is used when the last phase is not linking. This action will then result in a job that uses the proposed bundling tool to create a single preprocessed/IR/ASM/Object file from multiple ones. The job creation for the new action will be proposed in a separate patch. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21852 llvm-svn: 285323
* [Driver][OpenMP] Add logic for offloading-specific argument translation.Samuel Antao2016-10-271-6/+6
| | | | | | | | | | | | | | | Summary: This patch includes support for argument translation that is specific of a given offloading kind. Additionally, it implements the translation for OpenMP device kinds in the gcc tool chain. With this patch, it is possible to compile a functional OpenMP application with offloading capabilities with no separate compilation. Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21848 llvm-svn: 285320
* [Driver][OpenMP] Build jobs for OpenMP offloading actions for targets using ↵Samuel Antao2016-10-271-0/+101
| | | | | | | | | | | | | | | | | gcc tool chains. Summary: This patch adds logic to create jobs for OpenMP offloading actions by: - tuning the jobs result information to use the offloading prefix even for (device) linking actions. - replacing the device inputs of the host linking jobs by a linker script that embed them in the right sections. Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21847 llvm-svn: 285319
* [Driver][OpenMP] Add specialized action builder for OpenMP offloading actions.Samuel Antao2016-10-271-0/+138
| | | | | | | | | | | | | | | | | Summary: This patch adds a new specialized action builder to create OpenMP offloading actions. The specialized builder is added to the action builder already containing the CUDA specialized builder. OpenMP offloading dependences between host and device actions (expressed with OffloadActions) are different that what is used for CUDA: - Device compile action depends on the host compile action - the device frontend extracts the information about the declarations that have to be emitted by looking into the metadata produced by the host frontend. - The host link action depends on the device link actions - the device images are embedded in the host binary at link time. Reviewers: echristo, tra, rsmith, jlebar, ABataev, hfinkel Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21845 llvm-svn: 285314
* [Driver][OpenMP] Create tool chains for OpenMP offloading kind.Samuel Antao2016-10-271-0/+37
| | | | | | | | | | | | Summary: This patch adds new logic to create the necessary tool chains to support offloading for OpenMP. The OpenMP related options are checked and the tool chains created accordingly. Diagnostics are emitted in case the options are illegal or express unknown targets. Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel Subscribers: whchung, mkuron, mehdi_amini, cfe-commits, Hahnfeld, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21843 llvm-svn: 285311
* [Xray] Don't generate output for xray testsBenjamin Kramer2016-10-272-2/+2
| | | | | | | | Patch by Sam McCall! Differential Revision: http://reviews.llvm.org/D26024 llvm-svn: 285276
* [XRay] Check in Clang whether XRay supports the target when ↵Dean Michael Berris2016-10-273-0/+10
| | | | | | | | | | | | | | | -fxray-instrument is passed Summary: Added the code which explicitly emits an error in Clang in case `-fxray-instrument` is passed, but XRay is not supported for the selected target. Reviewers: rsmith, aaron.ballman, rnk, dberris Differential Revision: https://reviews.llvm.org/D24799 llvm-svn: 285266
* Remove check for -o option in offloading actions builder.Samuel Antao2016-10-271-0/+2
| | | | | | This check is also present when jobs are built, so the offloading builder check is not needed anymore. llvm-svn: 285264
* Fix bug when compiling CUDA code with -emit-llvm and -o. Samuel Antao2016-10-271-1/+3
| | | | | | | In this case the device code is not injected into an host action and therefore the user should get an error as -o can't be used when generating two outputs. llvm-svn: 285263
* Unconditionally pass `-lto_library` to the linker on DarwinMehdi Amini2016-10-261-3/+3
| | | | | | | | | | | We're only doing it with -flto currently, however it never "hurt" to pass it, and users that are linking without -flto can get in trouble if one of the dependency (a static library for instance) contains bitcode. Differential Revision: https://reviews.llvm.org/D25932 llvm-svn: 285254
* Use printf instead of "echo -ne".Rui Ueyama2016-10-261-1/+1
| | | | | | Not all echo commands support "-e". llvm-svn: 285162
* [Myriad] add empty file to simulated bin dirDouglas Katzman2016-10-251-0/+0
| | | | llvm-svn: 285144
* [Myriad] Find libc++ adjacent to libstdc++Douglas Katzman2016-10-251-2/+3
| | | | llvm-svn: 285140
* Use linker flag --fix-cortex-a53-843419 on Android ARM64 compilation.Stephen Hines2016-10-251-0/+17
| | | | | | | | | | | | | | | | Summary: This is only forced on if there is no non-Cortex-A53 CPU specified as well. Android's platform and NDK builds need to assume that the code can be run on Cortex-A53 devices, so we always enable the fix unless we know specifically that the code is only running on a different kind of CPU. Reviewers: cfe-commits Subscribers: aemerson, rengolin, tberghammer, pirama, danalbert Differential Revision: https://reviews.llvm.org/D25761 llvm-svn: 285127
* [Driver] Support obtaining active toolchain from gcc-config on GentooMichal Gorny2016-10-2510-0/+21
| | | | | | | | | | | Support using gcc-config to determine the correct GCC toolchain location on Gentoo. In order to do that, attempt to read gcc-config configuration form [[sysroot]]/etc/env.d/gcc, if no custom toolchain location is provided. Differential Revision: https://reviews.llvm.org/D25661 llvm-svn: 285074
* Fix myriad test with CLANG_DEFAULT_CXX_STDLIBJonas Hahnfeld2016-10-241-2/+2
| | | | llvm-svn: 284958
* [Driver][Darwin] Pass -no_deduplicate to ld64Bruno Cardoso Lopes2016-10-211-0/+46
| | | | | | | | | | Recent versions of ld64 run a deduplicate pass, which is on by default. Disable the pass by using -no_deduplicate in certain condition and enhance total compile time. rdar://problem/25455336 llvm-svn: 284798
* Revert 9 changes from r284793, they still fail on some botsReid Kleckner2016-10-201-0/+3
| | | | llvm-svn: 284794
* Remove 24 instances of 'REQUIRES: shell'Reid Kleckner2016-10-202-4/+1
| | | | | | | | | | | | | | | | | Tests fall into one of the following categories: - The requirement was unnecessary - Additional quoting was required for backslashes in paths (see "sed -e 's/\\/\\\\/g'") in the sanitizer tests. - OpenMP used 'REQUIRES: shell' as a proxy for the test failing on Windows. Those tests fail there reliably, so use XFAIL instead. I tried not to remove shell requirements that were added to suppress flaky test failures, but if I screwed up, we can add it back as needed. llvm-svn: 284793
* [clang-cl] Fix test that shouldn't be running on non-x86Renato Golin2016-10-201-1/+1
| | | | | | | | | | | | | | | | | The clang-cl test required x86-registered-target but it defaulted to the host's triple and AArch64 still doesn't support COFF, so the test failed. The triple was "aarch64-pc-windows-msvc18.0.0" with ObjectFormat equals llvm::Triple::COFF, failing assertion: Assertion `(TT.isOSBinFormatELF() || TT.isOSBinFormatMachO()) && "Only expect Darwin and ELF targets" in AArch64MCTargetDesc.cpp:78. Making the test only run on Windows hosts obviously fixes the problem. llvm-svn: 284749
* [Myriad] Find libc++ headers next to clang binaryDouglas Katzman2016-10-191-2/+5
| | | | llvm-svn: 284617
OpenPOWER on IntegriCloud