Skip to content

Commit 1a260f7

Browse files
committed
test: add test case for compiler intrinsic
1 parent 8046463 commit 1a260f7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

regression-tests/mixed-function-type-argument.cpp2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#include <cstddef>
2+
#if defined(_MSC_VER) || defined(__GNUC__)
3+
_: int == __builtin_bit_cast(const int, 0);
4+
#endif
25
main: () = {
36
_ = alignof(int);
47
_ = sizeof(int);

regression-tests/test-results/mixed-function-type-argument.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77

88
#line 1 "mixed-function-type-argument.cpp2"
99

10-
#line 16 "mixed-function-type-argument.cpp2"
10+
#line 19 "mixed-function-type-argument.cpp2"
1111
class t;
1212

1313

1414
//=== Cpp2 type definitions and function declarations ===========================
1515

1616
#line 1 "mixed-function-type-argument.cpp2"
1717
#include <cstddef>
18+
#if defined(_MSC_VER) || defined(__GNUC__)
19+
int inline constexpr _ = __builtin_bit_cast(int const, 0);
20+
#line 4 "mixed-function-type-argument.cpp2"
21+
#endif
1822
auto main() -> int;
1923

20-
#line 16 "mixed-function-type-argument.cpp2"
24+
#line 19 "mixed-function-type-argument.cpp2"
2125
class t {
2226
public: int a;
2327
};
@@ -27,7 +31,7 @@ class t {
2731

2832
#line 1 "mixed-function-type-argument.cpp2"
2933

30-
#line 2 "mixed-function-type-argument.cpp2"
34+
#line 5 "mixed-function-type-argument.cpp2"
3135
auto main() -> int{
3236
static_cast<void>(alignof(int));
3337
static_cast<void>(sizeof(int));

0 commit comments

Comments
 (0)