revng-db: ensure CreateFileA is exported once

This commit is contained in:
Alessandro Di Federico
2026-05-13 10:45:37 +02:00
parent 3b7a3c2fa8
commit 231f5ab90d
2 changed files with 36 additions and 0 deletions
@@ -0,0 +1,21 @@
#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
tags:
- name: db-invariants
sources:
- tags: [db-invariants]
prefix: share/revng/test/tests/db-invariants
members:
- no-createfilea-leak.sql
commands:
- type: revng-db.db-invariant-test
from:
- type: source
filter: db-invariants
command: |-
sqlite3 "$SOURCES_ROOT/share/revng/prototypes.sqlite" < "$INPUT"
| FileCheck "$INPUT"
@@ -0,0 +1,15 @@
--
-- This file is distributed under the MIT License. See LICENSE.md for details.
--
-- Ensure CreateFileA is only exported once (by the Fs partition).
SELECT COUNT(*)
FROM Symbol s
JOIN Library l ON l.LibraryID = s.LibraryID
JOIN Platform p ON p.PlatformID = l.PlatformID
WHERE s.Name = 'CreateFileA'
AND p.OperatingSystem = 'Windows'
AND l.Name NOT LIKE 'Fs%.pdb';
-- CHECK: {{^}}0{{$}}