[clang] 85feebf - [NFC][SanitizeCoverage] Test always_inline functions work
Marco Elver via cfe-commits
cfe-commits at lists.llvm.org
Tue May 25 04:00:22 PDT 2021
Author: Marco Elver
Date: 2021-05-25T12:57:14+02:00
New Revision: 85feebf5a3401eab4c71288e2dc089faf547ab4c
URL: https://github.com/llvm/llvm-project/commit/85feebf5a3401eab4c71288e2dc089faf547ab4c
DIFF: https://github.com/llvm/llvm-project/commit/85feebf5a3401eab4c71288e2dc089faf547ab4c.diff
LOG: [NFC][SanitizeCoverage] Test always_inline functions work
Test that always_inline functions are instrumented as expected.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D102929
Added:
Modified:
clang/test/CodeGen/sanitize-coverage.c
Removed:
################################################################################
diff --git a/clang/test/CodeGen/sanitize-coverage.c b/clang/test/CodeGen/sanitize-coverage.c
index 6fc8e39354d4f..b3e44e28cbce9 100644
--- a/clang/test/CodeGen/sanitize-coverage.c
+++ b/clang/test/CodeGen/sanitize-coverage.c
@@ -19,4 +19,16 @@ void foo(int n) {
if (n)
x[n] = 42;
}
+
+static inline __attribute__((__always_inline__)) void always_inlined_fn(int n) {
+ if (n)
+ x[n] = 42;
+}
+// CHECK-LABEL: define dso_local void @test_always_inline(
+void test_always_inline(int n) {
+ // CHECK-DAG: call void @__sanitizer_cov_trace_pc
+ // CHECK-DAG: call void @__sanitizer_cov_trace_const_cmp
+ always_inlined_fn(n);
+}
+
// CHECK-LABEL: declare void
More information about the cfe-commits
mailing list