ソースを参照

added check for binops after inline

Nicolas Cannasse 15 年 前
コミット
b82c5752bb
1 ファイル変更8 行追加0 行削除
  1. 8 0
      tests/unit/TestMisc.hx

+ 8 - 0
tests/unit/TestMisc.hx

@@ -191,4 +191,12 @@ class TestMisc extends Test {
 		eq(o.blabla,3);
 	}
 
+	static inline function foo(x) return x + 5
+
+	function testInline() {
+		// check that operations are correctly generated
+		var x = 3; // prevent optimization
+		eq( 2 * foo(x), 16 );
+	}
+
 }