39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
# @TEST-EXEC: hiltic %INPUT -p -o noopt.hlt -g
|
|
# @TEST-EXEC: btest-diff noopt.hlt
|
|
#
|
|
# @TEST-EXEC: hiltic %INPUT -p -o opt.hlt -D optimizer > log 2>&1
|
|
# @TEST-EXEC: btest-diff opt.hlt
|
|
# @TEST-EXEC: btest-diff log
|
|
|
|
# @TEST-DOC: Tests optimizations removing unimplemented hooks.
|
|
|
|
module Foo {
|
|
|
|
declare public hook void global_unimplemented_void();
|
|
declare public hook void global_implemented();
|
|
declare public hook optional<int<64>> global_unimplemented_int64();
|
|
|
|
hook void global_implemented() {}
|
|
|
|
type X = struct {
|
|
hook void implemented(); # Called, implemented hook.
|
|
hook void unimplemented(); # Uncalled, unimplemented hook.
|
|
hook void unimplemented_void(); # Called, unimplemented hook.
|
|
hook optional<int<64>> unimplemented_int64(); # Called, unimplemented hook.
|
|
};
|
|
|
|
hook void X::implemented() {}
|
|
|
|
global_implemented();
|
|
|
|
global_unimplemented_void();
|
|
global i = global_unimplemented_int64();
|
|
|
|
global X x;
|
|
|
|
x.implemented();
|
|
x.unimplemented_void();
|
|
global j = x.unimplemented_int64();
|
|
|
|
}
|