summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [ubsan] Have -fsanitize=vptr emit a null check if -fsanitize=null isn't ↵Vedant Kumar2017-08-024-19/+20
| | | | | | | | | | | | | | | | | | available In r309007, I made -fsanitize=null a hard prerequisite for -fsanitize=vptr. I did not see the need for the two checks to have separate null checking logic for the same pointer. I expected the two checks to either always be enabled together, or to be mutually compatible. In the mailing list discussion re: r309007 it became clear that that isn't the case. If a codebase is -fsanitize=vptr clean but not -fsanitize=null clean, it's useful to have -fsanitize=vptr emit its own null check. That's what this patch does: with it, -fsanitize=vptr can be used without -fsanitize=null. Differential Revision: https://reviews.llvm.org/D36112 llvm-svn: 309846
* Define _GNU_SOURCE for RTEMS c++Walter Lee2017-08-021-0/+1
| | | | | | | | | | | | Summary: This is required by the libc++ locale support. Reviewers: jyknight Subscribers: fedor.sergeev Differential Revision: https://reviews.llvm.org/D36121 llvm-svn: 309815
* [StaticAnalyzer] Fix false positives for unreachable code in macros.Daniel Marjamaki2017-08-021-0/+10
| | | | | | | | | | | | | Example: #define MACRO(C) if (C) { static int x; .. } void foo() { MACRO(0); } Differential Revision: https://reviews.llvm.org/D36141 llvm-svn: 309799
* [Bash-autocompletion] Add comment to test so that it is easier to fixYuka Takahashi2017-08-021-0/+4
| | | | | | | | | | | | | | | | Summary: clang/test/Driver/autocomplete.c is a test for --autocomplete, and this test might break if people add/modify flags or HelpText. So I've add comment for future developers so that they can fix this file according to the change they had made. Reviewers: v.g.vassilev, teemperor, ruiu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36209 llvm-svn: 309794
* [Driver] Disable static C++ library support on FuchsiaPetr Hosek2017-08-021-2/+2
| | | | | | | | Don't support or build static C++ libraries for Fuchsia. Differential Revision: https://reviews.llvm.org/D36202 llvm-svn: 309778
* [clang] Change the condition of unnecessary packed warningYan Wang2017-08-011-8/+85
| | | | | | | | | | | | | | | | | | | | Summary: Change the condition of this unnecessary packed warning. The packed is unnecessary when 1. the alignment of the struct/class won't alter. 2. the size is unchanged. 3. the offset of each field is the same. Remove all field-level warning. Reviewers: chh, akyrtzi, rtrieu Reviewed By: chh Subscribers: rsmith, srhines, cfe-commits, xazax.hun Differential Revision: https://reviews.llvm.org/D34114 llvm-svn: 309750
* Revert "Thread Safety Analysis: fix assert_capability."Josh Gao2017-08-011-9/+1
| | | | | | | | This reverts commit rL309725. Broke test/Sema/attr-capabilities.c. llvm-svn: 309731
* Thread Safety Analysis: fix assert_capability.Josh Gao2017-08-011-1/+9
| | | | | | | | | | | | | | | | Summary: Previously, the assert_capability attribute was completely ignored by thread safety analysis. Reviewers: delesley, rnk Reviewed By: delesley Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36122 llvm-svn: 309725
* [Sema] Fix lax conversion between non ext vectorsBruno Cardoso Lopes2017-08-011-0/+8
| | | | | | | | | | r282968 introduced a regression due to the lack of proper testing. Re-add lax conversion support between non ext vectors for compound assignments and add a test for that. rdar://problem/28639467 llvm-svn: 309722
* [OpenCL] Add missing subgroup builtinsJoey Gouly2017-08-012-0/+37
| | | | | | | This adds get_kernel_max_sub_group_size_for_ndrange and get_kernel_sub_group_count_for_ndrange. llvm-svn: 309678
* [x86][inline-asm]Allow a pack of Control Debug to be properly pickedCoby Tayree2017-08-011-0/+13
| | | | | | | | Allows the incorporation of legit (x86) Debug Regs within inline asm stataements Differential Revision: https://reviews.llvm.org/D36074 llvm-svn: 309672
* Use -target instead of -arch in test case.Akira Hatanaka2017-07-311-1/+1
| | | | llvm-svn: 309640
* Silence warning -Wmissing-sysroot.Akira Hatanaka2017-07-311-1/+1
| | | | llvm-svn: 309636
* Re-apply r309622 with a fix for MSVC.Peter Collingbourne2017-07-311-0/+15
| | | | | | Patch by Vlad Tsyrklevich! llvm-svn: 309635
* [Driver] Make sure the deployment target is earlier than iOS 11 whenAkira Hatanaka2017-07-311-0/+2
| | | | | | | | | | it is inferred from -isysroot. This fixes a change that was inadvertently introduced in r309607. rdar://problem/32230613 llvm-svn: 309633
* Revert r309622, "Fix logic for generating llvm.type.test()s"Peter Collingbourne2017-07-311-15/+0
| | | | | | | Caused a bot test failure: http://bb.pgr.jp/builders/test-clang-msc-x64-on-i686-linux-RA/builds/5325 llvm-svn: 309624
* Fix logic for generating llvm.type.test()sPeter Collingbourne2017-07-311-0/+15
| | | | | | | | | | | | | | CodeGenFunction::EmitTypeMetadataCodeForVCall() could output an llvm.assume(llvm.type.test())when CFI was enabled, optimizing out the vcall check. This case was only reached when: 1) CFI-vcall was enabled, 2) -fwhole-program-tables was specified, and 3) -fno-sanitize-trap=cfi-vcall was specified. Patch by Vlad Tsyrklevich! Differential Revision: https://reviews.llvm.org/D36013 llvm-svn: 309622
* [Attr] Make TargetWindows and TargetMicrosoftCXXABI match on aarch64 as wellMartin Storsjo2017-07-311-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D36100 llvm-svn: 309620
* [AArch64] Don't define __LP64__ when targeting WindowsMartin Storsjo2017-07-311-0/+161
| | | | | | | | | Windows/ARM64 is a LLP64 environment, so don't set this default define. Differential Revision: https://reviews.llvm.org/D36098 llvm-svn: 309619
* [test] Fix mistagged CHECK-NOT-lines for AARCH64-DARWIN in Preprocessor/init.cMartin Storsjo2017-07-311-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D36099 llvm-svn: 309618
* [X86] Remove -O3 from tbm-builtins.c test file.Craig Topper2017-07-311-49/+47
| | | | | | A change to InstCombine broke this test, but we generally frown on running optimizations clang tests anyway. So I've updated the checks to not depend on optimizations anymore. llvm-svn: 309616
* [Driver] Allow users to silence the warning that is issued when theAkira Hatanaka2017-07-311-0/+4
| | | | | | | | | | deployment target is earlier than iOS 11 and the target is 32-bit. This is a follow-up to r306922. rdar://problem/32230613 llvm-svn: 309607
* [OpenCL] Enable subgroup extension in testsJoey Gouly2017-07-312-2/+2
| | | | | | | This fixes the test, so that it can be run on different hosts that may have different OpenCL extensions enabled. llvm-svn: 309571
* Fix -Wshadow false positives with function-local classes.Alexander Kornienko2017-07-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes http://llvm.org/PR33947. https://godbolt.org/g/54XRMT void f(int a) { struct A { void g(int a) {} A() { int a; } }; } 3 : <source>:3:16: warning: declaration shadows a local variable [-Wshadow] void g(int a) {} ^ 1 : <source>:1:12: note: previous declaration is here void f(int a) { ^ 4 : <source>:4:15: warning: declaration shadows a local variable [-Wshadow] A() { int a; } ^ 1 : <source>:1:12: note: previous declaration is here void f(int a) { ^ 2 warnings generated. The local variable `a` of the function `f` can't be accessed from a method of the function-local class A, thus no shadowing occurs and no diagnostic is needed. Reviewers: rnk, rsmith, arphaman, Quuxplusone Reviewed By: rnk, Quuxplusone Subscribers: Quuxplusone, cfe-commits Differential Revision: https://reviews.llvm.org/D35941 llvm-svn: 309569
* [OpenCL] Add extension Sema check for subgroup builtinsJoey Gouly2017-07-313-0/+6
| | | | | | Check the subgroup extension is enabled, before doing other Sema checks. llvm-svn: 309567
* -Wpragma-pack: add an additional note and fixit when warningAlex Lorenz2017-07-313-2/+9
| | | | | | | | | about unterminated push directives that are followed by a reset ('#pragma pack()') This has been suggested by Hans Wennborg. llvm-svn: 309559
* [coroutines] Evaluate the operand of void `co_return` expressions.Eric Fiselier2017-07-311-0/+14
| | | | | | | | | | | | | | | | | Summary: Previously Clang incorrectly ignored the expression of a void `co_return`. This patch addresses that bug. I'm not quite sure if I got the code-gen right, but this patch is at least a start. Reviewers: rsmith, GorNishanov Reviewed By: rsmith, GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36070 llvm-svn: 309545
* [Sema] Fix operator lookup to consider local extern declarations.Eric Fiselier2017-07-311-0/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously Clang was not considering operator declarations that occur at function scope. This is incorrect according to [over.match.oper]p3 > The set of non-member candidates is the result of the unqualified lookup of operator@ in the context of the expression according to the usual rules for name lookup in unqualified function calls. This patch changes operator name lookup to consider block scope declarations. This patch fixes PR27027. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35297 llvm-svn: 309530
* Also pass -pie back to the linker when linking on OpenBSD.Brad Smith2017-07-301-1/+4
| | | | llvm-svn: 309523
* Fix a typo.Brad Smith2017-07-301-1/+1
| | | | llvm-svn: 309522
* [x86][inline-asm][ms-compat] legalize the use of "jc/jz short <op>"Coby Tayree2017-07-301-1/+3
| | | | | | | | | MS ignores the keyword "short" when used after a jc/jz instruction, LLVM ought to do the same. llvm: D35892 Differential Revision: https://reviews.llvm.org/D35893 llvm-svn: 309510
* [x86][inline-asm]Allow a pack of Control Regs to be properly pickedCoby Tayree2017-07-301-0/+11
| | | | | | | | Allows the incorporation of legit (x86) Control Regs within inline asm stataements Differential Revision: https://reviews.llvm.org/D35903 llvm-svn: 309508
* PR33902: Invalidate line number cache when adding more text to existing buffer.Richard Smith2017-07-301-0/+5
| | | | | | | | This led to crashes as the line number cache would report a bogus line number for a line of code, and we'd try to find a nonexistent column within the line when printing diagnostics. llvm-svn: 309503
* [X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer ↵Simon Pilgrim2017-07-291-27/+3
| | | | | | | | | | | | alignment (PR33830) Clang specifies a max type alignment of 16 bytes on darwin targets (annoyingly in the driver not via cc1), meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores. This patch casts the vectors to explicitly aligned types prior to the load/store to ensure that the require alignment is respected. Differential Revision: https://reviews.llvm.org/D35996 llvm-svn: 309488
* [test] FileCheck-ify a test to avoid a spurious failure, NFCVedant Kumar2017-07-291-1/+4
| | | | | | | The path to one of my source trees contains 'builtin' as a substring, so this test failed. Fix it with FileCheck. llvm-svn: 309460
* [ubsan] Diagnose invalid uses of builtins (clang)Vedant Kumar2017-07-292-9/+53
| | | | | | | | | | | | | | | On some targets, passing zero to the clz() or ctz() builtins has undefined behavior. I ran into this issue while debugging UB in __hash_table from libcxx: the bug I was seeing manifested itself differently under -O0 vs -Os, due to a UB call to clz() (see: libcxx/r304617). This patch introduces a check which can detect UB calls to builtins. llvm.org/PR26979 Differential Revision: https://reviews.llvm.org/D34590 llvm-svn: 309459
* Adopt to LLVM API change (llvm.dbg.value no longer has an offset)Adrian Prantl2017-07-281-1/+1
| | | | llvm-svn: 309427
* Recommit r308327 3rd time: Add a warning for missingAlex Lorenz2017-07-2812-19/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The second recommit (r309106) was reverted because the "non-default #pragma pack value chages the alignment of struct or union members in the included file" warning proved to be too aggressive for external projects like Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit makes the problematic warning a non-default one, and gives it the -Wpragma-pack-suspicious-include warning option. The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309386
* [X86] Add tests showing inability of vector non-temporal load/store ↵Simon Pilgrim2017-07-281-0/+117
| | | | | | | | intrinsic to force pointer alignment (PR33830) Clang specifies a max type alignment of 16 bytes on darwin targets, meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores. llvm-svn: 309382
* Update comment in test case after r309308.Akira Hatanaka2017-07-281-1/+1
| | | | llvm-svn: 309352
* [sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-tableKostya Serebryany2017-07-281-0/+4
| | | | llvm-svn: 309338
* [Headers] Add a test for arm64intr.hMartin Storsjo2017-07-271-0/+4
| | | | | | | | | This tests the ARM64 specific constants added in SVN r309081, similar to the one added in r277928 for armintr.h. Differential Revision: https://reviews.llvm.org/D35934 llvm-svn: 309314
* [OPENMP] Allow all lvalues in 'depend' clause.Alexey Bataev2017-07-2714-85/+85
| | | | | | | According to upcoming OpenMP 5.0 all addressable lvalue expressions are allowed in deoend clause. llvm-svn: 309309
* Revert r264998 and r265035.Akira Hatanaka2017-07-271-1/+1
| | | | | | | | | | r303175 made changes to have __cxa_allocate_exception return a 16-byte aligned pointer, so it's no longer necessary to specify a lower alignment (8-bytes) for exception objects on Darwin. rdar://problem/32363695 llvm-svn: 309308
* Fix double destruction of objects when OpenMP construct is canceledErich Keane2017-07-271-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an omp for loop is canceled the constructed objects are being destructed twice. It looks like the desired code is: { Obj o; If (cancelled) branch-through-cleanups to cancel.exit. } [cleanups] cancel.exit: __kmpc_for_static_fini br cancel.cont (*) cancel.cont: __kmpc_barrier return The problem seems to be the branch to cancel.cont is currently also going through the cleanups calling them again. This change just does a direct branch instead. Patch By: michael.p.rice@intel.com Differential Revision: https://reviews.llvm.org/D35854 llvm-svn: 309288
* [OPENMP] Codegen for 'in_reduction' clause.Alexey Bataev2017-07-273-0/+245
| | | | | | | | | | | | | | | | | | Added codegen for task-based directive with in_reduction clause. ``` <body> ``` The next code is emitted: ``` void *td; ... td = call i8* @__kmpc_task_reduction_init(); ... <type> *priv = (<type> *)call i8* @__kmpc_task_reduction_get_th_data(i32 GTID, i8* td, i8* <orig>) ``` llvm-svn: 309270
* [CodeGen][ARM] ARM runtime helper functions are not always soft-fpPeter Smith2017-07-272-2/+243
| | | | | | | Re-commit r309257 with less precise register checks in arm-float-helpers.c test. llvm-svn: 309263
* [CodeGen][ARM] Revert r309257Peter Smith2017-07-272-243/+2
| | | | | | | The test arm-float-helpers.c appears to be failing on some builders and needs some work to make it more robust. llvm-svn: 309259
* [CodeGen][ARM] ARM runtime helper functions are not always soft-fpPeter Smith2017-07-272-2/+243
| | | | | | | | | | | | | | | | | | | The ARM Runtime ABI document (IHI0043) defines the AEABI floating point helper functions in 4.1.2 The floating-point helper functions. These functions always use the base PCS (soft-fp). However helper functions defined outside of this document such as the complex-number multiply and divide helpers are not covered by this requirement and should use hard-float PCS if the target is hard-float as both compiler-rt and libgcc for a hard-float sysroot implement these functions with a hard-float PCS. All of the floating point helper functions that are explicitly soft float are expanded in the llvm ARM backend. This change makes clang not force the BuiltinCC to AAPCS for AAPCS_VFP. With this change the ARM compiler-rt tests involving _Complex pass with both hard-fp and soft-fp targets. Differential Revision: https://reviews.llvm.org/D35538 llvm-svn: 309257
* [PowerPC] Pass CPU to assembler with -no-integrated-asNemanja Ivanovic2017-07-272-1/+16
| | | | | | | | | This just adds the CPU to a list of commands passed to GAS when not using the integrated assembler. Differential Revision: https://reviews.llvm.org/D33820 llvm-svn: 309256
OpenPOWER on IntegriCloud