40 lines · c
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-LASX5// RUN: %clang --target=loongarch64 -mno-lasx -fsyntax-only %s -### 2>&1 | \6// RUN: FileCheck %s --check-prefix=CC1-NOLASX7// RUN: %clang --target=loongarch64 -mlasx -mno-lasx -fsyntax-only %s -### 2>&1 | \8// RUN: FileCheck %s --check-prefix=CC1-LSX9// RUN: %clang --target=loongarch64 -mno-lasx -mlasx -fsyntax-only %s -### 2>&1 | \10// RUN: FileCheck %s --check-prefix=CC1-LASX11// RUN: %clang --target=loongarch64 -mlsx -mlasx -fsyntax-only %s -### 2>&1 | \12// RUN: FileCheck %s --check-prefix=CC1-LASX13// RUN: %clang --target=loongarch64 -mlasx -mlsx -fsyntax-only %s -### 2>&1 | \14// RUN: FileCheck %s --check-prefix=CC1-LASX15 16// RUN: %clang --target=loongarch64 -mlasx -S -emit-llvm %s -o - | \17// RUN: FileCheck %s --check-prefix=IR-LASX18// RUN: %clang --target=loongarch64 -mno-lasx -S -emit-llvm %s -o - | \19// RUN: FileCheck %s --check-prefix=IR-NOLASX20// RUN: %clang --target=loongarch64 -mlasx -mno-lasx -S -emit-llvm %s -o - | \21// RUN: FileCheck %s --check-prefix=IR-LSX22// RUN: %clang --target=loongarch64 -mno-lasx -mlasx -S -emit-llvm %s -o - | \23// RUN: FileCheck %s --check-prefix=IR-LASX24// RUN: %clang --target=loongarch64 -mlsx -mlasx -S -emit-llvm %s -o - | \25// RUN: FileCheck %s --check-prefix=IR-LASX26// RUN: %clang --target=loongarch64 -mlasx -mlsx -S -emit-llvm %s -o - | \27// RUN: FileCheck %s --check-prefix=IR-LASX28 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 37int foo(void){38 return 3;39}40