return "rv32e";
else if (MABI.starts_with_insensitive("ilp32"))
return "rv32imafdc";
- else if (MABI.starts_with_insensitive("lp64"))
+ else if (MABI.starts_with_insensitive("lp64")) {
+ if (Triple.isAndroid())
+ return "rv64imafdc_zbb";
+
return "rv64imafdc";
+ }
}
// 4. Choose a default based on the triple
} else {
if (Triple.getOS() == llvm::Triple::UnknownOS)
return "rv64imac";
+ else if (Triple.isAndroid())
+ return "rv64imafdc_zbb";
else
return "rv64imafdc";
}
// RUN: %clang --target=riscv32-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s
// RUN: %clang --target=riscv64-unknown-elf -### %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: %clang --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT
+// RUN: %clang -mabi=lp64d --target=riscv64-linux-android -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=ANDROID,DEFAULT
// CHECK: fno-signed-char
// RUN: %clang --target=riscv32-unknown-elf -### %s -mrelax 2>&1 | FileCheck %s -check-prefix=RELAX
// RUN: %clang --target=riscv32-unknown-elf -### %s -mno-relax 2>&1 | FileCheck %s -check-prefix=NO-RELAX
+// ANDROID: "-target-feature" "+zbb"
// RELAX: "-target-feature" "+relax"
// NO-RELAX: "-target-feature" "-relax"
// DEFAULT: "-target-feature" "+relax"