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