<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 26, 2016 at 5:57 PM, Kostya Serebryany via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Looks like yours: <div><pre style="font-family:"courier new",courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span>FAILED: tools/clang/lib/CodeGen/<wbr>CMakeFiles/clangCodeGen.dir/<wbr>CGExpr.cpp.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\<wbr>AMD64_~1\cl.exe /nologo /TP -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\clang\lib\CodeGen -IC:\b\slave\sanitizer-<wbr>windows\llvm\tools\clang\lib\<wbr>CodeGen -IC:\b\slave\sanitizer-<wbr>windows\llvm\tools\clang\<wbr>include -Itools\clang\include -Iinclude -IC:\b\slave\sanitizer-<wbr>windows\llvm\include /DWIN32 /D_WINDOWS /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -UNDEBUG /EHs-c- /GR- /showIncludes /Fotools\clang\lib\CodeGen\<wbr>CMakeFiles\clangCodeGen.dir\<wbr>CGExpr.cpp.obj /Fdtools\clang\lib\CodeGen\<wbr>CMakeFiles\clangCodeGen.dir\ /FS -c C:\b\slave\sanitizer-windows\<wbr>llvm\tools\clang\lib\CodeGen\<wbr>CGExpr.cpp
C:\b\slave\sanitizer-windows\<wbr>llvm\tools\clang\lib\CodeGen\<wbr>CGExpr.cpp(2900) : error C3486: a parameter for a lambda cannot have a default argument
ninja: build stopped: subcommand failed.
</span><span style="color:blue">program finished with exit code 1</span></pre></div></div></blockquote><div>Hah, oops, I remembered that old MSVC had this issue and avoided *using* the default argument, but then forgot to actually remove it from the code. Fixed in r282464.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 26, 2016 at 4:49 PM, Richard Smith via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: rsmith<br>
Date: Mon Sep 26 18:49:47 2016<br>
New Revision: 282453<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=282453&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=282453&view=rev</a><br>
Log:<br>
P0145R3 (C++17 evaluation order tweaks): consistently emit the LHS of array<br>
subscripting before the RHS, regardless of which is the base and which is the<br>
index.<br>
<br>
Added:<br>
cfe/trunk/test/CodeGenCXX/cxx1<wbr>z-eval-order.cpp<br>
Modified:<br>
cfe/trunk/lib/CodeGen/CGExpr.c<wbr>pp<br>
cfe/trunk/test/CodeGen/capture<wbr>d-statements-nested.c<br>
cfe/trunk/test/CodeGenCXX/catc<wbr>h-undef-behavior.cpp<br>
cfe/trunk/test/CodeGenCXX/cxx1<wbr>y-initializer-aggregate.cpp<br>
cfe/trunk/test/CodeGenCXX/prag<wbr>ma-loop-safety.cpp<br>
cfe/trunk/test/CodeGenCXX/vla-<wbr>lambda-capturing.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGExpr.c<wbr>pp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=282453&r1=282452&r2=282453&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/lib/CodeGen/CG<wbr>Expr.cpp?rev=282453&r1=282452&<wbr>r2=282453&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/CodeGen/CGExpr.c<wbr>pp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGExpr.c<wbr>pp Mon Sep 26 18:49:47 2016<br>
@@ -2875,13 +2875,30 @@ static Address emitArraySubscriptGEP(Cod<br>
<br>
LValue CodeGenFunction::EmitArraySubs<wbr>criptExpr(const ArraySubscriptExpr *E,<br>
bool Accessed) {<br>
- // The index must always be an integer, which is not an aggregate. Emit it.<br>
- llvm::Value *Idx = EmitScalarExpr(E->getIdx());<br>
- QualType IdxTy = E->getIdx()->getType();<br>
- bool IdxSigned = IdxTy->isSignedIntegerOrEnumer<wbr>ationType();<br>
+ // The index must always be an integer, which is not an aggregate. Emit it<br>
+ // in lexical order (this complexity is, sadly, required by C++17).<br>
+ llvm::Value *IdxPre =<br>
+ (E->getLHS() == E->getIdx()) ? EmitScalarExpr(E->getIdx()) : nullptr;<br>
+ auto EmitIdxAfterBase = [&, IdxPre](bool Promote = true) -> llvm::Value * {<br>
+ auto *Idx = IdxPre;<br>
+ if (E->getLHS() != E->getIdx()) {<br>
+ assert(E->getRHS() == E->getIdx() && "index was neither LHS nor RHS");<br>
+ Idx = EmitScalarExpr(E->getIdx());<br>
+ }<br>
+<br>
+ QualType IdxTy = E->getIdx()->getType();<br>
+ bool IdxSigned = IdxTy->isSignedIntegerOrEnumer<wbr>ationType();<br>
+<br>
+ if (SanOpts.has(SanitizerKind::Ar<wbr>rayBounds))<br>
+ EmitBoundsCheck(E, E->getBase(), Idx, IdxTy, Accessed);<br>
<br>
- if (SanOpts.has(SanitizerKind::Ar<wbr>rayBounds))<br>
- EmitBoundsCheck(E, E->getBase(), Idx, IdxTy, Accessed);<br>
+ // Extend or truncate the index type to 32 or 64-bits.<br>
+ if (Promote && Idx->getType() != IntPtrTy)<br>
+ Idx = Builder.CreateIntCast(Idx, IntPtrTy, IdxSigned, "idxprom");<br>
+<br>
+ return Idx;<br>
+ };<br>
+ IdxPre = nullptr;<br>
<br>
// If the base is a vector type, then we are forming a vector element lvalue<br>
// with this subscript.<br>
@@ -2889,6 +2906,7 @@ LValue CodeGenFunction::EmitArraySubs<wbr>cri<br>
!isa<ExtVectorElementExpr>(E-<wbr>>getBase())) {<br>
// Emit the vector as an lvalue to get its address.<br>
LValue LHS = EmitLValue(E->getBase());<br>
+ auto *Idx = EmitIdxAfterBase(/*Promote*/fa<wbr>lse);<br>
assert(LHS.isSimple() && "Can only subscript lvalue vectors here!");<br>
return LValue::MakeVectorElt(LHS.getA<wbr>ddress(), Idx,<br>
E->getBase()->getType(),<br>
@@ -2897,13 +2915,10 @@ LValue CodeGenFunction::EmitArraySubs<wbr>cri<br>
<br>
// All the other cases basically behave like simple offsetting.<br>
<br>
- // Extend or truncate the index type to 32 or 64-bits.<br>
- if (Idx->getType() != IntPtrTy)<br>
- Idx = Builder.CreateIntCast(Idx, IntPtrTy, IdxSigned, "idxprom");<br>
-<br>
// Handle the extvector case we ignored above.<br>
if (isa<ExtVectorElementExpr>(E-><wbr>getBase())) {<br>
LValue LV = EmitLValue(E->getBase());<br>
+ auto *Idx = EmitIdxAfterBase(/*Promote*/tr<wbr>ue);<br>
Address Addr = EmitExtVectorElementLValue(LV)<wbr>;<br>
<br>
QualType EltType = LV.getType()->castAs<VectorTyp<wbr>e>()->getElementType();<br>
@@ -2919,6 +2934,7 @@ LValue CodeGenFunction::EmitArraySubs<wbr>cri<br>
// it. It needs to be emitted first in case it's what captures<br>
// the VLA bounds.<br>
Addr = EmitPointerWithAlignment(E->ge<wbr>tBase(), &AlignSource);<br>
+ auto *Idx = EmitIdxAfterBase(/*Promote*/tr<wbr>ue);<br>
<br>
// The element count here is the total number of non-VLA elements.<br>
llvm::Value *numElements = getVLASize(vla).first;<br>
@@ -2938,14 +2954,16 @@ LValue CodeGenFunction::EmitArraySubs<wbr>cri<br>
<br>
} else if (const ObjCObjectType *OIT = E->getType()->getAs<ObjCObject<wbr>Type>()){<br>
// Indexing over an interface, as in "NSString *P; P[4];"<br>
- CharUnits InterfaceSize = getContext().getTypeSizeInChar<wbr>s(OIT);<br>
- llvm::Value *InterfaceSizeVal =<br>
- llvm::ConstantInt::get(Idx->ge<wbr>tType(), InterfaceSize.getQuantity());;<br>
-<br>
- llvm::Value *ScaledIdx = Builder.CreateMul(Idx, InterfaceSizeVal);<br>
<br>
// Emit the base pointer.<br>
Addr = EmitPointerWithAlignment(E->ge<wbr>tBase(), &AlignSource);<br>
+ auto *Idx = EmitIdxAfterBase(/*Promote*/tr<wbr>ue);<br>
+<br>
+ CharUnits InterfaceSize = getContext().getTypeSizeInChar<wbr>s(OIT);<br>
+ llvm::Value *InterfaceSizeVal =<br>
+ llvm::ConstantInt::get(Idx->ge<wbr>tType(), InterfaceSize.getQuantity());<br>
+<br>
+ llvm::Value *ScaledIdx = Builder.CreateMul(Idx, InterfaceSizeVal);<br>
<br>
// We don't necessarily build correct LLVM struct types for ObjC<br>
// interfaces, so we can't rely on GEP to do this scaling<br>
@@ -2977,6 +2995,7 @@ LValue CodeGenFunction::EmitArraySubs<wbr>cri<br>
ArrayLV = EmitArraySubscriptExpr(ASE, /*Accessed*/ true);<br>
else<br>
ArrayLV = EmitLValue(Array);<br>
+ auto *Idx = EmitIdxAfterBase(/*Promote*/tr<wbr>ue);<br>
<br>
// Propagate the alignment from the array itself to the result.<br>
Addr = emitArraySubscriptGEP(*this, ArrayLV.getAddress(),<br>
@@ -2987,6 +3006,7 @@ LValue CodeGenFunction::EmitArraySubs<wbr>cri<br>
} else {<br>
// The base must be a pointer; emit it with an estimate of its alignment.<br>
Addr = EmitPointerWithAlignment(E->ge<wbr>tBase(), &AlignSource);<br>
+ auto *Idx = EmitIdxAfterBase(/*Promote*/tr<wbr>ue);<br>
Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(),<br>
!getLangOpts().isSignedOverflo<wbr>wDefined());<br>
}<br>
<br>
Modified: cfe/trunk/test/CodeGen/capture<wbr>d-statements-nested.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/captured-statements-nested.c?rev=282453&r1=282452&r2=282453&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CodeGen/<wbr>captured-statements-nested.c?<wbr>rev=282453&r1=282452&r2=<wbr>282453&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGen/capture<wbr>d-statements-nested.c (original)<br>
+++ cfe/trunk/test/CodeGen/capture<wbr>d-statements-nested.c Mon Sep 26 18:49:47 2016<br>
@@ -69,7 +69,7 @@ void test_nest_captured_stmt(int param,<br>
// CHECK1-NEXT: getelementptr inbounds %struct.A, %struct.A*<br>
// CHECK1-NEXT: store i8 99<br>
//<br>
- // CHECK1: [[SIZE_ADDR_REF:%.*]] = getelementptr inbounds [[T]], [[T]]* {{.*}}, i{{.+}} 0, i{{.+}} 7<br>
+ // CHECK1-DAG: [[SIZE_ADDR_REF:%.*]] = getelementptr inbounds [[T]], [[T]]* {{.*}}, i{{.+}} 0, i{{.+}} 7<br>
// CHECK1-DAG: [[SIZE_ADDR:%.*]] = load i{{.+}}*, i{{.+}}** [[SIZE_ADDR_REF]]<br>
// CHECK1-DAG: [[SIZE:%.*]] = load i{{.+}}, i{{.+}}* [[SIZE_ADDR]]<br>
// CHECK1-DAG: [[PARAM_ARR_IDX:%.*]] = sub nsw i{{.+}} [[SIZE]], 1<br>
@@ -79,7 +79,7 @@ void test_nest_captured_stmt(int param,<br>
// CHECK1-DAG: [[PARAM_ARR_SIZE_MINUS_1_ADDR:<wbr>%.*]] = getelementptr inbounds i{{.+}}, i{{.+}}* [[PARAM_ARR]], i{{.*}}<br>
// CHECK1: store i{{.+}} 2, i{{.+}}* [[PARAM_ARR_SIZE_MINUS_1_ADDR]<wbr>]<br>
//<br>
- // CHECK1: [[Z_ADDR_REF:%.*]] = getelementptr inbounds [[T]], [[T]]* {{.*}}, i{{.+}} 0, i{{.+}} 2<br>
+ // CHECK1-DAG: [[Z_ADDR_REF:%.*]] = getelementptr inbounds [[T]], [[T]]* {{.*}}, i{{.+}} 0, i{{.+}} 2<br>
// CHECK1-DAG: [[Z_ADDR:%.*]] = load %struct.A*, %struct.A** [[Z_ADDR_REF]]<br>
// CHECK1-DAG: [[Z_A_ADDR:%.*]] = getelementptr inbounds %struct.A, %struct.A* [[Z_ADDR]], i{{.+}} 0, i{{.+}} 0<br>
// CHECK1-DAG: [[ARR_IDX_2:%.*]] = load i{{.+}}, i{{.+}}* [[Z_A_ADDR]]<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/catc<wbr>h-undef-behavior.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp?rev=282453&r1=282452&r2=282453&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CodeGenCX<wbr>X/catch-undef-behavior.cpp?<wbr>rev=282453&r1=282452&r2=<wbr>282453&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGenCXX/catc<wbr>h-undef-behavior.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/catc<wbr>h-undef-behavior.cpp Mon Sep 26 18:49:47 2016<br>
@@ -277,13 +277,13 @@ int array_index(const int (&a)[4], int n<br>
int multi_array_index(int n, int m) {<br>
int arr[4][6];<br>
<br>
- // CHECK: %[[IDX2_OK:.*]] = icmp ult i64 %{{.*}}, 6<br>
- // CHECK: br i1 %[[IDX2_OK]]<br>
- // CHECK: call void @__ubsan_handle_out_of_bounds(<br>
-<br>
// CHECK: %[[IDX1_OK:.*]] = icmp ult i64 %{{.*}}, 4<br>
// CHECK: br i1 %[[IDX1_OK]]<br>
// CHECK: call void @__ubsan_handle_out_of_bounds(<br>
+<br>
+ // CHECK: %[[IDX2_OK:.*]] = icmp ult i64 %{{.*}}, 6<br>
+ // CHECK: br i1 %[[IDX2_OK]]<br>
+ // CHECK: call void @__ubsan_handle_out_of_bounds(<br>
return arr[n][m];<br>
}<br>
<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/cxx1<wbr>y-initializer-aggregate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx1y-initializer-aggregate.cpp?rev=282453&r1=282452&r2=282453&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CodeGenCX<wbr>X/cxx1y-initializer-aggregate.<wbr>cpp?rev=282453&r1=282452&r2=<wbr>282453&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGenCXX/cxx1<wbr>y-initializer-aggregate.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/cxx1<wbr>y-initializer-aggregate.cpp Mon Sep 26 18:49:47 2016<br>
@@ -51,8 +51,8 @@ C n{};<br>
<br>
// CHECK: store i32 0, i32* getelementptr inbounds ({{.*}} @a, i32 0, i32 0)<br>
// CHECK: store i8* {{.*}} @[[STR_A]]{{.*}}, i8** getelementptr inbounds ({{.*}} @a, i32 0, i32 1)<br>
-// CHECK: load i32, i32* getelementptr inbounds ({{.*}} @a, i32 0, i32 0)<br>
// CHECK: load i8*, i8** getelementptr inbounds ({{.*}} @a, i32 0, i32 1)<br>
+// CHECK: load i32, i32* getelementptr inbounds ({{.*}} @a, i32 0, i32 0)<br>
// CHECK: getelementptr inbounds i8, i8* %{{.*}}, {{.*}} %{{.*}}<br>
// CHECK: store i8 %{{.*}}, i8* getelementptr inbounds ({{.*}} @a, i32 0, i32 2)<br>
// CHECK: call i32 @_ZN1A1fEv({{.*}} @a)<br>
<br>
Added: cfe/trunk/test/CodeGenCXX/cxx1<wbr>z-eval-order.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx1z-eval-order.cpp?rev=282453&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CodeGenCX<wbr>X/cxx1z-eval-order.cpp?rev=<wbr>282453&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGenCXX/cxx1<wbr>z-eval-order.cpp (added)<br>
+++ cfe/trunk/test/CodeGenCXX/cxx1<wbr>z-eval-order.cpp Mon Sep 26 18:49:47 2016<br>
@@ -0,0 +1,214 @@<br>
+// RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - -triple %itanium_abi_triple | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ITANIUM<br>
+// RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - -triple %ms_abi_triple | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-WINDOWS<br>
+<br>
+struct B;<br>
+struct A {<br>
+ A();<br>
+ A(const A&);<br>
+<br>
+ void operator[](B b);<br>
+<br>
+ int a_member_f(B);<br>
+};<br>
+struct B {<br>
+ B();<br>
+ ~B();<br>
+};<br>
+<br>
+struct C {<br>
+ operator int *();<br>
+ A *operator->();<br>
+ void operator->*(B);<br>
+<br>
+ friend void operator<<(C, B);<br>
+ friend void operator>>(C, B);<br>
+ void operator<<(A);<br>
+ void operator>>(A);<br>
+<br>
+ void operator=(B);<br>
+ void operator+=(B);<br>
+};<br>
+<br>
+A make_a();<br>
+A *make_a_ptr();<br>
+int A::*make_mem_ptr_a();<br>
+void (A::*make_mem_fn_ptr_a())();<br>
+B make_b();<br>
+C make_c();<br>
+void side_effect();<br>
+<br>
+void callee(A);<br>
+void (*get_f())(A);<br>
+<br>
+<br>
+// CHECK-LABEL: define {{.*}}@{{.*}}postfix_before_ar<wbr>gs{{.*}}(<br>
+void postfix_before_args() {<br>
+ // CHECK: call {{.*}}@{{.*}}get_f{{.*}}(<br>
+ // CHECK-ITANIUM: call {{.*}}@_ZN1AC1Ev(<br>
+ // CHECK-WINDOWS: call {{.*}}@"\01??0A@@QEAA@XZ"(<br>
+ // CHECK: call {{.*}}%{{.*}}(<br>
+ get_f()(A{});<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}side_effect{{.*}}<wbr>(<br>
+ // CHECK-ITANIUM: call {{.*}}@_ZN1AC1Ev(<br>
+ // CHECK-WINDOWS: call {{.*}}@"\01??0A@@QEAA@XZ"(<br>
+ // CHECK: call {{.*}}@{{.*}}callee{{.*}}(<br>
+ (side_effect(), callee)(A{});<br>
+// CHECK: }<br>
+}<br>
+<br>
+<br>
+// CHECK-LABEL: define {{.*}}@{{.*}}dot_lhs_before_rh<wbr>s{{.*}}(<br>
+void dot_lhs_before_rhs() {<br>
+ // CHECK: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}a_member_f{{.*}}(<br>
+ make_a().a_member_f(make_b());<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}make_a_ptr{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}a_member_f{{.*}}(<br>
+ make_a_ptr()->a_member_f(make_<wbr>b());<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}a_member_f{{.*}}(<br>
+ make_c()->a_member_f(make_b())<wbr>;<br>
+// CHECK: }<br>
+}<br>
+<br>
+<br>
+// CHECK-LABEL: define {{.*}}@{{.*}}array_lhs_before_<wbr>rhs{{.*}}(<br>
+void array_lhs_before_rhs() {<br>
+ int (&get_arr())[10];<br>
+ extern int get_index();<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}get_arr{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}get_index{{.*}}(<br>
+ get_arr()[get_index()] = 0;<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}get_index{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}get_arr{{.*}}(<br>
+ get_index()[get_arr()] = 0;<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ // CHECK: call<br>
+ make_a()[make_b()];<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}get_index{{.*}}(<br>
+ // CHECK: call<br>
+ make_c()[get_index()] = 0;<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}get_index{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECK: call<br>
+ get_index()[make_c()] = 0;<br>
+// CHECK: }<br>
+}<br>
+<br>
+<br>
+void *operator new(decltype(sizeof(0)), C);<br>
+<br>
+// CHECK-LABEL: define {{.*}}@{{.*}}alloc_before_init<wbr>{{.*}}(<br>
+void alloc_before_init() {<br>
+ struct Q { Q(A) {} };<br>
+ // CHECK-ITANIUM: call {{.*}}@_Znw{{.*}}(<br>
+ // CHECK-WINDOWS: call {{.*}}@"\01??2@YAPEAX_K@Z"(<br>
+ // CHECK: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ delete new Q(make_a());<br>
+<br>
+ // CHECK: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECK: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ new (make_c()) Q(make_a());<br>
+// CHECK: }<br>
+}<br>
+<br>
+#if 0<br>
+// CHECKDISABLED-LABEL: define {{.*}}@{{.*}}dotstar_lhs_befor<wbr>e_rhs{{.*}}(<br>
+int dotstar_lhs_before_rhs() {<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_mem_ptr_a{{.<wbr>*}}(<br>
+ int a = make_a().*make_mem_ptr_a();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_a_ptr{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_mem_ptr_a{{.<wbr>*}}(<br>
+ int b = make_a_ptr()->*make_mem_ptr_a(<wbr>);<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ make_c()->*make_b();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_mem_fn_ptr_a<wbr>{{.*}}(<br>
+ // CHECKDISABLED: call<br>
+ (make_a().*make_mem_fn_ptr_a()<wbr>)();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_a_ptr{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_mem_fn_ptr_a<wbr>{{.*}}(<br>
+ // CHECKDISABLED: call<br>
+ (make_a_ptr()->*make_mem_fn_pt<wbr>r_a())();<br>
+<br>
+ return a + b;<br>
+// CHECKDISABLED: }<br>
+}<br>
+#endif<br>
+#if 0<br>
+// CHECKDISABLED-LABEL: define {{.*}}@{{.*}}assign_lhs_before<wbr>_rhs{{.*}}(<br>
+void assign_rhs_before_lhs() {<br>
+ extern int &lhs_ref(), rhs();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}rhs{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}lhs_ref{{.*}}(<br>
+ lhs_ref() = rhs();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}rhs{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}lhs_ref{{.*}}(<br>
+ lhs_ref() += rhs();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}rhs{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}lhs_ref{{.*}}(<br>
+ lhs_ref() %= rhs();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ make_c() = make_b();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ make_c() += make_b();<br>
+// CHECKDISABLED: }<br>
+}<br>
+#endif<br>
+#if 0<br>
+// CHECKDISABLED-LABEL: define {{.*}}@{{.*}}shift_lhs_before_<wbr>rhs{{.*}}(<br>
+void shift_lhs_before_rhs() {<br>
+ extern int lhs(), rhs();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}lhs{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}rhs{{.*}}(<br>
+ (void)(lhs() << rhs());<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}lhs{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}rhs{{.*}}(<br>
+ (void)(lhs() >> rhs());<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ make_c() << make_a();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_a{{.*}}(<br>
+ make_c() >> make_a();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ make_c() << make_b();<br>
+<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_c{{.*}}(<br>
+ // CHECKDISABLED: call {{.*}}@{{.*}}make_b{{.*}}(<br>
+ make_c() >> make_b();<br>
+// CHECKDISABLED: }<br>
+}<br>
+#endif<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/prag<wbr>ma-loop-safety.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pragma-loop-safety.cpp?rev=282453&r1=282452&r2=282453&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CodeGenCX<wbr>X/pragma-loop-safety.cpp?rev=<wbr>282453&r1=282452&r2=282453&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGenCXX/prag<wbr>ma-loop-safety.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/prag<wbr>ma-loop-safety.cpp Mon Sep 26 18:49:47 2016<br>
@@ -10,12 +10,12 @@ void vectorize_test(int *List, int Lengt<br>
#pragma clang loop vectorize(assume_safety) interleave(disable) unroll(disable)<br>
for (int i = 0; i < Length; i++) {<br>
// CHECK: [[RHIV1:.+]] = load i32, i32* [[IV1]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP1_ID]]<br>
- // CHECK-NEXT: [[CALC1:.+]] = mul nsw i32[[RHIV1]], 2<br>
- // CHECK-NEXT: [[SIV1:.+]] = load i32, i32* [[IV1]]{{.*}}!llvm.mem.paralle<wbr>l_loop_access ![[LOOP1_ID]]<br>
- // CHECK-NEXT: [[INDEX1:.+]] = sext i32[[SIV1]] to i64<br>
- // CHECK-NEXT: [[ARRAY1:.+]] = load i32*, i32** [[LIST1:.*]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP1_ID]]<br>
- // CHECK-NEXT: [[PTR1:.+]] = getelementptr inbounds i32, i32*[[ARRAY1]], i64[[INDEX1]]<br>
- // CHECK-NEXT: store i32[[CALC1]], i32*[[PTR1]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP1_ID]]<br>
+ // CHECK-DAG: [[CALC1:.+]] = mul nsw i32[[RHIV1]], 2<br>
+ // CHECK-DAG: [[SIV1:.+]] = load i32, i32* [[IV1]]{{.*}}!llvm.mem.paralle<wbr>l_loop_access ![[LOOP1_ID]]<br>
+ // CHECK-DAG: [[INDEX1:.+]] = sext i32[[SIV1]] to i64<br>
+ // CHECK-DAG: [[ARRAY1:.+]] = load i32*, i32** [[LIST1:.*]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP1_ID]]<br>
+ // CHECK-DAG: [[PTR1:.+]] = getelementptr inbounds i32, i32*[[ARRAY1]], i64[[INDEX1]]<br>
+ // CHECK: store i32[[CALC1]], i32*[[PTR1]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP1_ID]]<br>
// CHECK-NEXT: br label [[LOOP1_INC:[^,]+]]<br>
List[i] = i * 2;<br>
<br>
@@ -33,12 +33,12 @@ void interleave_test(int *List, int Leng<br>
#pragma clang loop interleave(assume_safety) vectorize(disable) unroll(disable)<br>
for (int i = 0; i < Length; i++) {<br>
// CHECK: [[RHIV2:.+]] = load i32, i32* [[IV2]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP2_ID]]<br>
- // CHECK-NEXT: [[CALC2:.+]] = mul nsw i32[[RHIV2]], 2<br>
- // CHECK-NEXT: [[SIV2:.+]] = load i32, i32* [[IV2]]{{.*}}!llvm.mem.paralle<wbr>l_loop_access ![[LOOP2_ID]]<br>
- // CHECK-NEXT: [[INDEX2:.+]] = sext i32[[SIV2]] to i64<br>
- // CHECK-NEXT: [[ARRAY2:.+]] = load i32*, i32** [[LIST2:.*]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP2_ID]]<br>
- // CHECK-NEXT: [[PTR2:.+]] = getelementptr inbounds i32, i32*[[ARRAY2]], i64[[INDEX2]]<br>
- // CHECK-NEXT: store i32[[CALC2]], i32*[[PTR2]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP2_ID]]<br>
+ // CHECK-DAG: [[CALC2:.+]] = mul nsw i32[[RHIV2]], 2<br>
+ // CHECK-DAG: [[SIV2:.+]] = load i32, i32* [[IV2]]{{.*}}!llvm.mem.paralle<wbr>l_loop_access ![[LOOP2_ID]]<br>
+ // CHECK-DAG: [[INDEX2:.+]] = sext i32[[SIV2]] to i64<br>
+ // CHECK-DAG: [[ARRAY2:.+]] = load i32*, i32** [[LIST2:.*]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP2_ID]]<br>
+ // CHECK-DAG: [[PTR2:.+]] = getelementptr inbounds i32, i32*[[ARRAY2]], i64[[INDEX2]]<br>
+ // CHECK: store i32[[CALC2]], i32*[[PTR2]], {{.*}}!llvm.mem.parallel_loop_<wbr>access ![[LOOP2_ID]]<br>
// CHECK-NEXT: br label [[LOOP2_INC:[^,]+]]<br>
List[i] = i * 2;<br>
<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/vla-<wbr>lambda-capturing.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vla-lambda-capturing.cpp?rev=282453&r1=282452&r2=282453&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/test/CodeGenCX<wbr>X/vla-lambda-capturing.cpp?<wbr>rev=282453&r1=282452&r2=<wbr>282453&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGenCXX/vla-<wbr>lambda-capturing.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/vla-<wbr>lambda-capturing.cpp Mon Sep 26 18:49:47 2016<br>
@@ -125,11 +125,11 @@ int main() {<br>
// CHECK: [[SIZE2:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIZE2_REF]]<br>
// CHECK: [[SIZE1_REF:%.+]] = getelementptr inbounds [[CAP_TYPE3]], [[CAP_TYPE3]]* [[THIS]], i{{[0-9]+}} 0, i{{[0-9]+}} 2<br>
// CHECK: [[SIZE1:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIZE1_REF]]<br>
+// CHECK: [[BUFFER1_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TYPE3]], [[CAP_TYPE3]]* [[THIS]], i{{[0-9]+}} 0, i{{[0-9]+}} 3<br>
+// CHECK: [[BUFFER1_ADDR:%.+]] = load [[INTPTR_T]]*, [[INTPTR_T]]** [[BUFFER1_ADDR_REF]]<br>
// CHECK: [[N_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TYPE3]], [[CAP_TYPE3]]* [[THIS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0<br>
// CHECK: [[N_ADDR:%.+]] = load [[INTPTR_T]]*, [[INTPTR_T]]** [[N_ADDR_REF]]<br>
// CHECK: [[N:%.+]] = load [[INTPTR_T]], [[INTPTR_T]]* [[N_ADDR]]<br>
-// CHECK: [[BUFFER1_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TYPE3]], [[CAP_TYPE3]]* [[THIS]], i{{[0-9]+}} 0, i{{[0-9]+}} 3<br>
-// CHECK: [[BUFFER1_ADDR:%.+]] = load [[INTPTR_T]]*, [[INTPTR_T]]** [[BUFFER1_ADDR_REF]]<br>
// CHECK: [[ELEM_OFFSET:%.+]] = mul {{.*}} i{{[0-9]+}} [[N]], [[SIZE1]]<br>
// CHECK: [[ELEM_ADDR:%.+]] = getelementptr inbounds [[INTPTR_T]], [[INTPTR_T]]* [[BUFFER1_ADDR]], i{{[0-9]+}} [[ELEM_OFFSET]]<br>
// CHECK: [[SIZEOF:%.+]] = mul {{.*}} i{{[0-9]+}} {{[0-9]+}}, [[SIZE1]]<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>