| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,8 @@ set(hlsl_files | |
|
|
||
| set(loongarch_files | ||
| larchintrin.h | ||
| lasxintrin.h | ||
| lsxintrin.h | ||
| ) | ||
|
|
||
| set(mips_msa_files | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlasx -msingle-float 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LASX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlasx -msoft-float 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LASX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlasx -mfpu=32 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LASX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlasx -mfpu=0 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LASX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlasx -mfpu=none 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LASX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlasx -mno-lsx 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LASX_FPU128 %s | ||
|
|
||
| // ERROR_LASX_FPU64: error: wrong fpu width; LASX depends on 64-bit FPU. | ||
| // ERROR_LASX_FPU128: error: invalid option combination; LASX depends on LSX. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /// Test -m[no-]lasx options. | ||
|
|
||
| // RUN: %clang --target=loongarch64 -mlasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LASX | ||
| // RUN: %clang --target=loongarch64 -mno-lasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-NOLASX | ||
| // RUN: %clang --target=loongarch64 -mlasx -mno-lasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-NOLASX | ||
| // RUN: %clang --target=loongarch64 -mno-lasx -mlasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LASX | ||
| // RUN: %clang --target=loongarch64 -mlsx -mlasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LASX | ||
| // RUN: %clang --target=loongarch64 -mlasx -mlsx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LASX | ||
|
|
||
| // RUN: %clang --target=loongarch64 -mlasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LASX | ||
| // RUN: %clang --target=loongarch64 -mno-lasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-NOLASX | ||
| // RUN: %clang --target=loongarch64 -mlasx -mno-lasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-NOLASX | ||
| // RUN: %clang --target=loongarch64 -mno-lasx -mlasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LASX | ||
| // RUN: %clang --target=loongarch64 -mlsx -mlasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LASX | ||
| // RUN: %clang --target=loongarch64 -mlasx -mlsx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LASX | ||
|
|
||
| // CC1-LASX: "-target-feature" "+lsx" "-target-feature" "+lasx" | ||
| // CC1-NOLASX: "-target-feature" "-lasx" | ||
|
|
||
| // IR-LASX: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+lasx{{(,.*)?}}" | ||
| // IR-NOLASX: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-lasx{{(,.*)?}}" | ||
|
|
||
| int foo(void){ | ||
| return 3; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlsx -msingle-float 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LSX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlsx -msoft-float 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LSX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlsx -mfpu=32 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LSX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlsx -mfpu=0 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LSX_FPU64 %s | ||
| // RUN: not %clang --target=loongarch64 %s -fsyntax-only -mlsx -mfpu=none 2>&1 \ | ||
| // RUN: FileCheck --check-prefix=ERROR_LSX_FPU64 %s | ||
|
|
||
| // ERROR_LSX_FPU64: error: wrong fpu width; LSX depends on 64-bit FPU. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /// Test -m[no-]lsx options. | ||
|
|
||
| // RUN: %clang --target=loongarch64 -mlsx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LSX | ||
| // RUN: %clang --target=loongarch64 -mno-lsx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-NOLSX | ||
| // RUN: %clang --target=loongarch64 -mlsx -mno-lsx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-NOLSX | ||
| // RUN: %clang --target=loongarch64 -mno-lsx -mlsx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LSX | ||
| // RUN: %clang --target=loongarch64 -mlsx -mno-lasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LSX | ||
| // RUN: %clang --target=loongarch64 -mno-lasx -mlsx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-LSX | ||
| // RUN: %clang --target=loongarch64 -mno-lsx -mno-lasx -fsyntax-only %s -### 2>&1 | \ | ||
| // RUN: FileCheck %s --check-prefix=CC1-NOLSX | ||
|
|
||
| // RUN: %clang --target=loongarch64 -mlsx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LSX | ||
| // RUN: %clang --target=loongarch64 -mno-lsx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-NOLSX | ||
| // RUN: %clang --target=loongarch64 -mlsx -mno-lsx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-NOLSX | ||
| // RUN: %clang --target=loongarch64 -mno-lsx -mlsx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LSX | ||
| // RUN: %clang --target=loongarch64 -mlsx -mno-lasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LSX | ||
| // RUN: %clang --target=loongarch64 -mno-lasx -mlsx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-LSX | ||
| // RUN: %clang --target=loongarch64 -mno-lsx -mno-lasx -S -emit-llvm %s -o - | \ | ||
| // RUN: FileCheck %s --check-prefix=IR-NOLSX | ||
|
|
||
| // CC1-LSX: "-target-feature" "+lsx" | ||
| // CC1-NOLSX: "-target-feature" "-lsx" | ||
|
|
||
| // IR-LSX: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+lsx{{(,.*)?}}" | ||
| // IR-NOLSX: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-lsx{{(,.*)?}}" | ||
|
|
||
| int foo(void){ | ||
| return 3; | ||
| } |