diff --git a/samples/outputs.var_names/sample58 b/samples/outputs.var_names/sample58 index b7c2ff6..192cf58 100644 --- a/samples/outputs.var_names/sample58 +++ b/samples/outputs.var_names/sample58 @@ -11,64 +11,8 @@ FUNC_DECL SCALAR_TYPE (INT) VAR (y_1) NO_INITIALIZATION - DECL_STMT - SCALAR_TYPE (INT) - VAR (c_2) - VAR_EXPR - VAR (var0) - IF_STMT - EQUALS_EXPR - INT_CONST (0) - VAR_EXPR - VAR (c_2) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (c_3) - FLOAT_CONST (2) - STMT_BLOCK - IF_STMT - EQUALS_EXPR - INT_CONST (1) - VAR_EXPR - VAR (c_2) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (c_4) - FLOAT_CONST (3) - STMT_BLOCK - IF_STMT - EQUALS_EXPR - INT_CONST (2) - VAR_EXPR - VAR (c_2) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (c_5) - FLOAT_CONST (5) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (c_6) - FLOAT_CONST (2) void bar (int arg0) { int var0 = arg0; int y_1; - int c_2 = var0; - if (0 == c_2) { - float c_3 = 2.0f; - } else { - if (1 == c_2) { - float c_4 = 3.0f; - } else { - if (2 == c_2) { - float c_5 = 5.0f; - } else { - float c_6 = 2.0f; - } - } - } } diff --git a/samples/outputs/sample58 b/samples/outputs/sample58 index 7dbb89f..47a5755 100644 --- a/samples/outputs/sample58 +++ b/samples/outputs/sample58 @@ -11,64 +11,8 @@ FUNC_DECL SCALAR_TYPE (INT) VAR (var1) NO_INITIALIZATION - DECL_STMT - SCALAR_TYPE (INT) - VAR (var2) - VAR_EXPR - VAR (var0) - IF_STMT - EQUALS_EXPR - INT_CONST (0) - VAR_EXPR - VAR (var2) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (var3) - FLOAT_CONST (2) - STMT_BLOCK - IF_STMT - EQUALS_EXPR - INT_CONST (1) - VAR_EXPR - VAR (var2) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (var4) - FLOAT_CONST (3) - STMT_BLOCK - IF_STMT - EQUALS_EXPR - INT_CONST (2) - VAR_EXPR - VAR (var2) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (var5) - FLOAT_CONST (5) - STMT_BLOCK - DECL_STMT - SCALAR_TYPE (FLOAT) - VAR (var6) - FLOAT_CONST (2) void bar (int arg0) { int var0 = arg0; int var1; - int var2 = var0; - if (0 == var2) { - float var3 = 2.0f; - } else { - if (1 == var2) { - float var4 = 3.0f; - } else { - if (2 == var2) { - float var5 = 5.0f; - } else { - float var6 = 2.0f; - } - } - } } diff --git a/samples/sample58.cpp b/samples/sample58.cpp index 099e6b9..901b579 100644 --- a/samples/sample58.cpp +++ b/samples/sample58.cpp @@ -8,16 +8,6 @@ using builder::dyn_var; using builder::static_var; -static static_var magic(dyn_var x, int range) { - for (static_var y = 0; y < range; y++) { - if (y == x) return y; - } - return 0; -} - - -float arr[] = {2.0, 3.0, 5.0}; - static void bar(dyn_var x) { /* Test out of order deinitialization of static variables and arrays */ @@ -37,13 +27,9 @@ static void bar(dyn_var x) { delete sv2; delete sva1; delete sva2; - - - // Test case that breaks without out of order deinitialization - static_var z = magic(x, 3); - dyn_var c = arr[z]; - - + + // A realistic test is hard to get right (depends on rv-optimizations) + // so we will just stick with this simple one above }