diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-02 22:28:38 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-02 22:28:38 -0800 |
commit | 1f70fe65a943f3867c12895986bfbc63190981de (patch) | |
tree | e9e76a4256cd1fbfd3b325efae53a44ba6eb5d19 /tests | |
parent | 70a93a3622a27ddbf26771dfe2cac8153686e036 (diff) |
handle bitcasts etc. of call() idents +test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cases/sillybitcast.ll | 35 | ||||
-rw-r--r-- | tests/runner.py | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/cases/sillybitcast.ll b/tests/cases/sillybitcast.ll new file mode 100644 index 00000000..c5ca4f9a --- /dev/null +++ b/tests/cases/sillybitcast.ll @@ -0,0 +1,35 @@ +; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" +target triple = "i386-pc-linux-gnu" + +@.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] + +; [#uses=2] +define void @"\01_Z5hellov"() { +entry: + %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +; [#uses=1] +declare i32 @puts(i8*) + +; [#uses=0] +define i32 @main() { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @"\01_Z5hellov"() + store i32 0, i32* %0, align 4 + %1 = load i32* %0, align 4 ; [#uses=1] + store i32 %1, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} diff --git a/tests/runner.py b/tests/runner.py index aa22e06c..59e44102 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1110,6 +1110,7 @@ if 'benchmark' not in sys.argv: def test_cases(self): for name in os.listdir(path_from_root(['tests', 'cases'])): + print "Testing case '%s'..." % name.replace('.ll', '') self.do_ll_test(path_from_root(['tests', 'cases', name]), 'hello, world!') ### Integration tests |