Skip to content

Commit 280bb46

Browse files
committed
added two testcases to test if 1. the sym_visibility attr is passed correctly when a cir.func is lowered to a func.func in the indirect lowering (see: https: #1618) 2. the cir.triple attr is converted to the llvm.triple attr correctly when compiling throughmlir (see: #1619)
1 parent 40cb63d commit 280bb46

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %clang -fclangir -fno-clangir-direct-lowering %s -o %t
2+
3+
int main(int argc, char *argv[]) {
4+
// Variables
5+
int number = 0;
6+
7+
return number;
8+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: split-file %s %t
2+
// RUN: %clang_cc1 -fclangir -fno-clangir-direct-lowering -emit-mlir=core %t%{fs-sep}test_declaration.c
3+
// RUN: FileCheck --input-file=%t%{fs-sep}test_declaration.mlir %t%{fs-sep}test_declaration.c
4+
5+
6+
//--- add10.h
7+
8+
#ifndef ADD10_H
9+
#define ADD10_H
10+
11+
int add10(int x);
12+
13+
#endif
14+
15+
16+
//--- test_declaration.c
17+
18+
#include "add10.h"
19+
20+
// CHECK: func.func private @add10(i32) -> i32
21+
22+
int main(int argc, char *argv[]) {
23+
// Variables
24+
int number = 15;
25+
26+
number = add10(number);
27+
28+
return 0;
29+
}

0 commit comments

Comments
 (0)