summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Move SanitizerInitializeUnwinder outside anonymous namespace.Matt Morehouse2019-10-021-32/+32
| | | | | | Fixes the Android build breakage introduced in r373528. llvm-svn: 373539
* [sanitizer_common] Declare __sanitizer_on_print in Windows interception.Matt Morehouse2019-10-021-0/+1
| | | | | | Speculative fix for Windows bot. llvm-svn: 373532
* [sanitizer_common] Disable onprint.cpp on Android.Matt Morehouse2019-10-021-0/+2
| | | | | | The test fails to find the written file on Android. llvm-svn: 373531
* [sanitizer_common] Add __sanitizer_on_print to interface list.Matt Morehouse2019-10-021-0/+1
| | | | | | Should fix the current Windows buildbot failure. llvm-svn: 373530
* [compiler-rt] Use GetNextInstructionPc in signal handlersVitaly Buka2019-10-026-6/+44
| | | | | | | | | | | | | | | | | | Summary: All other stack trace callers assume that PC contains return address. HWAsan already use GetNextInstructionPc in similar code. PR43339 Reviewers: eugenis, kcc, jfb Subscribers: dexonsmith, dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68313 llvm-svn: 373529
* NFC: add namespace {}Vitaly Buka2019-10-021-0/+4
| | | | llvm-svn: 373528
* [sanitizer_common] Rename OnPrint to __sanitizer_on_print.Matt Morehouse2019-10-022-1/+38
| | | | | | | | | | | | | | | | | | Summary: https://reviews.llvm.org/D28596 exposed OnPrint in the global namespace, which can cause collisions with user-defined OnPrint() functions. Reviewers: vitalybuka, dvyukov Reviewed By: vitalybuka, dvyukov Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67987 llvm-svn: 373518
* [CMake] Fix the value of `config.target_cflags` for non-macOS Apple ↵Dan Liew2019-10-015-50/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platforms. Attempt #3. The main problem here is that `-*-version_min=` was not being passed to the compiler when building test cases. This can cause problems when testing on devices running older OSs because Clang would previously assume the minimum deployment target is the the latest OS in the SDK which could be much newer than what the device is running. Previously the generated value looked like this: `-arch arm64 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` With this change it now looks like: `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` This mirrors the setting of config.target_cflags on macOS. This change is made for ASan, LibFuzzer, TSan, and UBSan. To implement this a new `get_test_cflags_for_apple_platform()` function has been added that when given an Apple platform name and architecture returns a string containing the C compiler flags to use when building tests. This also calls a new helper function `is_valid_apple_platform()` that validates Apple platform names. This is the third attempt at landing the patch. The first attempt (r359305) had to be reverted (r359327) due to a buildbot failure. The problem was that calling `get_test_cflags_for_apple_platform()` can trigger a CMake error if the provided architecture is not supported by the current CMake configuration. Previously, this could be triggered by passing `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were generating test configurations for a list of architectures without checking if the relevant Sanitizer actually supported that architecture. We now intersect the list of architectures for an Apple platform with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer name) to iterate through the correct list of architectures. The second attempt (r363633) had to be reverted (r363779) due to a build failure. The failed build was using a modified Apple toolchain where the iOS simulator SDK was missing. This exposed a bug in the existing UBSan test generation code where it was assumed that `COMPILER_RT_ENABLE_IOS` implied that the toolchain supported both iOS and the iOS simulator. This is not true. This has been fixed by using the list `SANITIZER_COMMON_SUPPORTED_OS` for the list of supported Apple platforms for UBSan. For consistency with the other Sanitizers we also now intersect the list of architectures with UBSAN_SUPPORTED_ARCH. rdar://problem/50124489 Differential Revision: https://reviews.llvm.org/D61242 llvm-svn: 373405
* [libFuzzer] Remove lazy counters.Matt Morehouse2019-10-0111-70/+0
| | | | | | | | | | | | | | | | Summary: Lazy counters haven't improved performance for large fuzz targets. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67476 llvm-svn: 373403
* Revert "compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM"Vitaly Buka2019-10-016-37/+21
| | | | | | | | | | | Revert "compiler-rt: move all __GLIBC_PREREQ into own header file" "move all __GLIBC_PREREQ" breaks build on some bots This reverts commit 2d75ee937397c209dbd95aefc88da6301fed07da. This reverts commit 7a6461fcc2ed8e28c43993c561721af0bbe97f3a. llvm-svn: 373367
* compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOMVitaly Buka2019-10-011-2/+2
| | | | | | | | | | | | | | Summary: Fixes https://github.com/google/oss-fuzz/issues/2836 Reviewers: eugenis Subscribers: dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68178 llvm-svn: 373284
* compiler-rt: move all __GLIBC_PREREQ into own header fileVitaly Buka2019-10-015-19/+35
| | | | | | | | | | | | Reviewers: eugenis Subscribers: dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68177 llvm-svn: 373283
* Rename tsan_interceptors.cpp into tsan_interceptors_posix.cppVitaly Buka2019-10-013-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: It's needed to use __GLIBC_PREREQ from <features.h> tsan didn't let us to include <features.h> by using --sysroot=. to disable system includes on anything that is not named as "tsan*posix*", "tsan*mac*", "tsan*linux*". See compiler-rt/lib/tsan/CMakeLists.txt Reviewers: eugenis, dvyukov, kcc Reviewed By: kcc Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68176 llvm-svn: 373282
* [msan] Intercept __getrlimit.Evgeniy Stepanov2019-09-302-7/+33
| | | | | | | | | | | | | | | | | | | | Summary: This interceptor is useful on its own, but the main purpose of this change is to intercept libpthread initialization on linux/glibc in order to run __msan_init before any .preinit_array constructors. We used to trigger on pthread_initialize_minimal -> getrlimit(), but that call has changed to __getrlimit at some point. Reviewers: vitalybuka, pcc Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68168 llvm-svn: 373239
* [libFuzzer] Dump trace and provide correct msg for overwritten input.Mitch Phillips2019-09-271-1/+3
| | | | | | | | | | | | | | | | | | Summary: Now crashes with a stacktrace and uses 'overwrites-const-input' as the error message instead of 'out-of-memory'. Reviewers: morehouse, Dor1s Reviewed By: morehouse, Dor1s Subscribers: #sanitizers, llvm-commits, metzman, Dor1s Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68067 llvm-svn: 373130
* Revert "[profile] Add a test dependency on cxx-headers"Vedant Kumar2019-09-271-1/+1
| | | | | | | | | | This reverts commit b539350f7d006b7d6f42c5c4b5715da87a52e5d8. See: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52140/steps/annotate/logs/stdio The cxx-headers target doesn't exist everywhere. llvm-svn: 373123
* [profile] Mark instrprof-gcov-fork.test UNSUPPORTED on Darwin as wellVedant Kumar2019-09-271-0/+1
| | | | | | | | | | This test remains flaky everywhere, I think. We should consider deleting it and accompanying support code in GCOVProfiling: I've stopped short of doing that now as the gcov exec* tests appear to be stable. See the thread re: r347779. llvm-svn: 373121
* [profile] Add a test dependency on cxx-headersVedant Kumar2019-09-271-1/+1
| | | | | | | This enables running profile runtime tests which #include <string>, etc. via just `check-profile`. llvm-svn: 373120
* hwasan: Compatibility fixes for short granules.Peter Collingbourne2019-09-273-5/+58
| | | | | | | | | | | | | | | | | | | | | | | | | We can't use short granules with stack instrumentation when targeting older API levels because the rest of the system won't understand the short granule tags stored in shadow memory. Moreover, we need to be able to let old binaries (which won't understand short granule tags) run on a new system that supports short granule tags. Such binaries will call the __hwasan_tag_mismatch function when their outlined checks fail. We can compensate for the binary's lack of support for short granules by implementing the short granule part of the check in the __hwasan_tag_mismatch function. Unfortunately we can't do anything about inline checks, but I don't believe that we can generate these by default on aarch64, nor did we do so when the ABI was fixed. A new function, __hwasan_tag_mismatch_v2, is introduced that lets code targeting the new runtime avoid redoing the short granule check. Because tag mismatches are rare this isn't important from a performance perspective; the main benefit is that it introduces a symbol dependency that prevents binaries targeting the new runtime from running on older (i.e. incompatible) runtimes. Differential Revision: https://reviews.llvm.org/D68059 llvm-svn: 373035
* [libFuzzer] [NFC] Fix grammar error with "it's"Mitch Phillips2019-09-262-2/+2
| | | | llvm-svn: 372937
* builtins test: Move clear_cache_test.c from a mprotect()ed global to a ↵Nico Weber2019-09-251-28/+21
| | | | | | | | | | | | | | | | | | mmap()ed variable ld64 in the macOS 10.15 SDK gives __DATA a maxprot of 3, meaning it can't be made executable at runtime by default. Change clear_cache_test.c to use mmap()ed data that's mapped as writable and executable from the beginning, instead of trying to mprotect()ing a __DATA variable as executable. This fixes the test on macOS with the 10.15 SDK. PR43407. Differential Revision: https://reviews.llvm.org/D67929 llvm-svn: 372849
* [NFC] Invoke lipo from CMAKE_LIPO.Puyan Lotfi2019-09-241-1/+3
| | | | | | | This shouldn't change anything, except that a cmake cache file that specifies CMAKE_LIPO can specify an alternate lipo to use. llvm-svn: 372790
* [TSAN] Add read/write range interface functions with PCJoachim Protze2019-09-243-0/+53
| | | | | | | | | | Adding annotation function variants __tsan_write_range_pc and __tsan_read_range_pc to annotate ranged access to memory while providing a program counter for the access. Differential Revision: https://reviews.llvm.org/D66885 llvm-svn: 372730
* sanitizer_common: fix freebsd build errorDmitry Vyukov2019-09-241-1/+0
| | | | | | | | Variable flags is not used. Remove it. Suggested-by: randall77 (Keith Randall) Review: https://reviews.llvm.org/D67928 llvm-svn: 372698
* Fix int to bool errors exposed due to r372612.Rumeet Dhindsa2019-09-243-4/+4
| | | | | | | | | Differential Revision: https://reviews.llvm.org/D67937 M lib/builtins/fp_add_impl.inc M lib/builtins/fp_lib.h M lib/builtins/fp_trunc_impl.inc llvm-svn: 372684
* [llvm-cov] NFC: Specify a specific C++ standard in the test.Artem Dergachev2019-09-241-3/+6
| | | | | | Makes life easier for downstream users with customized default standard. llvm-svn: 372674
* [compiler-rt] Fix lint check failure on commentsJinsong Ji2019-09-222-2/+4
| | | | | | | | | This fixes buildbot failures for https://reviews.llvm.org/rL372459. (at least on PowerPC/Z ) The fix is generated by running clang-format on the error lines only. llvm-svn: 372511
* Add __lsan::ScopedInterceptorDisabler for strerror(3)Kamil Rytarowski2019-09-213-0/+23
| | | | | | | | | | | | | | | | | | | | Summary: strerror(3) on NetBSD uses internally TSD with a destructor that is never fired for exit(3). It's correctly called for pthread_exit(3) scenarios. This is a case when a leak on exit(3) is expected, unavoidable and harmless. Reviewers: joerg, vitalybuka, dvyukov, mgorny Reviewed By: vitalybuka Subscribers: dmgreen, kristof.beyls, jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67337 llvm-svn: 372461
* Avoid memory leak in ASan testKamil Rytarowski2019-09-211-0/+1
| | | | | | | | | | | | | | | | | | | Summary: Add missing free(3) for the malloc(3) call. Detected on NetBSD with LSan. Reviewers: joerg, mgorny, vitalybuka, dvyukov Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67330 llvm-svn: 372460
* Stop tracking atexit/__cxa_atexit/pthread_atfork allocations in LSan/NetBSDKamil Rytarowski2019-09-214-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The atexit(3) and __cxa_atexit() calls allocate internally memory and free on exit, after executing all callback. This causes false positives as DoLeakCheck() is called from the atexit handler. In the LSan/ASan tests there are strict checks triggering false positives here. Intercept all atexit(3) and __cxa_atexit() calls and disable LSan when calling the real functions. Stop tracing allocations in pthread_atfork(3) funtions, as there are performed internal allocations that are not freed for the time of running StopTheWorld() code. This avoids false-positives. The same changes have to be replicated in the ASan and LSan runtime. Non-NetBSD OSs are not tested and this code is restricted to NetBSD only. Reviewers: dvyukov, joerg, mgorny, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67331 llvm-svn: 372459
* [lsan] Fix deadlock in dl_iterate_phdr.Evgeniy Stepanov2019-09-195-12/+69
| | | | | | | | | | | | | | | | | Summary: Do not grab the allocator lock before calling dl_iterate_phdr. This may cause a lock order inversion with (valid) user code that uses malloc inside a dl_iterate_phdr callback. Reviewers: vitalybuka, hctim Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67738 llvm-svn: 372348
* [cmake] Strip quotes in try_compile_onlyHans Wennborg2019-09-191-0/+6
| | | | | | | | | | | | | | | | | After r372209, the compile command can end up including an argument with quotes in it, e.g. -fprofile-instr-use="/foo/bar.profdata" when invoking the compiler with execute_process, the compiler ends up getting that argument with quotes and all, and fails to open the file. This all seems horribly broken, but one way of working around it is to simply strip the quotes from the string here. If they were there to protect a path that's got spaces in it, that wasn't going to work anyway because the string is later split by spaces. llvm-svn: 372312
* tsan: allow the Go runtime to return multiple stack frames for a single PCDmitry Vyukov2019-09-181-7/+18
| | | | | | | | | | | This fix allows tsan to report stack traces correctly even in the presence of mid-stack inlining by the Go compiler. See https://go-review.googlesource.com/c/go/+/195781 for the Go runtime side of this change. Author: randall77 (Keith Randall) Reviewed: https://reviews.llvm.org/D67671 llvm-svn: 372205
* Remove asan test for strncat(x, y, 0)David Bolvansky2019-09-171-3/+1
| | | | llvm-svn: 372143
* [ASAN] Adjust asan tests due to new optimizationsDavid Bolvansky2019-09-171-1/+1
| | | | llvm-svn: 372141
* [libFuzzer] Always print DSO map on Fuchsia libFuzzer launchJake Ehrlich2019-09-172-0/+12
| | | | | | | | | | | | | | | | Fuchsia doesn't have /proc/id/maps, so it relies on the kernel logging system to provide the DSO map to be able to symbolize in the context of ASLR. The DSO map is logged automatically on Fuchsia when encountering a crash or writing to the sanitizer log for the first time in a process. There are several cases where libFuzzer doesn't encounter a crash, e.g. on timeouts, OOMs, and when configured to print new PCs as they become covered, to name a few. Therefore, this change always writes to the sanitizer log on startup to ensure the DSO map is available in the log. Author: aarongreen Differential Revision: https://reviews.llvm.org/D66233 llvm-svn: 372056
* [test] Clean up previous raw profile before merging into itVedant Kumar2019-09-161-1/+1
| | | | | | | This fixes a test failure in instrprof-set-file-object-merging.c which seems to have been caused by reuse of stale data in old raw profiles. llvm-svn: 372041
* [compiler-rt][crt] make test case nontrivial in check_cxx_section_existsJian Cai2019-09-161-1/+1
| | | | | | | | | | | | | | | | | | Summary: .init_array gets optimized away when building with -O2 and as a result, check_cxx_section_exists failed to pass -DCOMPILER_RT_HAS_INITFINI_ARRAY when building crtbegin.o and crtend.o, which causes binaries linked with them encounter segmentation fault. See https://crbug.com/855759 for details. This change prevents .init_array section to be optimized away even with -O2 or higher optimization level. Subscribers: dberris, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67628 llvm-svn: 372038
* [libFuzzer] Remove unused version of FuzzedDataProvider.h.Max Moroz2019-09-161-247/+0
| | | | | | | | | | | | | | | | Summary: The actual version lives in compiler-rt/include/fuzzer/. Reviewers: Dor1s Reviewed By: Dor1s Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67623 llvm-svn: 371997
* Commit missing part of "Split many_tls_keys.cpp into two tests"Kamil Rytarowski2019-09-152-28/+8
| | | | | | | | https://reviews.llvm.org/D67428 This change was lost due to a file rename and modification. llvm-svn: 371941
* compiler-rt/builtins: Make check-builtins run tests on macOS.Nico Weber2019-09-142-4/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D66984 llvm-svn: 371926
* Fix bug in `darwin_test_archs()` when the cache variable is set but empty.Dan Liew2019-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: If the cache variable named in `${valid_archs}` (e.g. `DARWIN_osx_BUILTIN_ARCHS`) is set in the cache but is empty then the cache check `if(${valid_archs})` will be false so the function will probe the compiler but the `set(...)` command at the end of the function to update the cache variable will be a no-op. This is because `set(...)` will not update an existing cache variable unless the `FORCE` argument is provided. To fix this this patch adds `FORCE` so the cache is always updated. rdar://problem/55323665 Reviewers: vsk, kubamracek Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67530 llvm-svn: 371872
* [CMake] Separate the detection Darwin platforms architectures for theDan Liew2019-09-132-31/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | built-ins from the rest of compiler-rt. The detection of supported platform (os) architectures for Darwin relies on the `darwin_test_archs()` CMake function. This is used both for building the builtins (`builtin-config-ix.cmake`) and for the rest of the compiler-rt (`config-ix.cmake`). `darwin_test_archs()` implements a cache, presumably to speed up CMake re-configures. Unfortunately this caching is buggy because it depends on external global state (i.e. the `TEST_COMPILE_ONLY` variable) and this is not taken into account. For `config-ix.cmake` `TEST_COMPILE_ONLY` is not set and for `builtin-config-ix.cmake` `TEST_COMPILE_ONLY` is set to `On`. This makes the `darwin_test_archs()` function racey in the sense that a call from one calling context will poison the cache for the other calling context. This is actually an issue George Karpenkov discovered a while back and had an incomplete patch for (https://reviews.llvm.org/D45337) but this was never merged. To workaround this, this patch switches to using a different set of variables for the platform architecture builtins, i.e. `DARWIN_<OS>_ARCHS` -> `DARWIN_<OS>_BUILTIN_ARCHS`. This avoids the cache poisoning problem because the cached variable names are different. This also has the advantage that the the configured architectures for builtins and the rest of the compiler-rt are now independent and can be set differently if necessary. Note in `darwin_test_archs()` we also now pass `-w` to the compiler because `try_compile_only()` treats compiler warnings as errors. This was extremely fragile because compiler warnings (can easily appear due to a buggy compiler or SDK headers) would cause compiler-rt to think an architecture on Darwin wasn't supported. rdar://problem/48637491 llvm-svn: 371871
* [compiler-rt] Add ubsan interface header.Pierre Gousseau2019-09-132-0/+33
| | | | | | | | | | This is to document __ubsan_default_options(). Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D67503 llvm-svn: 371822
* Add getauxval() compat for NetBSDKamil Rytarowski2019-09-122-3/+21
| | | | | | | | | | | | | | | | | | | | | | | Summary: getauxval() is not available on NetBSD and there is no a direct equivalent. Add a function that implements the same semantics with NetBSD internals. Reorder the GetPageSize() functions to prefer the sysctl approach for NetBSD. It no longer makes a difference which approach is better. Avoid changing conditional code path. Reviewers: vitalybuka, dvyukov, mgorny, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67329 llvm-svn: 371758
* Split many_tls_keys.cpp into two testsKamil Rytarowski2019-09-122-0/+61
| | | | | | | | | | | | | | | | | | | | | Summary: many_tls_keys_pthread.cpp for TSD many_tls_keys_thread.cpp for TLS The TSD test is unsupported on NetBSD as it assumes TLS used internally. TSD on NetBSD does not use TLS. Reviewers: joerg, vitalybuka, mgorny, dvyukov, kcc Reviewed By: vitalybuka Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67428 llvm-svn: 371757
* Use host's executable suffix for clang when cross-compiling compiler-rtReid Kleckner2019-09-121-2/+12
| | | | | | | | | | | | | | | | | | | | | When cross-compiling compiler-rt as part of LLVM e. g. for Linux on a Windows host and using the just-built clang as cross-compiler, we set the -DBUILTINS_CMAKE_ARGS="-DCMAKE_SYSTEM_NAME=Linux" flag in top-level cmake invocation, which causes CMAKE_EXECUTABLE_SUFFIX to be an empty string in the nested cmake invocation for building builtins. But the compiler for compiling test cases is meant to be run on host, therefore it may have the '.exe' suffix. Handle this by asking cmake about the host system. Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com> Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D67401 llvm-svn: 371754
* [compiler-rt] cpplint of inc files in backgroundVitaly Buka2019-09-121-0/+2
| | | | llvm-svn: 371705
* [compiler-rt] Remove some cpplint filtersVitaly Buka2019-09-1222-63/+77
| | | | llvm-svn: 371704
* [compiler-rt] Run cpplint only for check-sanitizerVitaly Buka2019-09-122-3/+5
| | | | llvm-svn: 371703
OpenPOWER on IntegriCloud