Skip to content

Commit

Permalink
add typing-c package to haskell-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaf committed Dec 27, 2024
1 parent 3284895 commit 1f54608
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
echo "packages: $GITHUB_WORKSPACE/source/hs-bindgen" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/hs-bindgen-libclang" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/ansi-diff" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/typing-c" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -173,13 +174,16 @@ jobs:
echo "PKGDIR_hs_bindgen_libclang=${PKGDIR_hs_bindgen_libclang}" >> "$GITHUB_ENV"
PKGDIR_ansi_diff="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/ansi-diff-[0-9.]*')"
echo "PKGDIR_ansi_diff=${PKGDIR_ansi_diff}" >> "$GITHUB_ENV"
PKGDIR_typing_c="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/typing-c-[0-9.]*')"
echo "PKGDIR_typing_c=${PKGDIR_typing_c}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_hs_bindgen_patterns}" >> cabal.project
echo "packages: ${PKGDIR_hs_bindgen}" >> cabal.project
echo "packages: ${PKGDIR_hs_bindgen_libclang}" >> cabal.project
echo "packages: ${PKGDIR_ansi_diff}" >> cabal.project
echo "packages: ${PKGDIR_typing_c}" >> cabal.project
echo "package hs-bindgen-patterns" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package hs-bindgen" >> cabal.project
Expand Down Expand Up @@ -235,6 +239,8 @@ jobs:
${CABAL} -vnormal check
cd ${PKGDIR_hs_bindgen_libclang} || false
${CABAL} -vnormal check
cd ${PKGDIR_typing_c} || false
${CABAL} -vnormal check
cd ${PKGDIR_ansi_diff} || false
${CABAL} -vnormal check
- name: haddock
Expand Down
37 changes: 37 additions & 0 deletions typing-c/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@


typedef unsigned long long my_custom_type;

my_custom_type testFn1(my_custom_type x) {
return x;
}

/*
int myAddition (my_custom_type x, my_custom_type y);
int myAddition (my_custom_type x, my_custom_type y) {
(void)(+(x+y));
return 1;
}
#include <stddef.h>
#define bool _Bool
typedef struct { void **unused; } ty_1;
typedef struct { void **unused; } ty_2;
typedef unsigned long long mooly;
int testFunction (float *x_0, float *x_1) {
(void)(x_0-x_1);
return 0;
}
int myAddition (mooly x, mooly y) {
(void)(x+y);
return 1;
}
*/
22 changes: 22 additions & 0 deletions typing-c/test.c.clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
TranslationUnitDecl 0x20f9cf50288 <<invalid sloc>> <invalid sloc>
|-TypedefDecl 0x20f9cf50ab0 <<invalid sloc>> <invalid sloc> implicit __int128_t '__int128'
| `-BuiltinType 0x20f9cf50850 '__int128'
|-TypedefDecl 0x20f9cf50b20 <<invalid sloc>> <invalid sloc> implicit __uint128_t 'unsigned __int128'
| `-BuiltinType 0x20f9cf50870 'unsigned __int128'
|-TypedefDecl 0x20f9cf50e28 <<invalid sloc>> <invalid sloc> implicit __NSConstantString 'struct __NSConstantString_tag'
| `-RecordType 0x20f9cf50c00 'struct __NSConstantString_tag'
| `-Record 0x20f9cf50b78 '__NSConstantString_tag'
|-TypedefDecl 0x20f9cf50ec0 <<invalid sloc>> <invalid sloc> implicit __builtin_ms_va_list 'char *'
| `-PointerType 0x20f9cf50e80 'char *'
| `-BuiltinType 0x20f9cf50330 'char'
|-TypedefDecl 0x20f9cf50f30 <<invalid sloc>> <invalid sloc> implicit __builtin_va_list 'char *'
| `-PointerType 0x20f9cf50e80 'char *'
| `-BuiltinType 0x20f9cf50330 'char'
|-TypedefDecl 0x20f9cf50fa0 <typing-c\test.c:3:1, col:28> col:28 referenced my_custom_type 'unsigned long long'
| `-BuiltinType 0x20f9cf50470 'unsigned long long'
`-FunctionDecl 0x20f9cf51128 <line:5:1, line:7:1> line:5:16 testFn1 'my_custom_type (my_custom_type)'
|-ParmVarDecl 0x20f9cf51030 <col:24, col:39> col:39 used x 'my_custom_type':'unsigned long long'
`-CompoundStmt 0x20f9cf51260 <col:42, line:7:1>
`-ReturnStmt 0x20f9cf51250 <line:6:3, col:10>
`-ImplicitCastExpr 0x20f9cf51238 <col:10> 'my_custom_type':'unsigned long long' <LValueToRValue>
`-DeclRefExpr 0x20f9cf51218 <col:10> 'my_custom_type':'unsigned long long' lvalue ParmVar 0x20f9cf51030 'x' 'my_custom_type':'unsigned long long'
1 change: 1 addition & 0 deletions typing-c/typing-c.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build-type: Simple
common common
ghc-options:
-Wall
-Wno-unticked-promoted-constructors
default-extensions:
DataKinds
DerivingStrategies
Expand Down

0 comments on commit 1f54608

Please sign in to comment.