Skip to content

Commit aecbd63

Browse files
committed
stdlib: add test case which checks that no trap instructions are generated for a Dictionary lookup
1 parent 8b11847 commit aecbd63

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %target-swift-frontend -O -emit-ir -parse-as-library -primary-file %s | %FileCheck %s
2+
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
3+
4+
5+
// A dictionary lookup should not contain any trap. Nothing can go wrong
6+
// from the user's perspective.
7+
8+
// CHECK-NOT: llvm.trap
9+
10+
public func testit(_ s: [Int : Int]) -> Int? {
11+
return s[27]
12+
}
13+

0 commit comments

Comments
 (0)