Skip to content

Commit 0565e65

Browse files
committed
[clang/test] Correctly specify simulator env in target flag in fsanitize.c
Putting "simulator" in the `-target` flag requires putting it in the "environment" part of the triple, which is the 4th `-`-separated component. Some places in the tests currently use "iossimulator" which puts it in the OS field. The triple parsing code in llvm::Triple uses startswith("ios") in parseOS(), so that successfully sets the OS to "iOS", and all these triples use an intel arch, and iOS + intel triple implicitly make the driver convert the environment to "simulator", so this happened to work -- but it led to the somewhat strange "simulator-simulator" in the diag in the test. No behavior change. Differential Revision: https://reviews.llvm.org/D132399
1 parent cd24120 commit 0565e65

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

clang/test/Driver/fsanitize.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@
465465
// RUN: %clang -target arm64-apple-macos -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ARM64-MACOS
466466
// CHECK-TSAN-ARM64-MACOS-NOT: unsupported option
467467

468-
// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
468+
// RUN: %clang -target x86_64-apple-ios-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
469469
// CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
470470

471-
// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
471+
// RUN: %clang -target x86_64-apple-tvos-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
472472
// CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
473473

474474
// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN
@@ -477,11 +477,11 @@
477477
// RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS
478478
// CHECK-TSAN-ARM-IOS: unsupported option '-fsanitize=thread' for target 'arm-apple-ios'
479479

480-
// RUN: %clang -target i386-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR
481-
// CHECK-TSAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i386-apple-iossimulator-simulator'
480+
// RUN: %clang -target i386-apple-ios-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR
481+
// CHECK-TSAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i386-apple-ios-simulator'
482482

483-
// RUN: %clang -target i386-apple-tvossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-TVOSSIMULATOR
484-
// CHECK-TSAN-I386-TVOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i386-apple-tvossimulator-simulator'
483+
// RUN: %clang -target i386-apple-tvos-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-TVOSSIMULATOR
484+
// CHECK-TSAN-I386-TVOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i386-apple-tvos-simulator'
485485

486486
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-memory-access %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS
487487
// CHECK-TSAN-MEMORY-ACCESS-NOT: -cc1{{.*}}tsan-instrument-memory-accesses=0
@@ -552,10 +552,10 @@
552552
// RUN: %clang -target x86_64-apple-darwin -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-DARWIN
553553
// CHECK-LSAN-X86-64-DARWIN-NOT: unsupported option
554554

555-
// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-IOSSIMULATOR
555+
// RUN: %clang -target x86_64-apple-ios-simulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-IOSSIMULATOR
556556
// CHECK-LSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
557557

558-
// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-TVOSSIMULATOR
558+
// RUN: %clang -target x86_64-apple-tvos-simulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-X86-64-TVOSSIMULATOR
559559
// CHECK-LSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
560560

561561
// RUN: %clang -target i386-apple-darwin -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-DARWIN
@@ -564,10 +564,10 @@
564564
// RUN: %clang -target arm-apple-ios -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-ARM-IOS
565565
// CHECK-LSAN-ARM-IOS-NOT: unsupported option
566566

567-
// RUN: %clang -target i386-apple-iossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-IOSSIMULATOR
567+
// RUN: %clang -target i386-apple-ios-simulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-IOSSIMULATOR
568568
// CHECK-LSAN-I386-IOSSIMULATOR-NOT: unsupported option
569569

570-
// RUN: %clang -target i386-apple-tvossimulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-TVOSSIMULATOR
570+
// RUN: %clang -target i386-apple-tvos-simulator -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-I386-TVOSSIMULATOR
571571
// CHECK-LSAN-I386-TVOSSIMULATOR-NOT: unsupported option
572572

573573

0 commit comments

Comments
 (0)