Debian Codegraph @

clang/test/Driver/loongarch-march.c

raw
1 // RUN: %clang --target=loongarch32 -march=la32v1.0 -fsyntax-only %s -### 2>&1 | \
2 // RUN: FileCheck %s --check-prefix=CC1-LA32V1P0
3 // RUN: %clang --target=loongarch32 -march=la32v1.0 -S -emit-llvm %s -o - | \
4 // RUN: FileCheck %s --check-prefix=IR-LA32V1P0
5 // RUN: %clang --target=loongarch32 -march=la32rv1.0 -fsyntax-only %s -### 2>&1 | \
6 // RUN: FileCheck %s --check-prefix=CC1-LA32RV1P0
7 // RUN: %clang --target=loongarch32 -march=la32rv1.0 -S -emit-llvm %s -o - | \
8 // RUN: FileCheck %s --check-prefix=IR-LA32RV1P0
9 // RUN: %clang --target=loongarch64 -march=loongarch64 -fsyntax-only %s -### 2>&1 | \
10 // RUN: FileCheck %s --check-prefix=CC1-LOONGARCH64
11 // RUN: %clang --target=loongarch64 -march=la464 -fsyntax-only %s -### 2>&1 | \
12 // RUN: FileCheck %s --check-prefix=CC1-LA464
13 // RUN: %clang --target=loongarch64 -march=la64v1.0 -fsyntax-only %s -### 2>&1 | \
14 // RUN: FileCheck %s --check-prefix=CC1-LA64V1P0
15 // RUN: %clang --target=loongarch64 -march=la64v1.1 -fsyntax-only %s -### 2>&1 | \
16 // RUN: FileCheck %s --check-prefix=CC1-LA64V1P1
17 // RUN: %clang --target=loongarch64 -march=la664 -fsyntax-only %s -### 2>&1 | \
18 // RUN: FileCheck %s --check-prefix=CC1-LA664
19 // RUN: %clang --target=loongarch64 -march=loongarch64 -S -emit-llvm %s -o - | \
20 // RUN: FileCheck %s --check-prefix=IR-LOONGARCH64
21 // RUN: %clang --target=loongarch64 -march=la464 -S -emit-llvm %s -o - | \
22 // RUN: FileCheck %s --check-prefix=IR-LA464
23 // RUN: %clang --target=loongarch64 -march=la64v1.0 -S -emit-llvm %s -o - | \
24 // RUN: FileCheck %s --check-prefix=IR-LA64V1P0
25 // RUN: %clang --target=loongarch64 -march=la64v1.1 -S -emit-llvm %s -o - | \
26 // RUN: FileCheck %s --check-prefix=IR-LA64V1P1
27 // RUN: %clang --target=loongarch64 -march=la664 -S -emit-llvm %s -o - | \
28 // RUN: FileCheck %s --check-prefix=IR-LA664
29
30 // CC1-LA32V1P0: "-target-cpu" "loongarch32"
31 // CC1-LA32V1P0-NOT: "-target-feature"
32 // CC1-LA32V1P0: "-target-feature" "+32bit" "-target-feature" "+32s"
33 // CC1-LA32V1P0-NOT: "-target-feature"
34 // CC1-LA32V1P0: "-target-abi" "ilp32d"
35
36 // CC1-LA32RV1P0: "-target-cpu" "loongarch32"
37 // CC1-LA32RV1P0-NOT: "-target-feature"
38 // CC1-LA32RV1P0: "-target-feature" "+32bit"
39 // CC1-LA32RV1P0-NOT: "-target-feature"
40 // CC1-LA32RV1P0: "-target-abi" "ilp32d"
41
42 // CC1-LOONGARCH64: "-target-cpu" "loongarch64"
43 // CC1-LOONGARCH64-NOT: "-target-feature"
44 // CC1-LOONGARCH64: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+ual"
45 // CC1-LOONGARCH64-NOT: "-target-feature"
46 // CC1-LOONGARCH64: "-target-abi" "lp64d"
47
48 // CC1-LA464: "-target-cpu" "la464"
49 // CC1-LA464-NOT: "-target-feature"
50 // CC1-LA464: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+f" "-target-feature" "+d" "-target-feature" "+lsx" "-target-feature" "+lasx" "-target-feature" "+ual"
51 // CC1-LA464-NOT: "-target-feature"
52 // CC1-LA464: "-target-abi" "lp64d"
53
54 // CC1-LA64V1P0: "-target-cpu" "loongarch64"
55 // CC1-LA64V1P0-NOT: "-target-feature"
56 // CC1-LA64V1P0: "-target-feature" "+relax" "-target-feature" "+64bit" "-target-feature" "+d" "-target-feature" "+lsx" "-target-feature" "+ual"
57 // CC1-LA64V1P0-NOT: "-target-feature"
58 // CC1-LA64V1P0: "-target-abi" "lp64d"
59
60 // CC1-LA64V1P1: "-target-cpu" "loongarch64"
61 // CC1-LA64V1P1-NOT: "-target-feature"
62 // 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"
63 // CC1-LA64V1P1-NOT: "-target-feature"
64 // CC1-LA64V1P1: "-target-abi" "lp64d"
65
66 // CC1-LA664: "-target-cpu" "la664"
67 // CC1-LA664-NOT: "-target-feature"
68 // 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"
69 // CC1-LA664-NOT: "-target-feature"
70 // CC1-LA664: "-target-abi" "lp64d"
71
72 // IR-LA32V1P0: attributes #[[#]] ={{.*}}"target-cpu"="loongarch32" {{.*}}"target-features"="+32bit,+32s"
73 // IR-LA32RV1P0: attributes #[[#]] ={{.*}}"target-cpu"="loongarch32" {{.*}}"target-features"="+32bit"
74
75 // IR-LOONGARCH64: attributes #[[#]] ={{.*}}"target-cpu"="loongarch64" {{.*}}"target-features"="+64bit,+d,+f,+relax,+ual"
76 // IR-LA464: attributes #[[#]] ={{.*}}"target-cpu"="la464" {{.*}}"target-features"="+64bit,+d,+f,+lasx,+lsx,+relax,+ual"
77 // IR-LA64V1P0: attributes #[[#]] ={{.*}}"target-cpu"="loongarch64" {{.*}}"target-features"="+64bit,+d,+lsx,+relax,+ual"
78 // IR-LA64V1P1: attributes #[[#]] ={{.*}}"target-cpu"="loongarch64" {{.*}}"target-features"="+64bit,+d,+div32,+frecipe,+lam-bh,+lamcas,+ld-seq-sa,+lsx,+relax,+scq,+ual"
79 // IR-LA664: attributes #[[#]] ={{.*}}"target-cpu"="la664" {{.*}}"target-features"="+64bit,+d,+div32,+f,+frecipe,+lam-bh,+lamcas,+lasx,+ld-seq-sa,+lsx,+relax,+scq,+ual"
80
81 int foo(void) {
82 return 3;
83 }