diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c index 2e92acc617565d01ee66998a6c12250ea888b077..f3ce61840ffc352113bfd85e0e6dad025dbd7d07 100644 --- a/clang/test/Driver/sanitizer-ld.c +++ b/clang/test/Driver/sanitizer-ld.c @@ -527,14 +527,6 @@ // CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}" // CHECK-CFI-LINUX-NOT: libclang_rt. -// [OHOS]CFI by itself does not link runtime libraries. -// RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \ -// RUN: -target arm-linux-ohos -fuse-ld=lld -rtlib=platform \ -// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot \ -// RUN: | FileCheck --check-prefix=CHECK-CFI-LINUX %s -// CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}" -// CHECK-CFI-LINUX-NOT: libclang_rt. - // CFI with diagnostics links the UBSan runtime. // RUN: %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \ // RUN: %s -### -o %t.o 2>&1\ @@ -571,6 +563,18 @@ // CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}" // CHECK-CFI-CROSS-DSO-ANDROID-NOT: libclang_rt.cfi +// OHOS_LOCAL begin + +// Cross-DSO CFI on OHOS does not link runtime libraries. +// RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso %s -### -o %t.o 2>&1 \ +// RUN: -target aarch64-linux-ohos -fuse-ld=ld \ +// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot \ +// RUN: | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-OHOS %s +// CHECK-CFI-CROSS-DSO-OHOS: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-CROSS-DSO-OHOS-NOT: libclang_rt.cfi + +// OHOS_LOCAL end + // Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime. // RUN: %clang -fsanitize=cfi -fsanitize-cfi-cross-dso %s -### -o %t.o 2>&1 \ // RUN: -fno-sanitize-trap=cfi -fsanitize-recover=cfi \