| 1 |
/// Test -m[no-]lsx options. |
| 2 |
|
| 3 |
// RUN: %clang --target=loongarch64 -mlsx -fsyntax-only %s -### 2>&1 | \ |
| 4 |
// RUN: FileCheck %s --check-prefix=CC1-LSX |
| 5 |
// RUN: %clang --target=loongarch64 -mno-lsx -fsyntax-only %s -### 2>&1 | \ |
| 6 |
// RUN: FileCheck %s --check-prefix=CC1-NOLSX |
| 7 |
// RUN: %clang --target=loongarch64 -mlsx -mno-lsx -fsyntax-only %s -### 2>&1 | \ |
| 8 |
// RUN: FileCheck %s --check-prefix=CC1-NOLSX |
| 9 |
// RUN: %clang --target=loongarch64 -mno-lsx -mlsx -fsyntax-only %s -### 2>&1 | \ |
| 10 |
// RUN: FileCheck %s --check-prefix=CC1-LSX |
| 11 |
// RUN: %clang --target=loongarch64 -mlsx -mno-lasx -fsyntax-only %s -### 2>&1 | \ |
| 12 |
// RUN: FileCheck %s --check-prefix=CC1-LSX |
| 13 |
// RUN: %clang --target=loongarch64 -mno-lasx -mlsx -fsyntax-only %s -### 2>&1 | \ |
| 14 |
// RUN: FileCheck %s --check-prefix=CC1-LSX |
| 15 |
// RUN: %clang --target=loongarch64 -mno-lsx -mno-lasx -fsyntax-only %s -### 2>&1 | \ |
| 16 |
// RUN: FileCheck %s --check-prefix=CC1-NOLSX |
| 17 |
|
| 18 |
// RUN: %clang --target=loongarch64 -mlsx -S -emit-llvm %s -o - | \ |
| 19 |
// RUN: FileCheck %s --check-prefix=IR-LSX |
| 20 |
// RUN: %clang --target=loongarch64 -mno-lsx -S -emit-llvm %s -o - | \ |
| 21 |
// RUN: FileCheck %s --check-prefix=IR-NOLSX |
| 22 |
// RUN: %clang --target=loongarch64 -mlsx -mno-lsx -S -emit-llvm %s -o - | \ |
| 23 |
// RUN: FileCheck %s --check-prefix=IR-NOLSX |
| 24 |
// RUN: %clang --target=loongarch64 -mno-lsx -mlsx -S -emit-llvm %s -o - | \ |
| 25 |
// RUN: FileCheck %s --check-prefix=IR-LSX |
| 26 |
// RUN: %clang --target=loongarch64 -mlsx -mno-lasx -S -emit-llvm %s -o - | \ |
| 27 |
// RUN: FileCheck %s --check-prefix=IR-LSX |
| 28 |
// RUN: %clang --target=loongarch64 -mno-lasx -mlsx -S -emit-llvm %s -o - | \ |
| 29 |
// RUN: FileCheck %s --check-prefix=IR-LSX |
| 30 |
// RUN: %clang --target=loongarch64 -mno-lsx -mno-lasx -S -emit-llvm %s -o - | \ |
| 31 |
// RUN: FileCheck %s --check-prefix=IR-NOLSX |
| 32 |
|
| 33 |
// CC1-LSX: "-target-feature" "+lsx" |
| 34 |
// CC1-NOLSX: "-target-feature" "-lsx" |
| 35 |
|
| 36 |
// IR-LSX: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+lsx{{(,.*)?}}" |
| 37 |
// IR-NOLSX: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-lsx{{(,.*)?}}" |
| 38 |
|
| 39 |
int foo(void){ |
| 40 |
return 3; |
| 41 |
} |