Skip to content

Commit 2dd83a9

Browse files
committed
[ASan][Test] Fix globals test for Mach-O
Summary: Use a portable section name, as for the test's purpose any name will do. Reviewers: nickdesaulniers, thakis Reviewed By: thakis Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D81306
1 parent 38f3ba5 commit 2dd83a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/test/CodeGen/asan-globals.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int global;
1111
int dyn_init_global = global;
1212
int __attribute__((no_sanitize("address"))) attributed_global;
1313
int blacklisted_global;
14-
int __attribute__((section(".foo.bar"))) sectioned_global;
14+
int __attribute__ ((section("__DATA, __common"))) sectioned_global;
1515

1616
void func() {
1717
static int static_var = 0;
@@ -41,7 +41,7 @@ void func() {
4141
// CHECK: ![[ATTR_GLOBAL]] = !{{{.*}}, null, null, i1 false, i1 true}
4242
// CHECK: ![[BLACKLISTED_GLOBAL]] = !{{{.*}}, null, null, i1 false, i1 true}
4343
// CHECK: ![[SECTIONED_GLOBAL]] = !{{{.*}} ![[SECTIONED_GLOBAL_LOC:[0-9]+]], !"sectioned_global", i1 false, i1 false}
44-
// CHECK: ![[SECTIONED_GLOBAL_LOC]] = !{!"{{.*}}asan-globals.cpp", i32 14, i32 42}
44+
// CHECK: ![[SECTIONED_GLOBAL_LOC]] = !{!"{{.*}}asan-globals.cpp", i32 14, i32 51}
4545
// CHECK: ![[STATIC_VAR]] = !{{{.*}} ![[STATIC_LOC:[0-9]+]], !"static_var", i1 false, i1 false}
4646
// CHECK: ![[STATIC_LOC]] = !{!"{{.*}}asan-globals.cpp", i32 17, i32 14}
4747
// CHECK: ![[LITERAL]] = !{{{.*}} ![[LITERAL_LOC:[0-9]+]], !"<string literal>", i1 false, i1 false}

0 commit comments

Comments
 (0)