mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Passing a non-conststring to module attributes like @cname would trigger an assert rather than printing an error.
- Passing different types to arg 1 and 2 for $$matrix_transpose would trigger an assert. - Zero init of optional compile time variable would crash the compiler. - Using multiple declaration for generics in generic module would fail. - Defining an extern const without a type would crash rather than print an error. - Typedef followed by brace would trigger an assert. - Union with too big member would trigger an assert.
This commit is contained in:
5
test/test_suite/attributes/string_module_attributes.c3
Normal file
5
test/test_suite/attributes/string_module_attributes.c3
Normal file
@@ -0,0 +1,5 @@
|
||||
module linux @cname(NETBSD ??? "" : ""); // #error: Expected a constant string
|
||||
fn int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
6
test/test_suite/builtins/matrix_builtin_cast.c3
Normal file
6
test/test_suite/builtins/matrix_builtin_cast.c3
Normal file
@@ -0,0 +1,6 @@
|
||||
fn int main()
|
||||
{
|
||||
int[<6>] c = 2;
|
||||
c = $$matrix_transpose(c, 0x10, 3); // #error: Expected row * col to equal 6
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fn void main()
|
||||
{
|
||||
char? a, $b;
|
||||
}
|
||||
11
test/test_suite/generic/generic_multiple_decl.c3t
Normal file
11
test/test_suite/generic/generic_multiple_decl.c3t
Normal file
@@ -0,0 +1,11 @@
|
||||
module elastic_array <Type, MAX_SIZE>;
|
||||
int a, b, c;
|
||||
module bar;
|
||||
import elastic_array;
|
||||
fn int main()
|
||||
{
|
||||
int g = elastic_array::a{int, 2};
|
||||
int g2 = elastic_array::b{int, 2};
|
||||
elastic_array::b{int, 2} = 3;
|
||||
return 0;
|
||||
}
|
||||
1
test/test_suite/globals/extern_const_no_type.c3
Normal file
1
test/test_suite/globals/extern_const_no_type.c3
Normal file
@@ -0,0 +1 @@
|
||||
extern const FOO; // #error: A type is needed for the extern constant 'FOO'
|
||||
2
test/test_suite/types/typedef_followed_by_brace.c3
Normal file
2
test/test_suite/types/typedef_followed_by_brace.c3
Normal file
@@ -0,0 +1,2 @@
|
||||
typedef Bar = BacktraceList? // #error: Expected ';'
|
||||
{
|
||||
4
test/test_suite/union/union_too_big.c3
Normal file
4
test/test_suite/union/union_too_big.c3
Normal file
@@ -0,0 +1,4 @@
|
||||
union Xu
|
||||
{
|
||||
int[int.max] b; // #error: Union member 'b' would cause the union to become too large
|
||||
}
|
||||
Reference in New Issue
Block a user