Skip to content

Commit 165d377

Browse files
committed
add lit based tests
1 parent 6de5334 commit 165d377

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

test/codegen/PTX/atomics-i128.ll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
define void @test(ptr %a) nounwind {git
1+
; RUN: gpuc %s 2>&1 | FileCheck %s
2+
3+
; CHECK: ERROR: LoadError: LLVM error: Undefined external symbol "__sync_val_compare_and_swap_16"
4+
define void @test(ptr %a) nounwind {
25
%1 = load atomic i128, ptr %a seq_cst, align 16
36
store atomic i128 %1, ptr %a seq_cst, align 16
47
ret void

test/codegen/gpuc.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using GPUCompiler
22
import LLVM
3+
using Test # for helpers/precompile.jl
34

45
if !GPUCompiler.__llvm_initialized[]
5-
InitializeAllTargets()
6-
InitializeAllTargetInfos()
7-
InitializeAllAsmPrinters()
8-
InitializeAllAsmParsers()
9-
InitializeAllTargetMCs()
6+
LLVM.InitializeAllTargets()
7+
LLVM.InitializeAllTargetInfos()
8+
LLVM.InitializeAllAsmPrinters()
9+
LLVM.InitializeAllAsmParsers()
10+
LLVM.InitializeAllTargetMCs()
1011
GPUCompiler.__llvm_initialized[] = true
1112
end
1213

@@ -22,7 +23,7 @@ end
2223
job, _ = PTX.create_job(identity, (Int,))
2324

2425
asm, meta = JuliaContext(opaque_pointers=true) do ctx
25-
ir = parse(LLVM.Module, readfile(ARGS[end]))
26+
ir = parse(LLVM.Module, read(ARGS[end], String))
2627
GPUCompiler.emit_asm(job, ir, LLVM.API.LLVMAssemblyFile)
2728
end
2829

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ for (rootpath, dirs, files) in walkdir(@__DIR__)
5656
end
5757
isempty(files) && continue
5858
basename(rootpath) == "helpers" && continue
59+
basename(rootpath) == "codegen" && continue
5960

6061
# strip extension
6162
files = map(files) do file

0 commit comments

Comments
 (0)