Skip to content

Commit

Permalink
Add negative test
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrn committed Sep 20, 2024
1 parent 4553484 commit 14a876d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/test/Analysis/Lint/const-store.ll
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
; RUN: not opt --mtriple=amdgcn --passes=lint --lint-abort-on-error %s -o - |& FileCheck %s
; RUN: not opt --mtriple=amdgcn --mcpu=gfx1030 --passes=lint --lint-abort-on-error %s -o - |& FileCheck %s
; RUN: opt --mtriple=x86_64 --passes=lint --lint-abort-on-error %s -o /dev/null |& FileCheck %s --allow-empty --check-prefix=NOERR

define amdgpu_kernel void @store_const(ptr addrspace(4) %out, i32 %a, i32 %b) {
; NOERR: {{^$}}
; CHECK: Undefined behavior: Write to const memory
; CHECK-NEXT: store i32 %r, ptr addrspace(4) %out
%r = add i32 %a, %b
Expand Down

0 comments on commit 14a876d

Please sign in to comment.