Skip to content

Conversation

@hiraditya
Copy link
Collaborator

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Nov 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 19, 2024

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: AdityaK (hiraditya)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/116892.diff

1 Files Affected:

  • (modified) clang/test/Driver/android-ndk-standalone.cpp (+16)
diff --git a/clang/test/Driver/android-ndk-standalone.cpp b/clang/test/Driver/android-ndk-standalone.cpp
index 2670a6707a96c9..3d18244c77107b 100644
--- a/clang/test/Driver/android-ndk-standalone.cpp
+++ b/clang/test/Driver/android-ndk-standalone.cpp
@@ -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" "{{.*}}/sysroot/usr/local/include"
+// CHECK-RISCV: "-internal-externc-isystem" "{{.*}}/sysroot/include"
+// CHECK-RISCV: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include"
+// CHECK-RISCV: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-RISCV: "-L{{.*}}/sysroot/usr/lib"
+// CHECK-RISCV: "{{.*}}/lib/riscv64-unknown-linux-android/libclang_rt.builtins.a"

// RUN: %clang -### %s 2>&1 \
// RUN: --target=riscv64-linux-android \
// RUN: -march=rv64i \
// RUN: --gcc-toolchain=%S/Inputs/basic_android_ndk_tree \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will defer to @DanAlbert. I am not sure if basic_android_ndk_tree is relevant for this test - if so, we should add riscv64 components to that subdir.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CHECK-ARM64 variant of the test has it. I think it's so the test can find the linker? As long as this test is essentially a copy of that with the target and arch names swapped out, it's at least not wronger than the existing tests.

// CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/include"
// CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/usr/include"
// CHECK: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
// CHECK: "{{.*}}ld.lld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should just be ld to match what is in clang/test/Driver/Inputs/basic_android_ndk_tree/arm-linux-androideabi/bin/. @DanAlbert and I discussed whether we can assume lld is the default since the Android toolchain defaults to lld but that's still undecided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants