Skip to content

Commit f3254ce

Browse files
committed
tests for todo diagnostic & static_assert
1 parent dea03c8 commit f3254ce

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-msvc -verify %s
2+
3+
// expected-error@+1 {{Itanium-compatible layout for the Microsoft C++ ABI is not yet supported}}
4+
struct {
5+
int a;
6+
} __attribute__((gcc_struct)) t1;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-msvc -fms-layout-compatibility=itanium -verify %s
2+
3+
// expected-error@+1 {{Itanium-compatible layout for the Microsoft C++ ABI is not yet supported}}
4+
struct {
5+
int a;
6+
} t1;

clang/test/CodeGen/gcc_struct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ struct {
77
int a : 24;
88
char b : 8;
99
} __attribute__((gcc_struct)) t1;
10-
static int a1[(sizeof(t1) == 4) - 1];
10+
_Static_assert(sizeof(t1) == 4, "");
1111

1212
#pragma ms_struct on
1313
struct {
1414
int a : 24;
1515
char b : 8;
1616
} __attribute__((gcc_struct)) t2;
17-
static int a2[(sizeof(t2) == 4) - 1];
17+
_Static_assert(sizeof(t2) == 4, "");
1818
#pragma ms_struct off

0 commit comments

Comments
 (0)