35 lines
887 B
Plaintext
35 lines
887 B
Plaintext
dnl @ ../doc/m4.texinfo:6264: Origin of test
|
|
dnl @ expected status: 0
|
|
dnl @ extra options:
|
|
dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
|
|
dnl @ Foundation, Inc.
|
|
dnl @ This file is free software; the Free Software Foundation
|
|
dnl @ gives unlimited permission to copy and/or distribute it
|
|
dnl @ with or without modifications, as long as this notice
|
|
dnl @ is preserved.
|
|
eval(`-3 * 5')
|
|
dnl @result{}-15
|
|
eval(`-99 / 10')
|
|
dnl @result{}-9
|
|
eval(`-99 % 10')
|
|
dnl @result{}-9
|
|
eval(`99 % -10')
|
|
dnl @result{}9
|
|
eval(index(`Hello world', `llo') >= 0)
|
|
dnl @result{}1
|
|
eval(`0r1:0111 + 0b100 + 0r3:12')
|
|
dnl @result{}12
|
|
define(`square', `eval(`($1) ** 2')')
|
|
dnl @result{}
|
|
square(`9')
|
|
dnl @result{}81
|
|
square(square(`5')` + 1')
|
|
dnl @result{}676
|
|
define(`foo', `666')
|
|
dnl @result{}
|
|
eval(`foo / 6')
|
|
dnl @error{}m4:stdin:11: bad expression in eval: foo / 6
|
|
dnl @result{}
|
|
eval(foo / 6)
|
|
dnl @result{}111
|