mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Upgrade of mingw in CI. Fix problems using reflection on interface types #1203. Improved debug information on defer. $foreach doesn't create an implicit syntactic scope. Error if `@if` depends on `@if`. Updated Linux stacktrace. Fix of default argument stacktrace. Allow linking libraries directly by file path. Improve inlining warning messages. Added `index_of_char_from`. Compiler crash using enum nameof from different module #1205. Removed unused fields in find_msvc. Use vswhere to find msvc. Update tests for LLVM 19
51 lines
931 B
Plaintext
51 lines
931 B
Plaintext
module test;
|
|
|
|
fn bool test1(uint x)
|
|
{
|
|
return x < 0; // #error: Comparing 'unsigned expression < 0' can never be true
|
|
}
|
|
|
|
fn bool test2(uint x)
|
|
{
|
|
return x <= 0; // #error: 'unsigned expression <= 0' is the same as expr == 0
|
|
}
|
|
|
|
fn bool test22(uint x)
|
|
{
|
|
return x >= 0; // #error: 'unsigned expression >= 0'
|
|
}
|
|
|
|
fn bool test3(uint x)
|
|
{
|
|
return x == -1; // #error: Comparing an unsigned value with a negative constant
|
|
}
|
|
|
|
fn bool test4(uint x)
|
|
{
|
|
return 0 > x ; // #error: '0 > unsigned expression' can never be true
|
|
}
|
|
|
|
fn bool test5(uint x)
|
|
{
|
|
return 0 >= x; // #error: '0 >= unsigned expression' is the same as 0 == expr
|
|
}
|
|
|
|
fn bool test55(uint x)
|
|
{
|
|
return 0 <= x; // #error: '0 <= unsigned expression'
|
|
}
|
|
|
|
fn bool test6(uint x)
|
|
{
|
|
return -1 == x; // #error: an unsigned value with a negative constant
|
|
}
|
|
|
|
macro obfuscate(x, $foo)
|
|
{
|
|
return $foo == x;
|
|
}
|
|
|
|
fn bool test7(uint x)
|
|
{
|
|
return obfuscate(x, -1);
|
|
} |