forked from llvm/clangir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptimization-attr.cpp
32 lines (25 loc) · 1.38 KB
/
optimization-attr.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O0 -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CHECK-O0 %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O1 -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CHECK-O1 %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2 -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CHECK-O2 %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O3 -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CHECK-O3 %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Os -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CHECK-Os %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Oz -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir --check-prefix=CHECK-Oz %s
void foo() {}
// CHECK-O0: module
// CHECK-O0-NOT: cir.opt_info
// CHECK-O1: module
// CHECK-O1: cir.opt_info = #cir.opt_info<level = 1, size = 0>
// CHECK-O2: module
// CHECK-O2: cir.opt_info = #cir.opt_info<level = 2, size = 0>
// CHECK-O3: module
// CHECK-O3: cir.opt_info = #cir.opt_info<level = 3, size = 0>
// CHECK-Os: module
// CHECK-Os: cir.opt_info = #cir.opt_info<level = 2, size = 1>
// CHECK-Oz: module
// CHECK-Oz: cir.opt_info = #cir.opt_info<level = 2, size = 2>