mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Applied the upgrade script from r236120 (LLVM) and r236121 (CFE). This is the final step of rdar://problem/20434113. Swift SVN r27925
37 lines
1.1 KiB
Swift
37 lines
1.1 KiB
Swift
// RUN: %target-swift-frontend %s -emit-ir -g -o %t.ll
|
|
// RUN: FileCheck %s < %t.ll
|
|
|
|
var puzzleInput = "great minds think alike"
|
|
var puzzleOutput = ""
|
|
// CHECK-NOT: !DILocalVariable(tag: DW_TAG_auto_variable, name: "$letter$generator"
|
|
// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "letter",
|
|
// CHECK-SAME: line: [[@LINE+1]]
|
|
for letter in puzzleInput {
|
|
switch letter {
|
|
case "a", "e", "i", "o", "u", " ":
|
|
continue
|
|
default:
|
|
puzzleOutput.append(letter)
|
|
}
|
|
}
|
|
println(puzzleOutput)
|
|
|
|
|
|
func count() {
|
|
// CHECK-NOT: !DILocalVariable(tag: DW_TAG_auto_variable, name: "$i$generator"
|
|
// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "i",
|
|
// CHECK-SAME: line: [[@LINE+1]]
|
|
for i in 0...100 {
|
|
println(i)
|
|
}
|
|
}
|
|
count()
|
|
|
|
// End-to-end test:
|
|
// RUN: llc %t.ll -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s --check-prefix DWARF-CHECK
|
|
// DWARF-CHECK: DW_TAG_variable
|
|
// DWARF-CHECK: DW_AT_name {{.*}} "letter"
|
|
//
|
|
// DWARF-CHECK: DW_TAG_variable
|
|
// DWARF-CHECK: DW_AT_name {{.*}} "i"
|