61 lines · c
1// RUN: %clang --target=loongarch64 -march=loongarch64 -fsyntax-only %s -### 2>&1 | \2// RUN: FileCheck %s --check-prefix=CC1-LOONGARCH643// RUN: %clang --target=loongarch64 -march=la464 -fsyntax-only %s -### 2>&1 | \4// RUN: FileCheck %s --check-prefix=CC1-LA4645// RUN: %clang --target=loongarch64 -march=la64v1.0 -fsyntax-only %s -### 2>&1 | \6// RUN: FileCheck %s --check-prefix=CC1-LA64V1P07// RUN: %clang --target=loongarch64 -march=la64v1.1 -fsyntax-only %s -### 2>&1 | \8// RUN: FileCheck %s --check-prefix=CC1-LA64V1P19// RUN: %clang --target=loongarch64 -march=la664 -fsyntax-only %s -### 2>&1 | \10// RUN: FileCheck %s --check-prefix=CC1-LA66411// RUN: %clang --target=loongarch64 -march=loongarch64 -S -emit-llvm %s -o - | \12// RUN: FileCheck %s --check-prefix=IR-LOONGARCH6413// RUN: %clang --target=loongarch64 -march=la464 -S -emit-llvm %s -o - | \14// RUN: FileCheck %s --check-prefix=IR-LA46415// RUN: %clang --target=loongarch64 -march=la64v1.0 -S -emit-llvm %s -o - | \16// RUN: FileCheck %s --check-prefix=IR-LA64V1P017// RUN: %clang --target=loongarch64 -march=la64v1.1 -S -emit-llvm %s -o - | \18// RUN: FileCheck %s --check-prefix=IR-LA64V1P119// RUN: %clang --target=loongarch64 -march=la664 -S -emit-llvm %s -o - | \20// RUN: FileCheck %s --check-prefix=IR-LA66421 22// CC1-LOONGARCH64: "-target-cpu" "loongarch64"23// CC1-LOONGARCH64-NOT: "-target-feature"24// CC1-LOONGARCH64: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+ual"25// CC1-LOONGARCH64-NOT: "-target-feature"26// CC1-LOONGARCH64: "-target-abi" "lp64d"27 28// CC1-LA464: "-target-cpu" "la464"29// CC1-LA464-NOT: "-target-feature"30// CC1-LA464: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+lsx" "-target-feature" "+lasx" "-target-feature" "+ual"31// CC1-LA464-NOT: "-target-feature"32// CC1-LA464: "-target-abi" "lp64d"33 34// CC1-LA64V1P0: "-target-cpu" "loongarch64"35// CC1-LA64V1P0-NOT: "-target-feature"36// CC1-LA64V1P0: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+d" "-target-feature" "+lsx" "-target-feature" "+ual"37// CC1-LA64V1P0-NOT: "-target-feature"38// CC1-LA64V1P0: "-target-abi" "lp64d"39 40// CC1-LA64V1P1: "-target-cpu" "loongarch64"41// CC1-LA64V1P1-NOT: "-target-feature"42// CC1-LA64V1P1: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+d" "-target-feature" "+lsx" "-target-feature" "+ual" "-target-feature" "+frecipe" "-target-feature" "+lam-bh" "-target-feature" "+lamcas" "-target-feature" "+ld-seq-sa" "-target-feature" "+div32" "-target-feature" "+scq"43// CC1-LA64V1P1-NOT: "-target-feature"44// CC1-LA64V1P1: "-target-abi" "lp64d"45 46// CC1-LA664: "-target-cpu" "la664"47// CC1-LA664-NOT: "-target-feature"48// CC1-LA664: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+lsx" "-target-feature" "+lasx" "-target-feature" "+ual" "-target-feature" "+frecipe" "-target-feature" "+lam-bh" "-target-feature" "+lamcas" "-target-feature" "+ld-seq-sa" "-target-feature" "+div32" "-target-feature" "+scq"49// CC1-LA664-NOT: "-target-feature"50// CC1-LA664: "-target-abi" "lp64d"51 52// IR-LOONGARCH64: attributes #[[#]] ={{.*}}"target-cpu"="loongarch64" {{.*}}"target-features"="+64bit,+d,+f,+relax,+ual"53// IR-LA464: attributes #[[#]] ={{.*}}"target-cpu"="la464" {{.*}}"target-features"="+64bit,+d,+f,+lasx,+lsx,+relax,+ual"54// IR-LA64V1P0: attributes #[[#]] ={{.*}}"target-cpu"="loongarch64" {{.*}}"target-features"="+64bit,+d,+lsx,+relax,+ual"55// IR-LA64V1P1: attributes #[[#]] ={{.*}}"target-cpu"="loongarch64" {{.*}}"target-features"="+64bit,+d,+div32,+frecipe,+lam-bh,+lamcas,+ld-seq-sa,+lsx,+relax,+scq,+ual"56// IR-LA664: attributes #[[#]] ={{.*}}"target-cpu"="la664" {{.*}}"target-features"="+64bit,+d,+div32,+f,+frecipe,+lam-bh,+lamcas,+lasx,+ld-seq-sa,+lsx,+relax,+scq,+ual"57 58int foo(void) {59 return 3;60}61