Skip to content

Commit b42d911

Browse files
committed
add a test case
1 parent a778fb7 commit b42d911

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

jscomp/test/build.ninja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ build test/mutable_obj_test.cmi test/mutable_obj_test.cmj : cc test/mutable_obj_
453453
build test/mutable_uncurry_test.cmi test/mutable_uncurry_test.cmj : cc test/mutable_uncurry_test.ml | test/mt.cmj $stdlib
454454
build test/mutual_non_recursive_type.cmi test/mutual_non_recursive_type.cmj : cc test/mutual_non_recursive_type.ml | $stdlib
455455
build test/name_mangle_test.cmi test/name_mangle_test.cmj : cc test/name_mangle_test.ml | test/mt.cmj $stdlib
456+
build test/native_pattern.cmi test/native_pattern.cmj : cc test/native_pattern.ml | test/nativeint.cmj $stdlib
456457
build test/nativeint.cmj : cc_cmi test/nativeint.ml | test/nativeint.cmi $stdlib
457458
build test/nativeint.cmi : cc test/nativeint.mli | $stdlib
458459
build test/nested_include.cmi test/nested_include.cmj : cc test/nested_include.ml | $stdlib

jscomp/test/native_pattern.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
4+
function f(x) {
5+
if (x !== 1) {
6+
if (x !== 2) {
7+
return x + 3;
8+
} else {
9+
return 0;
10+
}
11+
} else {
12+
return 0;
13+
}
14+
}
15+
16+
exports.f = f;
17+
/* No side effect */

jscomp/test/native_pattern.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let f = function
2+
| 1n
3+
| 2n -> 0n
4+
| x -> Nativeint.add x 3n

0 commit comments

Comments
 (0)