blob: 135e32976b7dcef9eabbc7d6359ebfd3081c7165 [file] [log] [blame]
Dan Gohmanc2853072015-09-03 22:51:53 +00001// RUN: %clang_cc1 -triple wasm32-unknown-unknown -O3 -emit-llvm -o - %s \
2// RUN: | FileCheck %s -check-prefix=WEBASSEMBLY32
3// RUN: %clang_cc1 -triple wasm64-unknown-unknown -O3 -emit-llvm -o - %s \
4// RUN: | FileCheck %s -check-prefix=WEBASSEMBLY64
5
Dan Gohmand4c5fb52015-10-02 19:38:47 +00006__SIZE_TYPE__ f1(void) {
Derek Schuffdbd24b42016-05-02 17:26:19 +00007 return __builtin_wasm_current_memory();
8// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.current.memory.i32()
9// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
Dan Gohmand4c5fb52015-10-02 19:38:47 +000010}
Dan Gohman266b38a2015-10-02 20:20:01 +000011
12void f2(long delta) {
Dan Gohman24f0a082015-11-05 20:16:37 +000013 __builtin_wasm_grow_memory(delta);
14// WEBASSEMBLY32: call void @llvm.wasm.grow.memory.i32(i32 %{{.*}})
15// WEBASSEMBLY64: call void @llvm.wasm.grow.memory.i64(i64 %{{.*}})
Dan Gohman266b38a2015-10-02 20:20:01 +000016}