Files
swift-mirror/test/DebugInfo/trap.swift
Duncan Exon Smith c6d42db070 Adapt to MD* => DI* renaming of debug info types
Applied the upgrade script from r236120 (LLVM) and r236121 (CFE).  This is the
final step of rdar://problem/20434113.



Swift SVN r27925
2015-04-29 21:40:21 +00:00

18 lines
495 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 : Int) -> Int {
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
}