Files
clang-p2996/clang/test/Driver/loongarch-as.s
Weining Lu ddb27b1870 [Clang][LoongArch] Pass the -mabi and -target-abi options to as and cc1as respectively
This change is necessary to set correct EFlags according to the
options (-m*-float and -mabi=) passed to clang when input is assembly.

Note: `-mabi=` is not documented by `as`.
```
$ as --version
GNU assembler (GNU Binutils) 2.40.50.20230316
...
$ as --target-help
LARCH options:
```

But we can see gcc invokes `as` and passes the `-mabi=` option when compiling C or assembly.
```
$ gcc -c a.c -v 2>&1 -msoft-float | grep "as -v"
 as -v -mabi=lp64s -o a.o /tmp/ccFrxzZi.s
$ gcc -c a.s -v 2>&1 -msoft-float | grep "as -v"
 as -v -mabi=lp64s -o a.o a.s
```

Reviewed By: xen0n

Differential Revision: https://reviews.llvm.org/D150537
2023-05-16 21:10:15 +08:00

16 lines
688 B
ArmAsm

/// This file checks options are correctly passed to as for LoongArch targets.
/// Check `-mabi`.
// RUN: %clang --target=loongarch64 -### -fno-integrated-as -c %s 2>&1 | \
// RUN: FileCheck -DABI=lp64d --check-prefix=ABI %s
// RUN: %clang --target=loongarch64 -mabi=lp64d -### -fno-integrated-as -c %s 2>&1 | \
// RUN: FileCheck -DABI=lp64d --check-prefix=ABI %s
// RUN: %clang --target=loongarch64 -mabi=lp64f -### -fno-integrated-as -c %s 2>&1 | \
// RUN: FileCheck -DABI=lp64f --check-prefix=ABI %s
// RUN: %clang --target=loongarch64 -mabi=lp64s -### -fno-integrated-as -c %s 2>&1 | \
// RUN: FileCheck -DABI=lp64s --check-prefix=ABI %s
// ALL: as
// ABI: "-mabi=[[ABI]]"