-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
362 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: %c-to-llvm -std=c2x %s | %apply-verifier -yaml 2>&1 | %filecheck %s | ||
|
||
// REQUIRES: !legacyllvm | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
struct SpecialBuiltInTypes { | ||
#if __clang_major__ >= 14 | ||
_BitInt(8) bitint8_var; | ||
_BitInt(16) bitint16_var; | ||
_BitInt(32) bitint32_var; | ||
#endif | ||
}; | ||
|
||
void foo() { | ||
struct SpecialBuiltInTypes types; | ||
} | ||
|
||
// CHECK: Members: | ||
// CHECK-NEXT: - Name: bitint8_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: _BitInt, Extent: 1, Encoding: signed_int } | ||
// CHECK-NEXT: - Name: bitint16_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: _BitInt, Extent: 2, Encoding: signed_int } | ||
// CHECK-NEXT: - Name: bitint32_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: _BitInt, Extent: 4, Encoding: signed_int } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// RUN: %c-to-llvm -std=c99 %s | %apply-verifier -yaml 2>&1 | %filecheck %s | ||
|
||
#include <complex.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
struct SpecialBuiltInTypes { | ||
_Bool boolean_var; // Boolean type (C99) | ||
|
||
// Complex types (from <complex.h>, C99) | ||
float complex float_complex_var; // Single-precision complex | ||
double complex double_complex_var; // Double-precision complex | ||
long double complex long_double_complex_var; // Extended-precision complex | ||
|
||
// float _Imaginary float_imaginary_var; // Single-precision imaginary | ||
// double _Imaginary double_imaginary_var; // Double-precision imaginary | ||
// long double _Imaginary long_double_imaginary_var; // Extended-precision imaginary | ||
|
||
// _Decimal32 decimal32_var; // 32-bit decimal floating-point | ||
// _Decimal64 decimal64_var; // 64-bit decimal floating-point | ||
// _Decimal128 decimal128_var; // 128-bit decimal floating-point | ||
}; | ||
|
||
void foo() { | ||
struct SpecialBuiltInTypes types; | ||
} | ||
|
||
// CHECK: Members: | ||
// CHECK-NEXT: - Name: boolean_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: {{bool|_Bool}}, Extent: 1, Encoding: bool } | ||
// CHECK-NEXT: - Name: float_complex_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: complex, Extent: 8, Encoding: complex } | ||
// CHECK-NEXT: - Name: double_complex_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: complex, Extent: 16, Encoding: complex } | ||
// CHECK-NEXT: - Name: long_double_complex_var | ||
// CHECK-NEXT: Builtin: true | ||
// CHECK-NEXT: Type: | ||
// CHECK-NEXT: Fundamental: { Name: complex, Extent: 32, Encoding: complex } |
Oops, something went wrong.