Skip to content

Commit 57abe66

Browse files
committed
[CIR][cir-link] Add simple cir function linker test
1 parent db016fe commit 57abe66

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: cir-link -sort-symbols -split-input-file %s | FileCheck %s
2+
3+
// CHECK: cir.func @f1() {
4+
// CHECK-NEXT: cir.return
5+
// CHECK-NEXT: }
6+
7+
// CHECK: cir.func @f2() {
8+
// CHECK-NEXT: cir.call @f1() : () -> ()
9+
// CHECK-NEXT: cir.return
10+
// CHECK-NEXT: }
11+
12+
module {
13+
cir.func private @f1()
14+
15+
cir.func @f2() {
16+
cir.call @f1() : () -> ()
17+
cir.return
18+
}
19+
}
20+
21+
// -----
22+
23+
module {
24+
cir.func @f1() {
25+
cir.return
26+
}
27+
}

clang/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ list(APPEND CLANG_TEST_DEPS
8686

8787
if(CLANG_ENABLE_CIR)
8888
list(APPEND CLANG_TEST_DEPS
89+
cir-link
8990
cir-opt
9091
cir-translate
9192
mlir-translate

clang/test/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
tools = [
8787
"apinotes-test",
8888
"c-index-test",
89+
"cir-link",
8990
"cir-opt",
9091
"cir-translate",
9192
"clang-diff",

0 commit comments

Comments
 (0)