llvm-project/clang/test
Chris Lattner 7f4b81af7a fix rdar://8251384, another case where we could access beyond the
end of a struct.  This improves the case when the struct being passed
contains 3 floats, either due to a struct or array of 3 things.  Before
we'd generate this IR for the testcase:

define float @bar(double %X.coerce0, double %X.coerce1) nounwind {
entry:
  %X = alloca %struct.foof, align 8               ; <%struct.foof*> [#uses=2]
  %0 = bitcast %struct.foof* %X to %1*            ; <%1*> [#uses=2]
  %1 = getelementptr %1* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %X.coerce0, double* %1
  %2 = getelementptr %1* %0, i32 0, i32 1         ; <double*> [#uses=1]
  store double %X.coerce1, double* %2
  %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
  %tmp1 = load float* %tmp                        ; <float> [#uses=1]
  ret float %tmp1
}

which compiled (with optimization) to:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movd	%xmm1, %rax
	movd	%eax, %xmm0
	ret

Now we produce:

define float @bar(double %X.coerce0, float %X.coerce1) nounwind {
entry:
  %X = alloca %struct.foof, align 8               ; <%struct.foof*> [#uses=2]
  %0 = bitcast %struct.foof* %X to %0*            ; <%0*> [#uses=2]
  %1 = getelementptr %0* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %X.coerce0, double* %1
  %2 = getelementptr %0* %0, i32 0, i32 1         ; <float*> [#uses=1]
  store float %X.coerce1, float* %2
  %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
  %tmp1 = load float* %tmp                        ; <float> [#uses=1]
  ret float %tmp1
}

and:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movaps	%xmm1, %xmm0
	ret

llvm-svn: 109776
2010-07-29 18:13:09 +00:00
..
ASTMerge Hack in some really terrible C++ record PCH support that I need right now. 2010-06-03 19:28:45 +00:00
Analysis Move new test (that requires RegionStore) into its own file. 2010-07-29 07:11:59 +00:00
CXX Treat template parameters as part of the declaration-specifiers for the 2010-07-16 08:13:16 +00:00
CodeCompletion When performing code completion for a case statement in a switch whose 2010-07-28 21:50:18 +00:00
CodeGen fix rdar://8251384, another case where we could access beyond the 2010-07-29 18:13:09 +00:00
CodeGenCXX fix PR7742 / rdar://8250764, a miscompilation of struct 2010-07-29 17:04:54 +00:00
CodeGenObjC now that we have CGT around, we can start using preferred types 2010-07-29 04:46:19 +00:00
CodeGenObjCXX Support catching Objective C pointers in C++ under the non-fragile NeXT runtime. 2010-07-24 00:37:23 +00:00
Coverage Eliminate the "minimal" and printing parser actions, which only ever 2010-07-26 04:08:02 +00:00
Driver Driver/Darwin: Set -force_cpusubtype_ALL only by default on x86. 2010-07-22 01:47:22 +00:00
FixIt Introduce -f{no-}spell-checking options to enable/disable 2010-07-09 17:35:33 +00:00
Frontend Driver/Darwin: Resolve deployment target defaulting to be more predictable; 2010-07-15 16:18:06 +00:00
Headers Headers: Define __INT64_TYPE__ in terms of getInt64Type(), which isn't always 2010-06-30 06:30:56 +00:00
Index Visit the children of CXXOperatorCallExprs in source order within 2010-07-29 00:26:18 +00:00
Lexer tests: Make FileCheck version check that preamble isn't longer than we expected. 2010-07-22 02:22:24 +00:00
Misc tests: Use %clangxx when using driver for C++, in case C++ support is disabled. 2010-06-29 16:52:24 +00:00
PCH Support extended vector types in chained PCH. 2010-07-28 21:38:49 +00:00
Parser The grammar for GNU typeof in C requires an expression to be 2010-07-28 18:22:12 +00:00
Preprocessor Add another terrible VC++ compatibility hack: allow users to 2010-07-17 16:24:30 +00:00
Rewriter Initialize block's imported variable(s) in 2010-07-28 23:27:30 +00:00
Sema Allow a looser form of compatibility checking (which ignores 2010-07-29 15:18:02 +00:00
SemaCXX When deleting a value of class type, make sure that type is complete 2010-07-29 14:44:35 +00:00
SemaObjC Tigthen the condition for issung ivar shadowing 2010-07-29 16:53:53 +00:00
SemaObjCXX When taking the address of a value of Objective-C object type (e.g., 2010-07-29 16:05:45 +00:00
SemaTemplate Don't set out-of-line template specialization/definition information 2010-07-28 23:59:57 +00:00
CMakeLists.txt Add test cases for r98003 and r98006. 2010-03-08 23:38:27 +00:00
Makefile daniel doesn't hate me, he hates macpython 2.5, which 2010-07-18 18:42:35 +00:00
TestRunner.sh Switch TestRunner.sh to just use 'lit'. 2009-09-20 22:00:23 +00:00
cxx-sections.data Update C++ section data and directory structure to reflect N2914 2009-06-30 16:45:27 +00:00
lit.cfg tests: Use %clangxx when using driver for C++, in case C++ support is disabled. 2010-06-29 16:52:24 +00:00
lit.site.cfg.in Rework site config for cmake to be generated at configure time, and only pass 2009-11-07 23:53:32 +00:00
make_test_dirs.pl Add the structure for a C++ test suite that mimics the structure of the C++ standard 2009-06-13 06:06:53 +00:00