Skip to content

Commit df51c4a

Browse files
author
Josh Learn
authored
Merge pull request #33012 from guitard0g/consteval_tsan_test
[Constant Evaluator] Add new test for skipping TSAN instrumentation
2 parents 4130d5c + 4c984f9 commit df51c4a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// REQUIRES: tsan_runtime
2+
// RUN: %empty-directory(%t)
3+
// RUN: %target-swift-frontend -sanitize=thread -swift-version 5 -emit-silgen -primary-file %S/Inputs/OSLogConstantEvaluable.swift -o %t/OSLogConstantEvaluableTsanTest_silgen.sil
4+
//
5+
// Run the (mandatory) passes on which constant evaluator depends, and run the
6+
// constant evaluator on the SIL produced after the dependent passes are run.
7+
//
8+
// RUN: %target-sil-opt -silgen-cleanup -raw-sil-inst-lowering -allocbox-to-stack -mandatory-inlining -constexpr-limit 3072 -test-constant-evaluable-subset %t/OSLogConstantEvaluableTsanTest_silgen.sil > %t/OSLogConstantEvaluableTsanTest.sil 2> %t/error-output
9+
//
10+
// RUN: %FileCheck %S/Inputs/OSLogConstantEvaluable.swift < %t/error-output
11+
//
12+
// REQUIRES: VENDOR=apple
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// REQUIRES: tsan_runtime
2+
// RUN: %empty-directory(%t)
3+
// RUN: %target-swift-frontend -sanitize=thread -emit-silgen -primary-file %S/Inputs/constant_evaluable.swift -o %t/constant_evaluable_tsan_test_silgen.sil
4+
//
5+
// Run the (mandatory) passes on which constant evaluator depends, and test the
6+
// constant evaluator on the SIL produced after the dependent passes are run.
7+
//
8+
// RUN: not %target-sil-opt -silgen-cleanup -raw-sil-inst-lowering -allocbox-to-stack -mandatory-inlining -constexpr-limit 3000 -test-constant-evaluable-subset %t/constant_evaluable_tsan_test_silgen.sil > %t/constant_evaluable_tsan_test.sil 2> %t/error-output
9+
//
10+
// RUN: %FileCheck %S/Inputs/constant_evaluable.swift < %t/error-output

0 commit comments

Comments
 (0)