xref: /PHP-8.2/ext/ffi/tests/gh14286_2.phpt (revision c0de7214)
1--TEST--
2GH-14286 (ffi enum type (when enum has no name) make memory leak)
3--EXTENSIONS--
4ffi
5--SKIPIF--
6<?php
7if (PHP_DEBUG || getenv('SKIP_ASAN')) die("xfail: FFI cleanup after parser error is nor implemented");
8?>
9--INI--
10ffi.enable=1
11--FILE--
12<?php
13try {
14    $ffi = FFI::cdef("
15        enum {
16            TEST_ONE=1,
17            TEST_TWO=2,
18        } x;
19    ");
20} catch (Throwable $e) {
21    echo $e->getMessage(), "\n";
22}
23?>
24--EXPECT--
25Failed resolving C variable 'x'
26