File: type_spec.cr

package info (click to toggle)
crystal 1.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,384 kB
  • sloc: javascript: 6,400; sh: 695; makefile: 269; ansic: 121; python: 105; cpp: 77; xml: 32
file content (23 lines) | stat: -rw-r--r-- 586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "spec"

{% if flag?(:interpreted) && !flag?(:win32) %}
  # TODO: figure out how to link against libstdc++ in interpreted code (#14398)
  pending LLVM::Type
  {% skip_file %}
{% end %}

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