diff options
author | Amaury Sechet <deadalnix@gmail.com> | 2016-02-05 01:27:11 +0000 |
---|---|---|
committer | Amaury Sechet <deadalnix@gmail.com> | 2016-02-05 01:27:11 +0000 |
commit | 5386703726bd19e50b7a6782f17a447ed8b460e3 (patch) | |
tree | 57e45ae503f88923c4beadfe70c6042656d71aa6 /test/Bindings | |
parent | a8e75884ecc68e4b4dd9ab14f90a258a3416d824 (diff) |
Add various binary operations in the LLVM C API echo test
Summary: This diff increase the tested surface of the C API.
Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bindings')
-rw-r--r-- | test/Bindings/llvm-c/echo.ll | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/Bindings/llvm-c/echo.ll b/test/Bindings/llvm-c/echo.ll index f5729320369..f4ba60eb619 100644 --- a/test/Bindings/llvm-c/echo.ll +++ b/test/Bindings/llvm-c/echo.ll @@ -21,12 +21,24 @@ define void @types() { ret void } -define i32 @add(i32 %a, i32 %b) { +define i32 @iops(i32 %a, i32 %b) { %1 = add i32 %a, %b - ret i32 %1 + %2 = mul i32 %a, %1 + %3 = sub i32 %2, %1 + %4 = udiv i32 %3, %b + %5 = sdiv i32 %2, %4 + %6 = urem i32 %3, %5 + %7 = srem i32 %2, %6 + %8 = shl i32 %1, %b + %9 = lshr i32 %a, %7 + %10 = ashr i32 %b, %8 + %11 = and i32 %9, %10 + %12 = or i32 %2, %11 + %13 = xor i32 %12, %4 + ret i32 %13 } define i32 @call() { - %1 = call i32 @add(i32 23, i32 19) + %1 = call i32 @iops(i32 23, i32 19) ret i32 %1 } |