forked from iden3/circom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VAN-543] unknown input status (#44)
* Add minimized test case * Add InputStatus resolution for final return data
- Loading branch information
Showing
3 changed files
with
75 additions
and
22 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,43 @@ | ||
pragma circom 2.0.6; | ||
// REQUIRES: circom | ||
// RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s | ||
|
||
template Sum(n) { | ||
signal input inp[n]; | ||
signal output outp; | ||
|
||
var s = 0; | ||
|
||
for (var i = 0; i < n; i++) { | ||
s += inp[i]; | ||
} | ||
|
||
outp <== s; | ||
} | ||
|
||
function nop(i) { | ||
return i; | ||
} | ||
|
||
template Caller() { | ||
signal input inp[4]; | ||
signal output outp; | ||
|
||
component s = Sum(4); | ||
|
||
for (var i = 0; i < 4; i++) { | ||
s.inp[i] <== nop(inp[i]); | ||
} | ||
|
||
outp <== s.outp; | ||
} | ||
|
||
component main = Caller(); | ||
|
||
//CHECK-LABEL: define void @Caller_{{[0-9]+}}_run | ||
//CHECK-SAME: ([0 x i256]* %0) | ||
//CHECK: %[[CALL_VAL:call\.nop_[0-3]]] = call i256 @nop_{{[0-3]}}(i256* %6) | ||
//CHECK: %[[SUBCMP_PTR:.*]] = getelementptr [1 x { [0 x i256]*, i32 }], [1 x { [0 x i256]*, i32 }]* %subcmps, i32 0, i32 0, i32 {{[0-3]}} | ||
//CHECK: %[[SUBCMP:.*]] = load [0 x i256]*, [0 x i256]** %[[SUBCMP_PTR]] | ||
//CHECK: %[[SUBCMP_INP:.*]] = getelementptr [0 x i256], [0 x i256]* %[[SUBCMP]], i32 0, i32 {{[1-4]}} | ||
//CHECK: store i256 %[[CALL_VAL]], i256* %[[SUBCMP_INP]] |
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
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