diff --git a/.appveyor.yml b/.appveyor.yml index 1477d74..d7de4c5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,7 @@ version: "{build}" branches: except: - - /^(wip\/)?(travis|osx)(\-.+)?$/ + - /^(wip\/)?(travis|osx|gha)(\-.+)?$/ environment: matrix: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..899f2d1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +on: + push: + branches-ignore: + - 'ci/**' + - '!ci/gha**' + - 'dependabot/**' + pull_request: + branches: + - 'master' + +jobs: + pelles-c: + runs-on: windows-latest + strategy: + matrix: + version: + # https://community.chocolatey.org/packages/pelles-c#versionhistory + - "12.0.2" + # - "11.0.2" + # - "10.0.6" + # - "9.00.0.0" + # - "8.00.0.0" + steps: + - uses: actions/checkout@v2 + - name: Install Pelles-C + uses: crazy-max/ghaction-chocolatey@v3 + with: + args: install pelles-c --version "${{ matrix.version }}" --no-progress + - name: Install Windows SDK + uses: crazy-max/ghaction-chocolatey@v3 + with: + args: install windows-sdk-10.0 --no-progress + - name: Print Env + run: 'Get-ChildItem Env:' + # - name: Find kernel32.lib + # # run: dir /s kernel32.lib + # run: Get-ChildItem -Path C:\ -Filter kernel32.lib -Recurse -ErrorAction SilentlyContinue -Force + # working-directory: 'C:\' + - name: Compile + env: + CC: 'C:\Program Files\PellesC\bin\pocc.exe' + LD: 'C:\Program Files\PellesC\bin\polink.exe' + CFLAGS: '/IC:\Progra~1\PellesC\Include' + LDFLAGS: '/LIBPATH:C:\Progra~1\PellesC\lib /LIBPATH:C:\Progra~1\PellesC\Lib\Win' + working-directory: test + run: make -f Makefile.pelles + + nvhpc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install NVidia HPC SDK + run: | + curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg + echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list + sudo apt-get update -y + sudo apt-get install -y nvhpc + - name: Compile + env: + CC: /opt/nvidia/hpc_sdk/Linux_x86_64/*.*/compilers/bin/nvcc + working-directory: test + run: make diff --git a/test/Makefile b/test/Makefile index d00426e..ee7edce 100644 --- a/test/Makefile +++ b/test/Makefile @@ -9,10 +9,10 @@ else ifeq ($(notdir $(CC)), suncc) else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),armcl cl2000 cl430 cl6x cl7x clpru)) CFLAGS ?= --display_error_number --emit_warnings_as_errors --issue_remarks -i $(dir $(shell readlink -f $(shell which $(CC))))../include C_OUTPUT_FILE := --output_file= -else ifeq ($(notdir $(CC)), pgcc) +else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),pgcc nvcc)) CFLAGS ?= -Minform=inform -c11 C_OUTPUT_FILE := -o -else ifeq ($(notdir $(CC)), pgc++) +else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),pgc++ nvc++)) CFLAGS ?= --display_error_number -Minform=inform -Werror C_OUTPUT_FILE := -o else ifeq ($(notdir $(CC)), xlc) @@ -249,12 +249,12 @@ Makefile.icl: Makefile Makefile.pelles: Makefile @echo -e "# Generated by Makefile. Do not edit.\r" > $@ - @echo -e "CC = pocc\r" >> $@ - @echo -e "LD = polink\r" >> $@ + @echo -e "CC ?= pocc\r" >> $@ + @echo -e "LD ?= polink\r" >> $@ @echo -e "\r" >> $@ - @echo -e "CFLAGS = \r" >> $@ - @echo -e "LDFLAGS = \r" >> $@ + @echo -e "CFLAGS ?= \r" >> $@ + @echo -e "LDFLAGS ?= \r" >> $@ @echo -e "\r" >> $@ @echo -e "TESTS = \x5c\r" >> $@ diff --git a/test/Makefile.pelles b/test/Makefile.pelles index 0ecd1ae..2df9f28 100644 --- a/test/Makefile.pelles +++ b/test/Makefile.pelles @@ -1,17 +1,19 @@ # Generated by Makefile. Do not edit. -CC = pocc -LD = polink +CC ?= pocc +LD ?= polink -CFLAGS = -LDFLAGS = +CFLAGS ?= +LDFLAGS ?= TESTS = \ array-param.exe \ assume.exe \ cast.exe \ + concat.exe \ const.exe \ constant.exe \ deprecated.exe \ + empty-bases.exe \ fallthrough.exe \ flags.exe \ inline.exe \ @@ -19,6 +21,7 @@ TESTS = \ malloc.exe \ message.exe \ noinline.exe \ + no-escape.exe \ no-return.exe \ non-null.exe \ predict.exe \ @@ -30,9 +33,11 @@ TESTS = \ sentinel.exe \ static-assert.exe \ stringify.exe \ + unknown-cpp-attributes.exe \ unknown-pragmas.exe \ unavailable.exe \ unreachable.exe \ + unused-function.exe \ visibility.exe \ warn.exe \ warn-unused-result.exe \ @@ -42,9 +47,11 @@ CLEANFILES = $(TESTS) \ array-param.obj array-param.exe \ assume.obj assume.exe \ cast.obj cast.exe \ + concat.obj concat.exe \ const.obj const.exe \ constant.obj constant.exe \ deprecated.obj deprecated.exe \ + empty-bases.obj empty-bases.exe \ fallthrough.obj fallthrough.exe \ flags.obj flags.exe \ inline.obj inline.exe \ @@ -52,6 +59,7 @@ CLEANFILES = $(TESTS) \ malloc.obj malloc.exe \ message.obj message.exe \ noinline.obj noinline.exe \ + no-escape.obj no-escape.exe \ no-return.obj no-return.exe \ non-null.obj non-null.exe \ predict.obj predict.exe \ @@ -63,9 +71,11 @@ CLEANFILES = $(TESTS) \ sentinel.obj sentinel.exe \ static-assert.obj static-assert.exe \ stringify.obj stringify.exe \ + unknown-cpp-attributes.obj unknown-cpp-attributes.exe \ unknown-pragmas.obj unknown-pragmas.exe \ unavailable.obj unavailable.exe \ unreachable.obj unreachable.exe \ + unused-function.obj unused-function.exe \ visibility.obj visibility.exe \ warn.obj warn.exe \ warn-unused-result.obj warn-unused-result.exe \ @@ -94,6 +104,12 @@ cast.obj: cast.c cast.exe: cast.obj $(LD) $(LDFLAGS) /OUT:cast.exe cast.obj +concat.obj: concat.c + $(CC) $(CFLAGS) concat.c + +concat.exe: concat.obj + $(LD) $(LDFLAGS) /OUT:concat.exe concat.obj + const.obj: const.c $(CC) $(CFLAGS) const.c @@ -112,6 +128,12 @@ deprecated.obj: deprecated.c deprecated.exe: deprecated.obj $(LD) $(LDFLAGS) /OUT:deprecated.exe deprecated.obj +empty-bases.obj: empty-bases.c + $(CC) $(CFLAGS) empty-bases.c + +empty-bases.exe: empty-bases.obj + $(LD) $(LDFLAGS) /OUT:empty-bases.exe empty-bases.obj + fallthrough.obj: fallthrough.c $(CC) $(CFLAGS) fallthrough.c @@ -154,6 +176,12 @@ noinline.obj: noinline.c noinline.exe: noinline.obj $(LD) $(LDFLAGS) /OUT:noinline.exe noinline.obj +no-escape.obj: no-escape.c + $(CC) $(CFLAGS) no-escape.c + +no-escape.exe: no-escape.obj + $(LD) $(LDFLAGS) /OUT:no-escape.exe no-escape.obj + no-return.obj: no-return.c $(CC) $(CFLAGS) no-return.c @@ -220,6 +248,12 @@ stringify.obj: stringify.c stringify.exe: stringify.obj $(LD) $(LDFLAGS) /OUT:stringify.exe stringify.obj +unknown-cpp-attributes.obj: unknown-cpp-attributes.c + $(CC) $(CFLAGS) unknown-cpp-attributes.c + +unknown-cpp-attributes.exe: unknown-cpp-attributes.obj + $(LD) $(LDFLAGS) /OUT:unknown-cpp-attributes.exe unknown-cpp-attributes.obj + unknown-pragmas.obj: unknown-pragmas.c $(CC) $(CFLAGS) unknown-pragmas.c @@ -238,6 +272,12 @@ unreachable.obj: unreachable.c unreachable.exe: unreachable.obj $(LD) $(LDFLAGS) /OUT:unreachable.exe unreachable.obj +unused-function.obj: unused-function.c + $(CC) $(CFLAGS) unused-function.c + +unused-function.exe: unused-function.obj + $(LD) $(LDFLAGS) /OUT:unused-function.exe unused-function.obj + visibility.obj: visibility.c $(CC) $(CFLAGS) visibility.c