summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/test/cpp11-migrate/LoopConvert/Inputs/macro_problem.h7
-rw-r--r--clang-tools-extra/test/cpp11-migrate/LoopConvert/macro_problem.cpp22
2 files changed, 29 insertions, 0 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/LoopConvert/Inputs/macro_problem.h b/clang-tools-extra/test/cpp11-migrate/LoopConvert/Inputs/macro_problem.h
new file mode 100644
index 00000000000..42f28fde703
--- /dev/null
+++ b/clang-tools-extra/test/cpp11-migrate/LoopConvert/Inputs/macro_problem.h
@@ -0,0 +1,7 @@
+#define myns nsblah
+
+namespace nsblah {
+struct MyType {
+};
+
+} // namespace nsblah
diff --git a/clang-tools-extra/test/cpp11-migrate/LoopConvert/macro_problem.cpp b/clang-tools-extra/test/cpp11-migrate/LoopConvert/macro_problem.cpp
new file mode 100644
index 00000000000..03dbddc3ea9
--- /dev/null
+++ b/clang-tools-extra/test/cpp11-migrate/LoopConvert/macro_problem.cpp
@@ -0,0 +1,22 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
+// RUN: cp %t.cpp %t.base
+// RUN: cpp11-migrate -loop-convert %t.cpp -- -I %S/Inputs
+// RUN: FileCheck -input-file=%t.cpp %s
+//
+// See PR15589 for why this test fails.
+// XFAIL: *
+
+#include "macro_problem.h"
+#include "structures.h"
+
+void side_effect(const myns::MyType &T);
+
+void f() {
+ TypedefDerefContainer<myns::MyType> container;
+ for (TypedefDerefContainer<myns::MyType>::iterator I = container.begin(),
+ E = container.end(); I != E; ++I) {
+ myns::MyType &alias = *I;
+ // CHECK: myns::MyType &ref = *I;
+ side_effect(ref);
+ }
+}
OpenPOWER on IntegriCloud