summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-07-16 22:47:02 (EDT)
committer Sergey Prigogin2013-07-17 13:26:46 (EDT)
commitfe67ac9631bdd0ce07e163af7ac2109ab814a1c6 (patch)
tree728c3dd61106f25a06f93e2d0164420fe2e87ae0
parent55872baeae03498a580d8fc9dd5267b7a9dd4a37 (diff)
downloadorg.eclipse.cdt-fe67ac9631bdd0ce07e163af7ac2109ab814a1c6.zip
org.eclipse.cdt-fe67ac9631bdd0ce07e163af7ac2109ab814a1c6.tar.gz
org.eclipse.cdt-fe67ac9631bdd0ce07e163af7ac2109ab814a1c6.tar.bz2
Bug 389578 - __sync_bool_compare_and_swap andrefs/changes/10/14610/2
__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>
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java4
2 files changed, 13 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index f52ecf9..7f95fd9 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -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);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java
index ff0cd40..e594c3f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/GCCBuiltinSymbolProvider.java
@@ -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");