| 1 |
// RUN: %clang --target=loongarch64 -mfpu=64 -fsyntax-only %s -### 2>&1 | \ |
| 2 |
// RUN: FileCheck %s --check-prefix=CC1-FPU64 |
| 3 |
// RUN: %clang --target=loongarch64 -mfpu=32 -fsyntax-only %s -### 2>&1 | \ |
| 4 |
// RUN: FileCheck %s --check-prefix=CC1-FPU32 |
| 5 |
// RUN: %clang --target=loongarch64 -mfpu=0 -fsyntax-only %s -### 2>&1 | \ |
| 6 |
// RUN: FileCheck %s --check-prefix=CC1-FPU0 |
| 7 |
// RUN: %clang --target=loongarch64 -mfpu=none -fsyntax-only %s -### 2>&1 | \ |
| 8 |
// RUN: FileCheck %s --check-prefix=CC1-FPU0 |
| 9 |
|
| 10 |
// RUN: %clang --target=loongarch64 -mfpu=64 -S -emit-llvm %s -o - | \ |
| 11 |
// RUN: FileCheck %s --check-prefix=IR-FPU64 |
| 12 |
// RUN: %clang --target=loongarch64 -mfpu=32 -S -emit-llvm %s -o - | \ |
| 13 |
// RUN: FileCheck %s --check-prefix=IR-FPU32 |
| 14 |
// RUN: %clang --target=loongarch64 -mfpu=0 -S -emit-llvm %s -o - | \ |
| 15 |
// RUN: FileCheck %s --check-prefix=IR-FPU0 |
| 16 |
// RUN: %clang --target=loongarch64 -mfpu=none -S -emit-llvm %s -o - | \ |
| 17 |
// RUN: FileCheck %s --check-prefix=IR-FPU0 |
| 18 |
|
| 19 |
// CC1-FPU64: "-target-feature" "+f"{{.*}} "-target-feature" "+d" |
| 20 |
// CC1-FPU64: "-target-abi" "lp64d" |
| 21 |
|
| 22 |
// CC1-FPU32: "-target-feature" "+f"{{.*}} "-target-feature" "-d" |
| 23 |
// CC1-FPU32: "-target-abi" "lp64f" |
| 24 |
|
| 25 |
// CC1-FPU0: "-target-feature" "-f"{{.*}} "-target-feature" "-d" |
| 26 |
// CC1-FPU0: "-target-abi" "lp64s" |
| 27 |
|
| 28 |
// IR-FPU64: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+d,{{(.*,)?}}+f{{(,.*)?}}" |
| 29 |
// IR-FPU32: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+f,{{(.*,)?}}-d{{(,.*)?}}" |
| 30 |
// IR-FPU0: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-d,{{(.*,)?}}-f{{(,.*)?}}" |
| 31 |
|
| 32 |
int foo(void) { |
| 33 |
return 3; |
| 34 |
} |