summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-04-02 00:00:00 +0000
committerChristoph Reiter <reiter.christoph@gmail.com>2018-06-23 11:20:13 +0200
commitda426f7672b9c88658685aaf5cef948e02eb8c01 (patch)
tree8ebe55c7bc67859ece5316b399409d2f33ed9c42 /tests
parent864c9a0aac9c8d588f393f2f0fa9d438bd8baa10 (diff)
downloadgobject-introspection-da426f7672b9c88658685aaf5cef948e02eb8c01.tar.gz
Recognize additional basic types from ISO/IEC TS 18661-3:2015.
Recognize additional floating point types from ISO/IEC TS 18661-3:2015, that are already in use by glibc. This continues work from commit 8cf3e8e5cf6d0d49db359f50c6eb0bc9ca22fbef and fixes issue #201. * _Float16 * _Float32 * _Float64 * _Float128 * _Float32x * _Float64x * _Float128x Use a single BASIC_TYPE token for basic types, while using its string representation as a type name. This also fixes incorrect type used previously for __uint128_t, __int128_t, __uint128, __int128, and _Float128 (they have been mapped to int and float respectively). Also avoid mapping bool and _Bool to gboolean as those are distinct types and generally ABI incompatible. Fixes issue #202. After this changes, when _Bool, _Float* or _int128 types are used as a part of public API, g-ir-scanner will produce warning about unresolved type. This is appropriate given that they are currently inexpressible in GIRepository format.
Diffstat (limited to 'tests')
-rw-r--r--tests/warn/unresolved-type.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/tests/warn/unresolved-type.h b/tests/warn/unresolved-type.h
index d20182c8..7265753c 100644
--- a/tests/warn/unresolved-type.h
+++ b/tests/warn/unresolved-type.h
@@ -1,23 +1,50 @@
+#include <stdbool.h>
#include "common.h"
typedef struct {
int i;
} MyStruct;
-// EXPECT:5: Warning: Test: symbol='MyStruct': Unknown namespace for identifier 'MyStruct'
+// EXPECT:6: Warning: Test: symbol='MyStruct': Unknown namespace for identifier 'MyStruct'
typedef enum {
TEST_MY_ENUM_A = 0
} MyEnum;
-// EXPECT:11: Warning: Test: symbol='MyEnum': Unknown namespace for identifier 'MyEnum'
+// EXPECT:12: Warning: Test: symbol='MyEnum': Unknown namespace for identifier 'MyEnum'
typedef enum {
MY_ENUM_A = 0
} TestMyEnum2;
-// EXPECT:17: Warning: Test: symbol='TestMyEnum2': Unknown namespace for symbol 'MY_ENUM_A'
+// EXPECT:18: Warning: Test: symbol='TestMyEnum2': Unknown namespace for symbol 'MY_ENUM_A'
-/* Stub function here so namespace isn't empty */
-void test_foo (void);
+void test_bool1 (_Bool b);
+// EXPECT:22: Warning: Test: test_bool1: argument b: Unresolved type: '_Bool'
+
+void test_bool2 (bool b);
+// EXPECT:25: Warning: Test: test_bool2: argument b: Unresolved type: '_Bool'
+
+void test_bool3 (gboolean b);
+
+void test_f16 (_Float16 f);
+// EXPECT:30: Warning: Test: test_f16: argument f: Unresolved type: '_Float16'
+
+void test_f32 (_Float32 f);
+// EXPECT:33: Warning: Test: test_f32: argument f: Unresolved type: '_Float32'
+
+void test_f64 (_Float64 f);
+// EXPECT:36: Warning: Test: test_f64: argument f: Unresolved type: '_Float64'
+
+void test_f128 (_Float128 f);
+// EXPECT:39: Warning: Test: test_f128: argument f: Unresolved type: '_Float128'
+
+void test_f32x (_Float32x f);
+// EXPECT:42: Warning: Test: test_f32x: argument f: Unresolved type: '_Float32x'
+
+void test_f64x (_Float64x f);
+// EXPECT:45: Warning: Test: test_f64x: argument f: Unresolved type: '_Float64x'
+
+void test_f128x (_Float128x f);
+// EXPECT:48: Warning: Test: test_f128x: argument f: Unresolved type: '_Float128x'