summaryrefslogtreecommitdiff
path: root/test/CoverageMapping
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-07-30 17:58:22 +0000
committerReid Kleckner <rnk@google.com>2019-07-30 17:58:22 +0000
commitd646bc1c3c54f2daebab408542451ee961cb9dc6 (patch)
tree99d8cba8024a5b8decba27fe52b7066b6af53704 /test/CoverageMapping
parentd23b53b06b352cd5f7f84f164a0138f391a18926 (diff)
downloadclang-d646bc1c3c54f2daebab408542451ee961cb9dc6.tar.gz
Remove cache for macro arg stringization
Summary: The cache recorded the wrong expansion location for all but the first stringization. It seems uncommon to stringize the same macro argument multiple times, so this cache doesn't seem that important. Fixes PR39942 Reviewers: vsk, rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65428 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CoverageMapping')
-rw-r--r--test/CoverageMapping/macro-stringize-twice.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CoverageMapping/macro-stringize-twice.cpp b/test/CoverageMapping/macro-stringize-twice.cpp
new file mode 100644
index 0000000000..7a91d910cf
--- /dev/null
+++ b/test/CoverageMapping/macro-stringize-twice.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s | FileCheck %s
+
+// PR39942
+
+class a;
+template <class b> a &operator<<(b &, const char *);
+int c;
+#define d(l) l(__FILE__, __LINE__, c)
+#define COMPACT_GOOGLE_LOG_ERROR d(e)
+#define f(g, cond) cond ? (void)0 : h() & g
+#define i(j) COMPACT_GOOGLE_LOG_##j.g()
+#define k(j) f(i(j), 0)
+class e {
+public:
+ e(const char *, int, int);
+ a &g();
+};
+class h {
+public:
+ void operator&(a &);
+};
+void use_str(const char *);
+
+#define m(func) \
+ use_str(#func); \
+ k(ERROR) << #func; \
+ return 0; // CHECK: File 1, [[@LINE-1]]:4 -> [[@LINE-1]]:16 = (#0 - #1)
+int main() {
+ m(asdf);
+}