r340467 - [ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.

Raphael Isemann via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 22 15:50:45 PDT 2018


Author: teemperor
Date: Wed Aug 22 15:50:45 2018
New Revision: 340467

URL: http://llvm.org/viewvc/llvm-project?rev=340467&view=rev
Log:
[ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.

Summary:
The `array-init-loop-expr` test is currently not testing the importing of ArrayInitLoopExprs.

This is because we import the `S` struct into the `test.cpp` context
and only do a copy-assignment in `test.cpp`, so the actual ArrayInitLoopExpr we wanted to
import is generated by clang directly in the target context. This means we actually
never test the importing of ArrayInitLoopExpr with this test, which becomes obvious
when looking at the missing test coverage for the respective  VisitArrayInitLoopExpr method.

This patch moves the copy-assignment of our struct to the `S.cpp` context, which means
that `test.cpp` now actually has to import the ArrayInitLoopExpr.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

Differential Revision: https://reviews.llvm.org/D51115

Modified:
    cfe/trunk/test/Import/array-init-loop-expr/Inputs/S.cpp
    cfe/trunk/test/Import/array-init-loop-expr/test.cpp

Modified: cfe/trunk/test/Import/array-init-loop-expr/Inputs/S.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Import/array-init-loop-expr/Inputs/S.cpp?rev=340467&r1=340466&r2=340467&view=diff
==============================================================================
--- cfe/trunk/test/Import/array-init-loop-expr/Inputs/S.cpp (original)
+++ cfe/trunk/test/Import/array-init-loop-expr/Inputs/S.cpp Wed Aug 22 15:50:45 2018
@@ -1,3 +1,8 @@
 class S {
   int a[10];
 };
+
+void f() {
+  S s;
+  S copy = s;
+}

Modified: cfe/trunk/test/Import/array-init-loop-expr/test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Import/array-init-loop-expr/test.cpp?rev=340467&r1=340466&r2=340467&view=diff
==============================================================================
--- cfe/trunk/test/Import/array-init-loop-expr/test.cpp (original)
+++ cfe/trunk/test/Import/array-init-loop-expr/test.cpp Wed Aug 22 15:50:45 2018
@@ -6,6 +6,5 @@
 // CHECK: ArrayInitIndexExpr
 
 void expr() {
-  S s;
-  S copy = s;
+  f();
 }




More information about the cfe-commits mailing list