[LVI] Add trunc to i1 handling. (#124480)
[llvm-project.git] / clang / test / Driver / loongarch-mdiv32.c
blobcf774b3818c55dd70f47b8a96ebff1b24a3bab04
1 /// Test -m[no]div32 options.
3 // RUN: %clang --target=loongarch64 -mdiv32 -fsyntax-only %s -### 2>&1 | \
4 // RUN: FileCheck %s --check-prefix=CC1-DIV32
5 // RUN: %clang --target=loongarch64 -mno-div32 -fsyntax-only %s -### 2>&1 | \
6 // RUN: FileCheck %s --check-prefix=CC1-NO-DIV32
7 // RUN: %clang --target=loongarch64 -mno-div32 -mdiv32 -fsyntax-only %s -### 2>&1 | \
8 // RUN: FileCheck %s --check-prefix=CC1-DIV32
9 // RUN: %clang --target=loongarch64 -mdiv32 -mno-div32 -fsyntax-only %s -### 2>&1 | \
10 // RUN: FileCheck %s --check-prefix=CC1-NO-DIV32
12 // RUN: %clang --target=loongarch64 -mdiv32 -S -emit-llvm %s -o - | \
13 // RUN: FileCheck %s --check-prefix=IR-DIV32
14 // RUN: %clang --target=loongarch64 -mno-div32 -S -emit-llvm %s -o - | \
15 // RUN: FileCheck %s --check-prefix=IR-NO-DIV32
16 // RUN: %clang --target=loongarch64 -mno-div32 -mdiv32 -S -emit-llvm %s -o - | \
17 // RUN: FileCheck %s --check-prefix=IR-DIV32
18 // RUN: %clang --target=loongarch64 -mdiv32 -mno-div32 -S -emit-llvm %s -o - | \
19 // RUN: FileCheck %s --check-prefix=IR-NO-DIV32
22 // CC1-DIV32: "-target-feature" "+div32"
23 // CC1-NO-DIV32: "-target-feature" "-div32"
25 // IR-DIV32: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+div32{{(,.*)?}}"
26 // IR-NO-DIV32: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-div32{{(,.*)?}}"
28 int foo(void) {
29 return 42;