Skip to content

Commit 1e61fdd

Browse files
authored
Merge pull request #8815 from jketema/unreachable-test-case
C++: Add non-returning function test case using `__builtin_expect`
2 parents ebdf553 + 97d4a12 commit 1e61fdd

File tree

1 file changed

+5
-0
lines changed
  • cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114

1 file changed

+5
-0
lines changed

cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,8 @@ _Noreturn void f15();
105105
int f16() {
106106
f15(); // GOOD
107107
}
108+
109+
int f17() {
110+
if (__builtin_expect(1, 0))
111+
__builtin_unreachable(); // GOOD
112+
}

0 commit comments

Comments
 (0)