1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Bug 389578 - __sync_bool_compare_and_swap and

__sync_val_compare_and_swap buitlins not recognized by codan 

Change-Id: If72c0fcc631305eb6fd9251658f40e930beb48a0
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Reviewed-on: https://git.eclipse.org/r/14610
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2013-07-16 22:47:02 -04:00 committed by Sergey Prigogin
parent 55872baeae
commit fe67ac9631
2 changed files with 13 additions and 1 deletions

View file

@ -10312,4 +10312,14 @@ public class AST2CPPTests extends AST2TestBase {
ICPPClassType privateNestedClass = bh.assertNonProblem("privateNestedClass");
assertVisibility(ICPPClassType.v_private, aClass.getVisibility(privateNestedClass));
}
// int main() {
// int i = 0;
// __sync_bool_compare_and_swap(& i, 0, 1);
// __sync_val_compare_and_swap(&i, 1, 2);
// __sync_synchronize();
// }
public void testGNUSyncBuiltins_bug389578() throws Exception {
parseAndCheckBindings(getAboveComment(), CPP, true);
}
}

View file

@ -133,7 +133,9 @@ public class GCCBuiltinSymbolProvider implements IBuiltinBindingsProvider {
function(type, "__sync_xor_and_fetch", typePtr, type, "...");
function(type, "__sync_nand_and_fetch", typePtr, type, "...");
function(type, "__sync_lock_test_and_set", typePtr, type, "...");
function(type, "__sync_lock_release", typePtr, "...");
function(type, "__sync_val_compare_and_swap", typePtr, type, type, "...");
function("bool", "__sync_bool_compare_and_swap", typePtr, type, type, "...");
function("void", "__sync_lock_release", typePtr, "...");
}
function("void", "__sync_synchronize");