2015-09-04 06:51:53 +08:00
|
|
|
// RUN: %clang_cc1 -triple wasm32-unknown-unknown -O3 -emit-llvm -o - %s \
|
|
|
|
// RUN: | FileCheck %s -check-prefix=WEBASSEMBLY32
|
|
|
|
// RUN: %clang_cc1 -triple wasm64-unknown-unknown -O3 -emit-llvm -o - %s \
|
|
|
|
// RUN: | FileCheck %s -check-prefix=WEBASSEMBLY64
|
|
|
|
|
2015-10-03 03:38:47 +08:00
|
|
|
__SIZE_TYPE__ f1(void) {
|
2016-05-03 01:26:19 +08:00
|
|
|
return __builtin_wasm_current_memory();
|
|
|
|
// WEBASSEMBLY32: call {{i.*}} @llvm.wasm.current.memory.i32()
|
|
|
|
// WEBASSEMBLY64: call {{i.*}} @llvm.wasm.current.memory.i64()
|
2015-10-03 03:38:47 +08:00
|
|
|
}
|
2015-10-03 04:20:01 +08:00
|
|
|
|
|
|
|
void f2(long delta) {
|
2015-11-06 04:16:37 +08:00
|
|
|
__builtin_wasm_grow_memory(delta);
|
|
|
|
// WEBASSEMBLY32: call void @llvm.wasm.grow.memory.i32(i32 %{{.*}})
|
|
|
|
// WEBASSEMBLY64: call void @llvm.wasm.grow.memory.i64(i64 %{{.*}})
|
2015-10-03 04:20:01 +08:00
|
|
|
}
|