X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=test%2FCodeGen%2FWebAssembly%2Freturned.ll;h=9cfdc711a8a3b7792db878fb25706f639e9153b5;hp=d65e2a8bc3e5a755d210dbe1aedfc55ab4348588;hb=9eb92586b28e7d951f0ac320045885a320f2a0ab;hpb=39f84fda2f1b44f926a313e138721d4b14d00da7 diff --git a/test/CodeGen/WebAssembly/returned.ll b/test/CodeGen/WebAssembly/returned.ll index d65e2a8bc3e..9cfdc711a8a 100644 --- a/test/CodeGen/WebAssembly/returned.ll +++ b/test/CodeGen/WebAssembly/returned.ll @@ -33,3 +33,17 @@ entry: %call = tail call i8* @memcpy(i8* %p, i8* %s, i32 %n) ret i8* %p } + +; Test that the optimization isn't performed on constant arguments. + +; CHECK-LABEL: test_constant_arg: +; CHECK-NEXT: i32.const $push0=, global{{$}} +; CHECK-NEXT: call $discard=, returns_arg, $pop0{{$}} +; CHECK-NEXT: return{{$}} +@global = external global i32 +@addr = global i32* @global +define void @test_constant_arg() { + %call = call i32* @returns_arg(i32* @global) + ret void +} +declare i32* @returns_arg(i32* returned)