From 7f1026a7520eb3d7e99da77f6738deb72de17980 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 8 Jan 2020 15:44:35 -0800 Subject: [PATCH] [cfi][test] cross-dso/stats.cpp: don't assume the order of static constructors __sanitizer_stat_init is called for the executable first, then the shared object. In WriterModuleReport(), the information for the shared object will be recorded first. It'd be nice to get rid of the order requirement of static constructors. (This should make .ctors platforms work.) --- compiler-rt/test/cfi/cross-dso/stats.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler-rt/test/cfi/cross-dso/stats.cpp b/compiler-rt/test/cfi/cross-dso/stats.cpp index 09a7217..9d8c2ee 100644 --- a/compiler-rt/test/cfi/cross-dso/stats.cpp +++ b/compiler-rt/test/cfi/cross-dso/stats.cpp @@ -22,24 +22,24 @@ extern "C" void nvcall(A *a); #ifdef SHARED_LIB extern "C" __attribute__((noinline)) void vcall(A *a) { - // CHECK: stats.cpp:[[@LINE+1]] vcall.cfi cfi-vcall 37 + // CHECK-DAG: stats.cpp:[[@LINE+1]] vcall.cfi cfi-vcall 37 a->vf(); } extern "C" __attribute__((noinline)) void nvcall(A *a) { - // CHECK: stats.cpp:[[@LINE+1]] nvcall.cfi cfi-nvcall 51 + // CHECK-DAG: stats.cpp:[[@LINE+1]] nvcall.cfi cfi-nvcall 51 a->nvf(); } #else extern "C" __attribute__((noinline)) A *dcast(A *a) { - // CHECK: stats.cpp:[[@LINE+1]] dcast.cfi cfi-derived-cast 24 + // CHECK-DAG: stats.cpp:[[@LINE+1]] dcast.cfi cfi-derived-cast 24 return (A *)(ABase *)a; } extern "C" __attribute__((noinline)) A *ucast(A *a) { - // CHECK: stats.cpp:[[@LINE+1]] ucast.cfi cfi-unrelated-cast 81 + // CHECK-DAG: stats.cpp:[[@LINE+1]] ucast.cfi cfi-unrelated-cast 81 return (A *)(char *)a; } -- 2.7.4