diff --git a/compiler-rt/test/hwasan/TestCases/global.c b/compiler-rt/test/hwasan/TestCases/global.c --- a/compiler-rt/test/hwasan/TestCases/global.c +++ b/compiler-rt/test/hwasan/TestCases/global.c @@ -5,6 +5,10 @@ // RUN: not %run %t -1 2>&1 | FileCheck --check-prefixes=CHECK,LSYM %s // RUN: not %env_hwasan_opts=symbolize=0 %run %t -1 2>&1 | FileCheck --check-prefixes=CHECK,LNOSYM %s +// Test with LTO, since it invokes the integrated assembler separately. +// RUN: %clang_hwasan -flto %s -o %t +// RUN: not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK,RSYM %s + // Test with and without optimizations, with and without PIC, since different // backend passes run depending on these flags. // RUN: %clang_hwasan -fno-pic %s -o %t diff --git a/compiler-rt/test/hwasan/lit.cfg.py b/compiler-rt/test/hwasan/lit.cfg.py --- a/compiler-rt/test/hwasan/lit.cfg.py +++ b/compiler-rt/test/hwasan/lit.cfg.py @@ -18,13 +18,6 @@ else: config.available_features.add('pointer-tagging') if config.target_arch == 'x86_64': - # By default the assembler uses R_X86_64_REX_GOTPCRELX relocations, which can - # be relaxed to direct references. When tagged globals are enabled, these - # references fail to link since they have more than a 32-bit offset from RIP. - # As a workaround, we disable the relaxation. - # TODO: Implement a way to disable for the affected relocations only. - clang_hwasan_common_cflags += ["-Wa,-mrelax-relocations=no"] - # The callback instrumentation used on x86_64 has a 1/64 chance of choosing a # stack tag of 0. This causes stack tests to become flaky, so we force tags # to be generated via calls to __hwasan_generate_tag, which never returns 0.