File: type_spec.cr

package info (click to toggle)
crystal 1.6.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,956 kB
  • sloc: javascript: 1,712; sh: 592; cpp: 541; makefile: 243; ansic: 119; python: 105; xml: 32
file content (16 lines) | stat: -rw-r--r-- 408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "spec"
require "llvm"

describe LLVM::Type do
  describe ".const_int" do
    it "support Int64" do
      ctx = LLVM::Context.new
      ctx.int(64).const_int(Int64::MAX).to_s.should eq("i64 9223372036854775807")
    end

    it "support Int128" do
      ctx = LLVM::Context.new
      ctx.int(128).const_int(Int128::MAX).to_s.should eq("i128 170141183460469231731687303715884105727")
    end
  end
end