Files
swift-mirror/test/DebugInfo/trap.swift
Adrian Prantl 4f11ecc1da Get rid of Int in the debug info tests and preform some general cleanup.
<rdar://problem/20856296> Extinguish 'Int' from DebugInfo tests

Swift SVN r31177
2015-08-12 18:16:43 +00:00

18 lines
499 B
Swift

// RUN: %target-swift-frontend -parse-stdlib -primary-file %s -emit-ir -g -o - | FileCheck %s
import Swift
// CHECK: define{{.*}}1f
func f(x : Int64) -> Int64 {
if x < 23 {
// CHECK-DAG: call void @llvm.trap(), !dbg ![[LOC1:.*]]
// CHECK-DAG: ![[LOC1]] = !DILocation(line: [[@LINE+1]],
Builtin.int_trap()
}
if x > 42 {
// CHECK-DAG: ![[LOC2:.*]] = !DILocation(line: [[@LINE+1]],
Builtin.int_trap()
// CHECK-DAG: call void @llvm.trap(), !dbg ![[LOC2]]
}
return x
}