Debian Codegraph @

clang/test/Driver/loongarch-mdiv32.c

raw
1 /// Test -m[no]div32 options.
2
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
11
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
20
21
22 // CC1-DIV32: "-target-feature" "+div32"
23 // CC1-NO-DIV32: "-target-feature" "-div32"
24
25 // IR-DIV32: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}+div32{{(,.*)?}}"
26 // IR-NO-DIV32: attributes #[[#]] ={{.*}}"target-features"="{{(.*,)?}}-div32{{(,.*)?}}"
27
28 int foo(void) {
29 return 42;
30 }