Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This basically add an echo test case in C. The support is limited right now, but full support would just be too much to review at once. The echo test case simply get a module as input and try to output the same exact module. This allow to check the both reading and writing API are working as expected. I want to improve this test over time to support more and more of the API, in order to improve coverage (coverage is quite poor right now). Test Plan: Run the test. Reviewers: chandlerc, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10725 llvm-svn: 259844
- Loading branch information
Showing
9 changed files
with
520 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
; RUN: llvm-as < %s | llvm-dis > %t.orig | ||
; RUN: llvm-as < %s | llvm-c-test --echo > %t.echo | ||
; RUN: diff %t.orig %t.echo | ||
|
||
declare void @decl() | ||
|
||
; TODO: label, struct and metadata types | ||
define void @types() { | ||
%1 = alloca half | ||
%2 = alloca float | ||
%3 = alloca double | ||
%4 = alloca x86_fp80 | ||
%5 = alloca fp128 | ||
%6 = alloca ppc_fp128 | ||
%7 = alloca i7 | ||
%8 = alloca void (i1)* | ||
%9 = alloca [3 x i22] | ||
%10 = alloca i328 addrspace(5)* | ||
%11 = alloca <5 x i23*> | ||
%12 = alloca x86_mmx | ||
ret void | ||
} | ||
|
||
define i32 @add(i32 %a, i32 %b) { | ||
%1 = add i32 %a, %b | ||
ret i32 %1 | ||
} | ||
|
||
define i32 @call() { | ||
%1 = call i32 @add(i32 23, i32 19) | ||
ret i32 %1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ endif () | |
add_llvm_tool(llvm-c-test | ||
calc.c | ||
disassemble.c | ||
echo.cpp | ||
helpers.c | ||
include-all.c | ||
main.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.