From 52cae05e087b3d4fd02849fc37c387c720055ffb Mon Sep 17 00:00:00 2001 From: Marco Elver Date: Wed, 10 Jun 2020 20:20:23 +0200 Subject: [PATCH] [ASan][Test] Fix expected strings for globals test The expected strings would previously not catch bugs when redzones were added when they were not actually expected. Fix by adding "global " before the type. --- clang/test/CodeGen/asan-globals-alias.cpp | 4 ++-- clang/test/CodeGen/asan-globals.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/test/CodeGen/asan-globals-alias.cpp b/clang/test/CodeGen/asan-globals-alias.cpp index 1b6d4183261c..faf160ac79c9 100644 --- a/clang/test/CodeGen/asan-globals-alias.cpp +++ b/clang/test/CodeGen/asan-globals-alias.cpp @@ -7,8 +7,8 @@ int global; // to genera int aliased_global; // KASAN - ignore globals prefixed by aliases with __-prefix (below) extern int __attribute__((alias("aliased_global"))) __global_alias; // KASAN - aliased_global ignored -// ASAN: @aliased_global{{.*}}{ i32, [60 x i8] }{{.*}}align 32 -// KASAN: @aliased_global{{.*}}i32 +// ASAN: @aliased_global{{.*}} global { i32, [60 x i8] }{{.*}}, align 32 +// KASAN: @aliased_global{{.*}} global i32 // CHECK-LABEL: define internal void @asan.module_ctor // ASAN: call void @__asan_register_globals({{.*}}, i{{32|64}} 2) diff --git a/clang/test/CodeGen/asan-globals.cpp b/clang/test/CodeGen/asan-globals.cpp index 76373f59e424..cb6f2174c6a5 100644 --- a/clang/test/CodeGen/asan-globals.cpp +++ b/clang/test/CodeGen/asan-globals.cpp @@ -22,10 +22,10 @@ void func() { const char *literal = "Hello, world!"; } -// ASAN: sectioned_global{{.*}}{ i32, [60 x i8] }{{.*}}align 32 -// KASAN: sectioned_global{{.*}}i32 -// ASAN: @__special_global{{.*}}{ i32, [60 x i8] }{{.*}}align 32 -// KASAN: @__special_global{{.*}}i32 +// ASAN: sectioned_global{{.*}} global { i32, [60 x i8] }{{.*}}, align 32 +// KASAN: sectioned_global{{.*}} global i32 +// ASAN: @__special_global{{.*}} global { i32, [60 x i8] }{{.*}}, align 32 +// KASAN: @__special_global{{.*}} global i32 // CHECK-LABEL: define internal void @asan.module_ctor // ASAN-NEXT: call void @__asan_init