https://github.com/hiraditya updated https://github.com/llvm/llvm-project/pull/116892
>From 264af861192f1af7b391d061c4bf52711091b5be Mon Sep 17 00:00:00 2001 From: AdityaK <hiradi...@msn.com> Date: Tue, 19 Nov 2024 15:54:16 -0800 Subject: [PATCH] Add a testcase for riscv64-linux-android triple --- clang/test/Driver/android-ndk-standalone.cpp | 34 ++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/clang/test/Driver/android-ndk-standalone.cpp b/clang/test/Driver/android-ndk-standalone.cpp index 2670a6707a96c9..8208fa1f82f7e2 100644 --- a/clang/test/Driver/android-ndk-standalone.cpp +++ b/clang/test/Driver/android-ndk-standalone.cpp @@ -14,7 +14,7 @@ // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a/thumb" // CHECK-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a" // CHECK-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/thumb" @@ -56,7 +56,7 @@ // CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/armv7-a" // CHECK-STDCXX-NOT: "-internal-isystem" "{{.*}}/include/c++/4.9/arm-linux-androideabi/thumb" // CHECK-STDCXX: "-internal-isystem" "{{.*}}/include/c++/4.9/backward" -// CHECK-STDCXX: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-STDCXX: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a/thumb" // CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a" // CHECK-STDCXX-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/thumb" @@ -87,7 +87,7 @@ // CHECK-ARMV7: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" // CHECK-ARMV7: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-ARMV7: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-ARMV7: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-ARMV7: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-ARMV7-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a/thumb" // CHECK-ARMV7-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/thumb" // CHECK-ARMV7-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9" @@ -140,7 +140,7 @@ // CHECK-THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" // CHECK-THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-THUMB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-THUMB: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a/thumb" // CHECK-THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a" // CHECK-THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9" @@ -174,7 +174,7 @@ // CHECK-ARMV7THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/arm-linux-androideabi" // CHECK-ARMV7THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-ARMV7THUMB: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-ARMV7THUMB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-ARMV7THUMB: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-ARMV7THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/thumb" // CHECK-ARMV7THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/armv7-a" // CHECK-ARMV7THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9" @@ -223,7 +223,7 @@ // CHECK-AARCH64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/aarch64-linux-android" // CHECK-AARCH64: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-AARCH64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-AARCH64: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-AARCH64: "-L{{.*}}/lib/gcc/aarch64-linux-android/4.9" // CHECK-AARCH64: "-L{{.*}}/sysroot/usr/lib/aarch64-linux-android/21" // CHECK-AARCH64: "-L{{.*}}/sysroot/usr/lib/aarch64-linux-android" @@ -239,7 +239,7 @@ // CHECK-ARM64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/aarch64-linux-android" // CHECK-ARM64: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-ARM64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-ARM64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-ARM64: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-ARM64: "-L{{.*}}/lib/gcc/aarch64-linux-android/4.9" // CHECK-ARM64: "-L{{.*}}/sysroot/usr/lib/aarch64-linux-android/21" // CHECK-ARM64: "-L{{.*}}/sysroot/usr/lib/aarch64-linux-android" @@ -255,7 +255,7 @@ // CHECK-I686: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/i686-linux-android" // CHECK-I686: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-I686: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-I686: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-I686: "-L{{.*}}/lib/gcc/i686-linux-android/4.9" // CHECK-I686: "-L{{.*}}/sysroot/usr/lib/i686-linux-android/21" // CHECK-I686: "-L{{.*}}/sysroot/usr/lib/i686-linux-android" @@ -271,7 +271,7 @@ // CHECK-X86_64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include/x86_64-linux-android" // CHECK-X86_64: "-internal-externc-isystem" "{{.*}}/sysroot/include" // CHECK-X86_64: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include" -// CHECK-X86_64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-X86_64: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" // CHECK-X86_64: "-L{{.*}}/lib/gcc/x86_64-linux-android/4.9" // CHECK-X86_64: "-L{{.*}}/sysroot/usr/lib/x86_64-linux-android/21" // CHECK-X86_64: "-L{{.*}}/sysroot/usr/lib/x86_64-linux-android" @@ -311,3 +311,19 @@ // CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 // CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_64-linux-android{{[/\\]}}4.9 +// +// RUN: %clang -### %s 2>&1 \ +// RUN: --target=riscv64-linux-android \ +// RUN: -march=rv64i \ +// RUN: --gcc-toolchain=%S/Inputs/basic_android_ndk_tree \ +// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree/sysroot \ +// RUN: | FileCheck --check-prefix=CHECK-RISCV %s +// CHECK-RISCV: "-cc1" +// CHECK-RISCV: "-internal-isystem" "{{.*}}{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1" +// CHECK-RISCV: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{/|\\\\}}clang/{{..}}{{/|\\\\}}include" +// CHECK-RISCV: "-internal-isystem" "{{.*}}/basic_android_ndk_tree/sysroot/usr/local/include" +// CHECK-RISCV: "-internal-externc-isystem" "{{.*}}/basic_android_ndk_tree/sysroot/include" +// CHECK-RISCV: "-internal-externc-isystem" "{{.*}}/basic_android_ndk_tree/sysroot/usr/include" +// CHECK-RISCV: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-RISCV: "-L{{.*}}/sysroot/usr/lib" +// CHECK-RISCV: "{{.*}}/lib/riscv64-unknown-linux-android/libclang_rt.builtins.a" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits