diff --git a/test/unstable/BigInteger/unstable-sgn-bigint.chpl b/test/unstable/BigInteger/unstable-sgn-bigint.chpl new file mode 100644 index 000000000000..77dacdf284dd --- /dev/null +++ b/test/unstable/BigInteger/unstable-sgn-bigint.chpl @@ -0,0 +1,5 @@ +use BigInteger; + +// bigint +var b = new bigint(1); +assert(b.sgn() == 1); diff --git a/test/unstable/BigInteger/unstable-sgn-bigint.good b/test/unstable/BigInteger/unstable-sgn-bigint.good new file mode 100644 index 000000000000..feaef9b2de3e --- /dev/null +++ b/test/unstable/BigInteger/unstable-sgn-bigint.good @@ -0,0 +1 @@ +unstable-sgn-bigint.chpl:5: warning: bigint.sgn is unstable and may change its name and return type in the future diff --git a/test/unstable/unstable-sgn.chpl b/test/unstable/unstable-sgn.chpl new file mode 100644 index 000000000000..33a3d5aa13d3 --- /dev/null +++ b/test/unstable/unstable-sgn.chpl @@ -0,0 +1,48 @@ +// non-param numeric types +var i8: int(8) = 1; +var i16: int(16) = 1; +var i32: int(32) = 1; +var i64: int(64) = 1; +assert(sgn(i8) == 1); +assert(sgn(i16) == 1); +assert(sgn(i32) == 1); +assert(sgn(i64) == 1); + +var u8: uint(8) = 1; +var u16: uint(16) = 1; +var u32: uint(32) = 1; +var u64: uint(64) = 1; +assert(sgn(u8) == 1); +assert(sgn(u16) == 1); +assert(sgn(u32) == 1); +assert(sgn(u64) == 1); + +var r32: real(32) = 1; +var r64: real(64) = 1; +assert(sgn(r32) == 1); +assert(sgn(r64) == 1); + + +// param numeric types +param pi8: int(8) = 1; +param pi16: int(16) = 1; +param pi32: int(32) = 1; +param pi64: int(64) = 1; +assert(sgn(pi8) == 1); +assert(sgn(pi16) == 1); +assert(sgn(pi32) == 1); +assert(sgn(pi64) == 1); + +param pu8: uint(8) = 1; +param pu16: uint(16) = 1; +param pu32: uint(32) = 1; +param pu64: uint(64) = 1; +assert(sgn(pu8) == 1); +assert(sgn(pu16) == 1); +assert(sgn(pu32) == 1); +assert(sgn(pu64) == 1); + +param pr32: real(32) = 1; +param pr64: real(64) = 1; +assert(sgn(pr32) == 1); +assert(sgn(pr64) == 1); diff --git a/test/unstable/unstable-sgn.good b/test/unstable/unstable-sgn.good new file mode 100644 index 000000000000..0d2ee1482742 --- /dev/null +++ b/test/unstable/unstable-sgn.good @@ -0,0 +1,20 @@ +unstable-sgn.chpl:6: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:7: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:8: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:9: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:15: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:16: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:17: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:18: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:22: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:23: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:31: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:32: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:33: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:34: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:40: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:41: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:42: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:43: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:47: warning: sgn is unstable and may change its name and return type in the future +unstable-sgn.chpl:48: warning: sgn is unstable and may change its name and return type in the future