Browse Source

Added test for C11's atomic type support added in 54267b88a4.

pull/560/head
triton 10 years ago
parent
commit
7624635fa3
  1. 8
      src/Generator.Tests/AST/TestAST.cs
  2. 9
      tests/Native/AST.h

8
src/Generator.Tests/AST/TestAST.cs

@ -267,5 +267,13 @@ namespace CppSharp.Generator.Tests.AST @@ -267,5 +267,13 @@ namespace CppSharp.Generator.Tests.AST
.VisitLibrary(AstContext);
Assert.IsTrue(AstContext.FindClass("HasAmbiguousFunctions").Single().FindMethod("ambiguous").IsAmbiguous);
}
[Test]
public void TestAtomics()
{
var type = AstContext.FindClass("Atomics").Single().Fields
.Find(f => f.Name == "AtomicInt").Type as BuiltinType;
Assert.IsTrue(type != null && type.IsPrimitiveType(PrimitiveType.Int));
}
}
}

9
tests/Native/AST.h

@ -94,3 +94,12 @@ public: @@ -94,3 +94,12 @@ public:
void ambiguous();
void ambiguous() const;
};
class Atomics
{
#if defined( __clang__ ) && defined( __has_extension )
# if __has_extension( __c_atomic__ )
_Atomic(int) AtomicInt;
# endif
#endif
};
Loading…
Cancel
Save