diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -763,7 +763,7 @@ Res |= SanitizerKind::Memory; Res |= SanitizerKind::Vptr; Res |= SanitizerKind::SafeStack; - if (IsX86_64 || IsMIPS64 || IsAArch64) + if (IsX86_64 || IsMIPS64 || IsAArch64 || IsLoongArch64) Res |= SanitizerKind::DataFlow; if (IsX86_64 || IsMIPS64 || IsAArch64 || IsX86 || IsArmArch || IsPowerPC64 || IsRISCV64 || IsSystemZ || IsHexagon || IsLoongArch64) diff --git a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake --- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake +++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake @@ -29,7 +29,7 @@ set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64} ${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON} ${LOONGARCH64}) -set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) +set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${LOONGARCH64}) if(ANDROID) set(OS_NAME "Android") diff --git a/compiler-rt/test/dfsan/atomic.cpp b/compiler-rt/test/dfsan/atomic.cpp --- a/compiler-rt/test/dfsan/atomic.cpp +++ b/compiler-rt/test/dfsan/atomic.cpp @@ -1,7 +1,7 @@ // RUN: %clangxx_dfsan %s -fno-exceptions -o %t && %run %t // RUN: %clangxx_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -fno-exceptions -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // // Use -fno-exceptions to turn off exceptions to avoid instrumenting // __cxa_begin_catch, std::terminate and __gxx_personality_v0. diff --git a/compiler-rt/test/dfsan/basic.c b/compiler-rt/test/dfsan/basic.c --- a/compiler-rt/test/dfsan/basic.c +++ b/compiler-rt/test/dfsan/basic.c @@ -1,6 +1,6 @@ // RUN: %clang_dfsan %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that labels are propagated through loads and stores. diff --git a/compiler-rt/test/dfsan/conditional_callbacks.c b/compiler-rt/test/dfsan/conditional_callbacks.c --- a/compiler-rt/test/dfsan/conditional_callbacks.c +++ b/compiler-rt/test/dfsan/conditional_callbacks.c @@ -6,7 +6,7 @@ // RUN: %clang_dfsan -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -O2 -mllvm -dfsan-conditional-callbacks -mllvm -dfsan-track-origins=1 -DORIGINS %s %t-callbacks-orig.o -o %t-orig // RUN: %run %t-orig FooBarBaz 2>&1 | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that callbacks are inserted for conditionals when // -dfsan-conditional-callbacks is specified. diff --git a/compiler-rt/test/dfsan/conditional_callbacks_sig.c b/compiler-rt/test/dfsan/conditional_callbacks_sig.c --- a/compiler-rt/test/dfsan/conditional_callbacks_sig.c +++ b/compiler-rt/test/dfsan/conditional_callbacks_sig.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -O2 -mllvm -dfsan-conditional-callbacks %s %t-callbacks.o -o %t // RUN: %run %t FooBarBaz 2>&1 | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/dfsan_get_track_origins.c b/compiler-rt/test/dfsan/dfsan_get_track_origins.c --- a/compiler-rt/test/dfsan/dfsan_get_track_origins.c +++ b/compiler-rt/test/dfsan/dfsan_get_track_origins.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan -DTRACK_ORIGINS=1 -mllvm -dfsan-track-origins=1 %s -o %t && %run %t // RUN: %clang_dfsan -DTRACK_ORIGINS=0 %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/event_callbacks.c b/compiler-rt/test/dfsan/event_callbacks.c --- a/compiler-rt/test/dfsan/event_callbacks.c +++ b/compiler-rt/test/dfsan/event_callbacks.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan -O2 -mllvm -dfsan-event-callbacks %s %t-callbacks.o -o %t // RUN: %run %t FooBarBaz 2>&1 | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that callbacks are inserted for store events when // -dfsan-event-callbacks is specified. diff --git a/compiler-rt/test/dfsan/fast8labels.c b/compiler-rt/test/dfsan/fast8labels.c --- a/compiler-rt/test/dfsan/fast8labels.c +++ b/compiler-rt/test/dfsan/fast8labels.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan %s -o %t // RUN: %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // #include diff --git a/compiler-rt/test/dfsan/flags.c b/compiler-rt/test/dfsan/flags.c --- a/compiler-rt/test/dfsan/flags.c +++ b/compiler-rt/test/dfsan/flags.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_unimplemented=0 %run %t 2>&1 | count 0 // RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -mllvm -dfsan-debug-nonzero-labels -o %t && DFSAN_OPTIONS=warn_nonzero_labels=1 %run %t 2>&1 | FileCheck --check-prefix=CHECK-NONZERO %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that flags work correctly. diff --git a/compiler-rt/test/dfsan/flush.c b/compiler-rt/test/dfsan/flush.c --- a/compiler-rt/test/dfsan/flush.c +++ b/compiler-rt/test/dfsan/flush.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan %s -o %t && %run %t // RUN: %clang_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/fncall.c b/compiler-rt/test/dfsan/fncall.c --- a/compiler-rt/test/dfsan/fncall.c +++ b/compiler-rt/test/dfsan/fncall.c @@ -1,6 +1,6 @@ // RUN: %clang_dfsan %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // // Tests that labels are propagated through function calls. diff --git a/compiler-rt/test/dfsan/force_zero.c b/compiler-rt/test/dfsan/force_zero.c --- a/compiler-rt/test/dfsan/force_zero.c +++ b/compiler-rt/test/dfsan/force_zero.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan %s -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -DFORCE_ZERO_LABELS -o %t && %run %t // RUN: %clang_dfsan %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/fork.cpp b/compiler-rt/test/dfsan/fork.cpp --- a/compiler-rt/test/dfsan/fork.cpp +++ b/compiler-rt/test/dfsan/fork.cpp @@ -8,7 +8,7 @@ // RUN: %clangxx_dfsan -mllvm -dfsan-track-origins=1 %s -o %t // RUN: DFSAN_OPTIONS=store_context_size=1000,origin_history_size=0,origin_history_per_stack_limit=0 %run %t 2>&1 | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/gep.c b/compiler-rt/test/dfsan/gep.c --- a/compiler-rt/test/dfsan/gep.c +++ b/compiler-rt/test/dfsan/gep.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan %s -mllvm -dfsan-combine-offset-labels-on-gep=false -Wno-error=int-conversion -o %t && %run %t // RUN: %clang_dfsan %s -DPROP_OFFSET_LABELS -Wno-error=int-conversion -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that labels are propagated through GEP. diff --git a/compiler-rt/test/dfsan/interceptors.c b/compiler-rt/test/dfsan/interceptors.c --- a/compiler-rt/test/dfsan/interceptors.c +++ b/compiler-rt/test/dfsan/interceptors.c @@ -3,7 +3,7 @@ // // Tests custom implementations of various glibc functions. // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/libatomic.c b/compiler-rt/test/dfsan/libatomic.c --- a/compiler-rt/test/dfsan/libatomic.c +++ b/compiler-rt/test/dfsan/libatomic.c @@ -3,7 +3,7 @@ // RUN: %clang_dfsan -g3 -DDATA_BYTES=32 %s -fno-exceptions -latomic -o %t && %run %t // RUN: %clang_dfsan -g3 -DDATA_BYTES=32 -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -fno-exceptions -latomic -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/lookup_table.c b/compiler-rt/test/dfsan/lookup_table.c --- a/compiler-rt/test/dfsan/lookup_table.c +++ b/compiler-rt/test/dfsan/lookup_table.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan %s -mllvm -dfsan-combine-offset-labels-on-gep=false -mllvm -dfsan-combine-pointer-labels-on-load=false -mllvm -dfsan-combine-taint-lookup-table=no_match -o %t && %run %t // RUN: %clang_dfsan %s -mllvm -dfsan-combine-offset-labels-on-gep=false -mllvm -dfsan-combine-pointer-labels-on-load=false -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/mmap_at_init.c b/compiler-rt/test/dfsan/mmap_at_init.c --- a/compiler-rt/test/dfsan/mmap_at_init.c +++ b/compiler-rt/test/dfsan/mmap_at_init.c @@ -2,7 +2,7 @@ // RUN: %clang_dfsan %s %t-calloc.o -o %t // RUN: %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // // Tests that calling mmap() during during dfsan initialization works. diff --git a/compiler-rt/test/dfsan/origin_add_label.c b/compiler-rt/test/dfsan/origin_add_label.c --- a/compiler-rt/test/dfsan/origin_add_label.c +++ b/compiler-rt/test/dfsan/origin_add_label.c @@ -6,7 +6,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_branch.c b/compiler-rt/test/dfsan/origin_branch.c --- a/compiler-rt/test/dfsan/origin_branch.c +++ b/compiler-rt/test/dfsan/origin_branch.c @@ -2,7 +2,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_disabled.c b/compiler-rt/test/dfsan/origin_disabled.c --- a/compiler-rt/test/dfsan/origin_disabled.c +++ b/compiler-rt/test/dfsan/origin_disabled.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan -gmlt %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_id_stack_trace.c b/compiler-rt/test/dfsan/origin_id_stack_trace.c --- a/compiler-rt/test/dfsan/origin_id_stack_trace.c +++ b/compiler-rt/test/dfsan/origin_id_stack_trace.c @@ -6,7 +6,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/origin_invalid.c b/compiler-rt/test/dfsan/origin_invalid.c --- a/compiler-rt/test/dfsan/origin_invalid.c +++ b/compiler-rt/test/dfsan/origin_invalid.c @@ -1,8 +1,8 @@ // RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out -// -// REQUIRES: x86_64-target-arch +// +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include @@ -11,14 +11,18 @@ dfsan_set_label(1, &a, sizeof(a)); // Manually compute origin address for &a. - // See x86 MEM_TO_ORIGIN macro for logic to replicate here. + // See x86/loongarch64 MEM_TO_ORIGIN macro for logic to replicate here. // Alignment is also needed after to MEM_TO_ORIGIN. uint64_t origin_addr = (((uint64_t)&a ^ 0x500000000000ULL) + 0x100000000000ULL) & ~0x3ULL; // Take the address we computed, and store 0 in it to mess it up. +#if defined(__loongarch_lp64) + asm("st.d $zero, %0, 0" : : "r"(origin_addr)); +#else asm("mov %0, %%rax": :"r"(origin_addr)); asm("movq $0, (%rax)"); +#endif dfsan_print_origin_trace(&a, "invalid"); } diff --git a/compiler-rt/test/dfsan/origin_ld_lost.c b/compiler-rt/test/dfsan/origin_ld_lost.c --- a/compiler-rt/test/dfsan/origin_ld_lost.c +++ b/compiler-rt/test/dfsan/origin_ld_lost.c @@ -2,7 +2,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // // Test origin tracking can lost origins at 2-byte load with addr % 4 == 3. diff --git a/compiler-rt/test/dfsan/origin_ldst.c b/compiler-rt/test/dfsan/origin_ldst.c --- a/compiler-rt/test/dfsan/origin_ldst.c +++ b/compiler-rt/test/dfsan/origin_ldst.c @@ -22,7 +22,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // // Test origin tracking is accurate in terms of partial store/load, and // different aligments. Do not test alignments that are not power of 2. diff --git a/compiler-rt/test/dfsan/origin_limit.c b/compiler-rt/test/dfsan/origin_limit.c --- a/compiler-rt/test/dfsan/origin_limit.c +++ b/compiler-rt/test/dfsan/origin_limit.c @@ -9,7 +9,7 @@ // RUN: DFSAN_OPTIONS=origin_history_size=0 %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK0 < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_memcpy.c b/compiler-rt/test/dfsan/origin_memcpy.c --- a/compiler-rt/test/dfsan/origin_memcpy.c +++ b/compiler-rt/test/dfsan/origin_memcpy.c @@ -1,12 +1,12 @@ // RUN: %clang_dfsan -gmlt -DOFFSET=0 -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK0 < %t.out -// +// // RUN: %clang_dfsan -gmlt -DOFFSET=10 -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK10 < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_memmove.c b/compiler-rt/test/dfsan/origin_memmove.c --- a/compiler-rt/test/dfsan/origin_memmove.c +++ b/compiler-rt/test/dfsan/origin_memmove.c @@ -6,7 +6,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK10 < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_memset.c b/compiler-rt/test/dfsan/origin_memset.c --- a/compiler-rt/test/dfsan/origin_memset.c +++ b/compiler-rt/test/dfsan/origin_memset.c @@ -1,12 +1,12 @@ // RUN: %clang_dfsan -gmlt -DOFFSET=0 -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK0 < %t.out -// +// // RUN: %clang_dfsan -gmlt -DOFFSET=10 -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK10 < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_of_first_taint.c b/compiler-rt/test/dfsan/origin_of_first_taint.c --- a/compiler-rt/test/dfsan/origin_of_first_taint.c +++ b/compiler-rt/test/dfsan/origin_of_first_taint.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t 2>&1 | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/origin_overlapped.c b/compiler-rt/test/dfsan/origin_overlapped.c --- a/compiler-rt/test/dfsan/origin_overlapped.c +++ b/compiler-rt/test/dfsan/origin_overlapped.c @@ -2,7 +2,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_set_label.c b/compiler-rt/test/dfsan/origin_set_label.c --- a/compiler-rt/test/dfsan/origin_set_label.c +++ b/compiler-rt/test/dfsan/origin_set_label.c @@ -1,12 +1,12 @@ // RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out -// +// // RUN: %clang_dfsan -gmlt -mllvm -dfsan-track-origins=1 -mllvm -dfsan-instrument-with-call-threshold=0 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_stack_trace.c b/compiler-rt/test/dfsan/origin_stack_trace.c --- a/compiler-rt/test/dfsan/origin_stack_trace.c +++ b/compiler-rt/test/dfsan/origin_stack_trace.c @@ -6,7 +6,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/origin_track_ld.c b/compiler-rt/test/dfsan/origin_track_ld.c --- a/compiler-rt/test/dfsan/origin_track_ld.c +++ b/compiler-rt/test/dfsan/origin_track_ld.c @@ -2,7 +2,7 @@ // RUN: %run %t > %t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_unaligned_memtrans.c b/compiler-rt/test/dfsan/origin_unaligned_memtrans.c --- a/compiler-rt/test/dfsan/origin_unaligned_memtrans.c +++ b/compiler-rt/test/dfsan/origin_unaligned_memtrans.c @@ -1,12 +1,12 @@ // RUN: %clang_dfsan -gmlt -DOFFSET=0 -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK0 < %t.out -// +// // RUN: %clang_dfsan -gmlt -DOFFSET=10 -mllvm -dfsan-track-origins=1 %s -o %t && \ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK10 < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_untainted.c b/compiler-rt/test/dfsan/origin_untainted.c --- a/compiler-rt/test/dfsan/origin_untainted.c +++ b/compiler-rt/test/dfsan/origin_untainted.c @@ -2,7 +2,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_with_sigactions.c b/compiler-rt/test/dfsan/origin_with_sigactions.c --- a/compiler-rt/test/dfsan/origin_with_sigactions.c +++ b/compiler-rt/test/dfsan/origin_with_sigactions.c @@ -19,7 +19,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/origin_with_signals.cpp b/compiler-rt/test/dfsan/origin_with_signals.cpp --- a/compiler-rt/test/dfsan/origin_with_signals.cpp +++ b/compiler-rt/test/dfsan/origin_with_signals.cpp @@ -11,7 +11,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/pair.cpp b/compiler-rt/test/dfsan/pair.cpp --- a/compiler-rt/test/dfsan/pair.cpp +++ b/compiler-rt/test/dfsan/pair.cpp @@ -1,7 +1,7 @@ // RUN: %clangxx_dfsan %s -mllvm -dfsan-track-select-control-flow=false -mllvm -dfsan-combine-pointer-labels-on-load=false -O0 -DO0 -o %t && %run %t // RUN: %clangxx_dfsan %s -mllvm -dfsan-track-select-control-flow=false -mllvm -dfsan-combine-pointer-labels-on-load=false -O1 -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/propagate.c b/compiler-rt/test/dfsan/propagate.c --- a/compiler-rt/test/dfsan/propagate.c +++ b/compiler-rt/test/dfsan/propagate.c @@ -1,6 +1,6 @@ // RUN: %clang_dfsan %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that labels are propagated through computation and that union labels // are properly created. diff --git a/compiler-rt/test/dfsan/pthread.c b/compiler-rt/test/dfsan/pthread.c --- a/compiler-rt/test/dfsan/pthread.c +++ b/compiler-rt/test/dfsan/pthread.c @@ -8,7 +8,7 @@ // RUN: %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/reaches_function.c b/compiler-rt/test/dfsan/reaches_function.c --- a/compiler-rt/test/dfsan/reaches_function.c +++ b/compiler-rt/test/dfsan/reaches_function.c @@ -6,7 +6,7 @@ // RUN: %clang_dfsan -gmlt -fsanitize-ignorelist=%S/Inputs/flags_abilist.txt -O2 -mllvm -dfsan-reaches-function-callbacks=1 -mllvm -dfsan-track-origins=2 %s %t-callbacks.o -o %t // RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-ORIGIN-TRACKING %s -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that callbacks are inserted for reached functions when // -dfsan-reaches-function-callbacks is specified. diff --git a/compiler-rt/test/dfsan/release_shadow_space.c b/compiler-rt/test/dfsan/release_shadow_space.c --- a/compiler-rt/test/dfsan/release_shadow_space.c +++ b/compiler-rt/test/dfsan/release_shadow_space.c @@ -3,7 +3,7 @@ // DFSAN_OPTIONS=no_huge_pages_for_shadow=false RUN: %clang_dfsan %s -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 -o %t && %run %t // DFSAN_OPTIONS=no_huge_pages_for_shadow=true RUN: %clang_dfsan %s -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/sigaction.c b/compiler-rt/test/dfsan/sigaction.c --- a/compiler-rt/test/dfsan/sigaction.c +++ b/compiler-rt/test/dfsan/sigaction.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan -DUSE_SIGNAL_ACTION -Wno-error=int-conversion %s -o %t && %run %t // RUN: %clang_dfsan -Wno-error=int-conversion %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/sigaction_stress_test.c b/compiler-rt/test/dfsan/sigaction_stress_test.c --- a/compiler-rt/test/dfsan/sigaction_stress_test.c +++ b/compiler-rt/test/dfsan/sigaction_stress_test.c @@ -4,7 +4,7 @@ // // Test that the state of shadows from a sigaction handler are consistent. // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/stack_trace.c b/compiler-rt/test/dfsan/stack_trace.c --- a/compiler-rt/test/dfsan/stack_trace.c +++ b/compiler-rt/test/dfsan/stack_trace.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan -gmlt %s -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/struct.c b/compiler-rt/test/dfsan/struct.c --- a/compiler-rt/test/dfsan/struct.c +++ b/compiler-rt/test/dfsan/struct.c @@ -1,7 +1,7 @@ // RUN: %clang_dfsan %s -O1 -o %t && %run %t // RUN: %clang_dfsan %s -O0 -DO0 -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/threaded_flush.c b/compiler-rt/test/dfsan/threaded_flush.c --- a/compiler-rt/test/dfsan/threaded_flush.c +++ b/compiler-rt/test/dfsan/threaded_flush.c @@ -2,7 +2,7 @@ // segfault. // RUN: %clang_dfsan %s -o %t && %run %t // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/trace-cmp.c b/compiler-rt/test/dfsan/trace-cmp.c --- a/compiler-rt/test/dfsan/trace-cmp.c +++ b/compiler-rt/test/dfsan/trace-cmp.c @@ -4,7 +4,7 @@ // RUN: %clang_dfsan -fsanitize-coverage=trace-pc-guard,pc-table,func,trace-cmp %s -o %t // RUN: %run %t 2>&1 | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include #include diff --git a/compiler-rt/test/dfsan/vararg.c b/compiler-rt/test/dfsan/vararg.c --- a/compiler-rt/test/dfsan/vararg.c +++ b/compiler-rt/test/dfsan/vararg.c @@ -2,7 +2,7 @@ // RUN: not %run %t 2>&1 | FileCheck %s // RUN: %run %t foo // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch #include diff --git a/compiler-rt/test/dfsan/write_callback.c b/compiler-rt/test/dfsan/write_callback.c --- a/compiler-rt/test/dfsan/write_callback.c +++ b/compiler-rt/test/dfsan/write_callback.c @@ -1,6 +1,6 @@ // RUN: %clang_dfsan %s -o %t && %run %t | FileCheck %s // -// REQUIRES: x86_64-target-arch +// REQUIRES: x86_64-target-arch || loongarch64-target-arch // Tests that the custom implementation of write() does writes with or without // a callback set using dfsan_set_write_callback().