瀏覽代碼

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 );
+	}
+
 }