aboutsummaryrefslogtreecommitdiff
path: root/test/debug_safety.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-12-22 00:50:30 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-12-22 00:50:30 -0500
commitd917815d8111b98dc237cbe2c723fa63018e02b1 (patch)
treece12771a86b2412ee9692ca73d3ca49abe5da3ce /test/debug_safety.zig
parent8bc523219c66427951e5339550502871547f2138 (diff)
downloadzig-d917815d8111b98dc237cbe2c723fa63018e02b1.tar.gz
zig-d917815d8111b98dc237cbe2c723fa63018e02b1.zip
explicitly return from blocks
instead of last statement being expression value closes #629
Diffstat (limited to 'test/debug_safety.zig')
-rw-r--r--test/debug_safety.zig30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/debug_safety.zig b/test/debug_safety.zig
index 36f8d020c3..58ebf838b0 100644
--- a/test/debug_safety.zig
+++ b/test/debug_safety.zig
@@ -19,7 +19,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ baz(bar(a));
\\}
\\fn bar(a: []const i32) -> i32 {
- \\ a[4]
+ \\ return a[4];
\\}
\\fn baz(a: i32) { }
);
@@ -34,7 +34,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn add(a: u16, b: u16) -> u16 {
- \\ a + b
+ \\ return a + b;
\\}
);
@@ -48,7 +48,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn sub(a: u16, b: u16) -> u16 {
- \\ a - b
+ \\ return a - b;
\\}
);
@@ -62,7 +62,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn mul(a: u16, b: u16) -> u16 {
- \\ a * b
+ \\ return a * b;
\\}
);
@@ -76,7 +76,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 32767) return error.Whatever;
\\}
\\fn neg(a: i16) -> i16 {
- \\ -a
+ \\ return -a;
\\}
);
@@ -90,7 +90,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 32767) return error.Whatever;
\\}
\\fn div(a: i16, b: i16) -> i16 {
- \\ @divTrunc(a, b)
+ \\ return @divTrunc(a, b);
\\}
);
@@ -104,7 +104,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn shl(a: i16, b: u4) -> i16 {
- \\ @shlExact(a, b)
+ \\ return @shlExact(a, b);
\\}
);
@@ -118,7 +118,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn shl(a: u16, b: u4) -> u16 {
- \\ @shlExact(a, b)
+ \\ return @shlExact(a, b);
\\}
);
@@ -132,7 +132,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn shr(a: i16, b: u4) -> i16 {
- \\ @shrExact(a, b)
+ \\ return @shrExact(a, b);
\\}
);
@@ -146,7 +146,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn shr(a: u16, b: u4) -> u16 {
- \\ @shrExact(a, b)
+ \\ return @shrExact(a, b);
\\}
);
@@ -159,7 +159,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ const x = div0(999, 0);
\\}
\\fn div0(a: i32, b: i32) -> i32 {
- \\ @divTrunc(a, b)
+ \\ return @divTrunc(a, b);
\\}
);
@@ -173,7 +173,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn divExact(a: i32, b: i32) -> i32 {
- \\ @divExact(a, b)
+ \\ return @divExact(a, b);
\\}
);
@@ -187,7 +187,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x.len == 0) return error.Whatever;
\\}
\\fn widenSlice(slice: []align(1) const u8) -> []align(1) const i32 {
- \\ ([]align(1) const i32)(slice)
+ \\ return ([]align(1) const i32)(slice);
\\}
);
@@ -201,7 +201,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn shorten_cast(x: i32) -> i8 {
- \\ i8(x)
+ \\ return i8(x);
\\}
);
@@ -215,7 +215,7 @@ pub fn addCases(cases: &tests.CompareOutputContext) {
\\ if (x == 0) return error.Whatever;
\\}
\\fn unsigned_cast(x: i32) -> u32 {
- \\ u32(x)
+ \\ return u32(x);
\\}
);