Debian Codegraph @

clang/test/Driver/loongarch-mtune.c

raw
1 // RUN: %clang --target=loongarch32 -mtune=loongarch32 -fsyntax-only %s -### 2>&1 | \
2 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=loongarch32
3 // RUN: %clang --target=loongarch32 -mtune=loongarch32 -S -emit-llvm %s -o - | \
4 // RUN: FileCheck %s --check-prefix=IRATTR -DCPU=loongarch32
5
6 // RUN: %clang --target=loongarch64 -mtune=loongarch64 -fsyntax-only %s -### 2>&1 | \
7 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=loongarch64
8 // RUN: %clang --target=loongarch64 -mtune=loongarch64 -S -emit-llvm %s -o - | \
9 // RUN: FileCheck %s --check-prefix=IRATTR -DCPU=loongarch64
10
11 // RUN: %clang --target=loongarch64 -mtune=la464 -fsyntax-only %s -### 2>&1 | \
12 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=la464
13 // RUN: %clang --target=loongarch64 -mtune=la464 -S -emit-llvm %s -o - | \
14 // RUN: FileCheck %s --check-prefix=IRATTR -DCPU=la464
15
16 // RUN: %clang --target=loongarch64 -mtune=la664 -fsyntax-only %s -### 2>&1 | \
17 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=la664
18 // RUN: %clang --target=loongarch64 -mtune=la664 -S -emit-llvm %s -o - | \
19 // RUN: FileCheck %s --check-prefix=IRATTR -DCPU=la664
20
21 // RUN: %clang --target=loongarch64 -mtune=invalidcpu -fsyntax-only %s -### 2>&1 | \
22 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=invalidcpu
23 // RUN: not %clang --target=loongarch64 -mtune=invalidcpu -S -emit-llvm %s -o /dev/null 2>&1 | \
24 // RUN: FileCheck %s --check-prefix=ERROR -DCPU=invalidcpu
25
26 // RUN: %clang --target=loongarch64 -mtune=generic -fsyntax-only %s -### 2>&1 | \
27 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=generic
28 // RUN: not %clang --target=loongarch64 -mtune=generic -S -emit-llvm %s -o /dev/null 2>&1 | \
29 // RUN: FileCheck %s --check-prefix=ERROR -DCPU=generic
30
31 // RUN: %clang --target=loongarch64 -mtune=generic-la64 -fsyntax-only %s -### 2>&1 | \
32 // RUN: FileCheck %s --check-prefix=CC1ARG -DCPU=generic-la64
33 // RUN: not %clang --target=loongarch64 -mtune=generic-la64 -S -emit-llvm %s -o /dev/null 2>&1 | \
34 // RUN: FileCheck %s --check-prefix=ERROR -DCPU=generic-la64
35
36 // CC1ARG: "-tune-cpu" "[[CPU]]"
37 // IRATTR: "tune-cpu"="[[CPU]]"
38
39 // ERROR: error: unknown target CPU '[[CPU]]'
40 // ERROR-NEXT: note: valid target CPU values are: {{.*}}
41
42 int foo(void) {
43 return 3;
44 }