Skip to content

Commit 56f9c89

Browse files
[NFC] Add crash test case for _Atomic(_Bool) IRGen.
1 parent 7fb4815 commit 56f9c89

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

test/IRGen/Inputs/atomic_bool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typedef struct { _Atomic(_Bool) value; } MyAtomicBool;

test/IRGen/Inputs/module.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ module AutolinkElfCPragmaTransitive {
2121
module AutolinkModuleMapLink {
2222
link "autolink-module-map-link"
2323
}
24+
25+
module AtomicBoolModule {
26+
header "atomic_bool.h"
27+
export *
28+
}

test/IRGen/atomic_bool.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: not --crash %target-swift-emit-ir %s -I %S/Inputs
2+
3+
import AtomicBoolModule
4+
5+
public func f() -> MyAtomicBool {
6+
return MyAtomicBool()
7+
}
8+
9+
public func g(_ b: MyAtomicBool) {
10+
let _ = b
11+
}

0 commit comments

Comments
 (0)