Skip to content

Commit a228ce8

Browse files
committed
Add CI workflow to test null-safety feature
- Create test-null-safety.yml workflow that runs on push/PR - Builds clang with assertions enabled - Runs strict-nullability.c test suite via llvm-lit - Fails CI if null-safety tests fail - Add status badge to README showing test status Now the README will show a green badge if tests pass, red if failing!
1 parent b1957f2 commit a228ce8

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test Null-Safety
2+
3+
on:
4+
push:
5+
branches:
6+
- null-safe-c-dev
7+
pull_request:
8+
branches:
9+
- null-safe-c-dev
10+
workflow_dispatch:
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Install dependencies
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y ninja-build cmake build-essential
24+
25+
- name: Configure build
26+
run: |
27+
mkdir -p build
28+
cd build
29+
cmake -G Ninja \
30+
-DCMAKE_BUILD_TYPE=Release \
31+
-DLLVM_ENABLE_PROJECTS="clang" \
32+
-DLLVM_TARGETS_TO_BUILD="X86" \
33+
-DLLVM_ENABLE_ASSERTIONS=ON \
34+
-DLLVM_INCLUDE_TESTS=ON \
35+
../llvm
36+
37+
- name: Build Clang and test tools
38+
run: |
39+
cd build
40+
ninja clang FileCheck count not
41+
42+
- name: Run strict-nullability tests
43+
run: |
44+
cd build
45+
./bin/llvm-lit -v ../clang/test/Sema/strict-nullability.c
46+
47+
- name: Test results
48+
if: success()
49+
run: |
50+
echo "✅ All null-safety tests passed!"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Null-Safe Clang: An experimental C/C++ compiler
22

3+
[![Test Null-Safety](https://github.com/cs01/llvm-project/actions/workflows/test-null-safety.yml/badge.svg)](https://github.com/cs01/llvm-project/actions/workflows/test-null-safety.yml)
4+
35
An experimental Clang fork that adds flow-sensitive null safety to C and C++, inspired by modern languages like TypeScript, Kotlin, and Rust.
46

57
**Try it online:** [Interactive Playground](https://cs01.github.io/llvm-project/) - See null-safety warnings in real-time in your browser!

0 commit comments

Comments
 (0)