mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-02 21:23:37 +02:00
parent
a4ba7173e8
commit
cf834dd838
2 changed files with 23 additions and 0 deletions
|
@ -474,4 +474,13 @@ public class GCCCompleteParseExtensionsTest extends AST2TestBase {
|
||||||
parseGCC(code);
|
parseGCC(code);
|
||||||
parseGPP(code);
|
parseGPP(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void test() {
|
||||||
|
// !__builtin_add_overflow_p(1,2,3);
|
||||||
|
// }
|
||||||
|
public void testIntegerOverflowBuiltin_bug271() throws Exception {
|
||||||
|
String code = getAboveComment();
|
||||||
|
parseGCC(code);
|
||||||
|
parseGPP(code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,6 +190,20 @@ public class GCCBuiltinSymbolProvider implements IBuiltinBindingsProvider {
|
||||||
function("bool", "__atomic_always_lock_free", "size_t", "void*");
|
function("bool", "__atomic_always_lock_free", "size_t", "void*");
|
||||||
function("bool", "__atomic_is_lock_free", "size_t", "void*");
|
function("bool", "__atomic_is_lock_free", "size_t", "void*");
|
||||||
|
|
||||||
|
// Integer Overflow Builtins (https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html)
|
||||||
|
for (String op : new String[] { "add", "sub", "mul" }) {
|
||||||
|
function("bool", "__builtin_" + op + "_overflow", "", "", "void*");
|
||||||
|
function("bool", "__builtin_" + op + "_overflow_p", "", "", "");
|
||||||
|
function("bool", "__builtin_s" + op + "_overflow", "int", "int", "int*");
|
||||||
|
function("bool", "__builtin_s" + op + "l_overflow", "long int", "long int", "long int*");
|
||||||
|
function("bool", "__builtin_s" + op + "ll_overflow", "long long int", "long long int", "long long int*");
|
||||||
|
function("bool", "__builtin_u" + op + "_overflow", "unsigned int", "unsigned int", "unsigned int*");
|
||||||
|
function("bool", "__builtin_u" + op + "l_overflow", "unsigned long int", "unsigned long int",
|
||||||
|
"unsigned long int*");
|
||||||
|
function("bool", "__builtin_u" + op + "ll_overflow", "unsigned long long int", "unsigned long long int",
|
||||||
|
"unsigned long long int*");
|
||||||
|
}
|
||||||
|
|
||||||
ICPPExecution builtinFfs = new ExecBuiltin(ExecBuiltin.BUILTIN_FFS);
|
ICPPExecution builtinFfs = new ExecBuiltin(ExecBuiltin.BUILTIN_FFS);
|
||||||
ICPPExecution builtinFfsl = new ExecBuiltin(ExecBuiltin.BUILTIN_FFSL);
|
ICPPExecution builtinFfsl = new ExecBuiltin(ExecBuiltin.BUILTIN_FFSL);
|
||||||
ICPPExecution builtinFfsll = new ExecBuiltin(ExecBuiltin.BUILTIN_FFSLL);
|
ICPPExecution builtinFfsll = new ExecBuiltin(ExecBuiltin.BUILTIN_FFSLL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue