[sanitizer] Fix vfork interception on loongarch64

Fix a brown paper bag error made by me in D129418.  I didn't set
ASAN_INTERCEPT_VFORK correctly for loongarch64, but created an all-zero
object for __interception::real_vfork.  This caused anything calling
vfork() to die instantly.

Fix this issue by setting ASAN_INTERCEPT_VFORK and remove the bad
all-zero definition.  Other ports have an all-zero common definition but
we don't need it at least for now.

And, enable ASAN vfork test for loongarch64 to prevent regression in the
future.

Differential Revision: https://reviews.llvm.org/D137160

GitOrigin-RevId: 061426df572552bc839e1a80cb29070d4242a32f
diff --git a/lib/asan/asan_interceptors.h b/lib/asan/asan_interceptors.h
index 35727a9..c4bf087 100644
--- a/lib/asan/asan_interceptors.h
+++ b/lib/asan/asan_interceptors.h
@@ -114,7 +114,7 @@
 
 #if SANITIZER_LINUX &&                                                \
     (defined(__arm__) || defined(__aarch64__) || defined(__i386__) || \
-     defined(__x86_64__) || SANITIZER_RISCV64)
+     defined(__x86_64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64)
 # define ASAN_INTERCEPT_VFORK 1
 #else
 # define ASAN_INTERCEPT_VFORK 0
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S b/lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S
index 0519248..68782ac 100644
--- a/lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S
+++ b/lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S
@@ -5,12 +5,6 @@
 ASM_HIDDEN(COMMON_INTERCEPTOR_SPILL_AREA)
 ASM_HIDDEN(_ZN14__interception10real_vforkE)
 
-.bss
-.type _ZN14__interception10real_vforkE, @object
-.size _ZN14__interception10real_vforkE, 8
-_ZN14__interception10real_vforkE:
-        .zero     8
-
 .text
 .globl ASM_WRAPPER_NAME(vfork)
 ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
diff --git a/test/asan/TestCases/Linux/vfork.cpp b/test/asan/TestCases/Linux/vfork.cpp
index 4c0f02c..b943e4d 100644
--- a/test/asan/TestCases/Linux/vfork.cpp
+++ b/test/asan/TestCases/Linux/vfork.cpp
@@ -1,7 +1,7 @@
 // https://github.com/google/sanitizers/issues/925
 // RUN: %clang_asan -O0 %s -o %t && %run %t 2>&1
 
-// REQUIRES: aarch64-target-arch || x86_64-target-arch || i386-target-arch || arm-target-arch || riscv64-target-arch
+// REQUIRES: aarch64-target-arch || x86_64-target-arch || i386-target-arch || arm-target-arch || riscv64-target-arch || loongarch64-target-arch
 
 #include <assert.h>
 #include <sys/types.h>