Skip to content

Commit 18e9754

Browse files
authored
[BoundsSafety][NFC] Fix bounds safety test failures in Linux (#9795)
* [BoundsSafety][NFC] Fix test failures on Linux due to missing target triple * [BoundsSafety][NFC] Require 'system-darwin' for tests failing in Linux
1 parent c4a24c9 commit 18e9754

File tree

65 files changed

+92
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+92
-53
lines changed

clang/test/BoundsSafety/AST/dbpt-nullable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s 2>&1 | FileCheck %s --check-prefix=CHECK
3-
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s 2>&1 | FileCheck %s --check-prefix=CHECK
2+
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s | FileCheck %s --check-prefix=CHECK
3+
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s | FileCheck %s --check-prefix=CHECK
44

55
#include <ptrcheck.h>
66

clang/test/BoundsSafety/AST/redundant-attrs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bidiPtr2 __bidi_indexable ptrBoundBound2;
1414
// CHECK: VarDecl {{.*}} ptrBoundBound 'bidiPtr':'int *__bidi_indexable'
1515
// CHECK-NEXT: VarDecl {{.*}} ptrBoundBound2 'int *__bidi_indexable'
1616

17-
typedef const int * __nullable __bidi_indexable my_c_ptr_nullable_bidi_t;
17+
typedef const int * _Nullable __bidi_indexable my_c_ptr_nullable_bidi_t;
1818
my_c_ptr_nullable_bidi_t __bidi_indexable def_c_nullable_bidi_ptr;
1919
// CHECK: TypedefDecl {{.*}} referenced my_c_ptr_nullable_bidi_t 'const int *__bidi_indexable _Nullable':'const int *__bidi_indexable'
2020
// CHECK-NEXT: AttributedType {{.*}} 'const int *__bidi_indexable _Nullable' sugar

clang/test/BoundsSafety/AST/terminated-by-attr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ void ctypedef_c_nt(my_cint_t const __null_terminated ctypedef_c_nt);
7878
// CHECK: VarDecl {{.+}} def_c_nt_nt 'int *__single __terminated_by(0)const':'int *__singleconst'
7979
my_ptr_c_nt_t __null_terminated def_c_nt_nt;
8080

81-
#define my_ptr_nt_nullable_t int *__null_terminated __nullable
81+
#define my_ptr_nt_nullable_t int *__null_terminated _Nullable
8282
// CHECK: VarDecl {{.+}} def_nt_nullable_nt 'int *__single __terminated_by(0) _Nullable':'int *__single'
8383
my_ptr_nt_nullable_t __null_terminated def_nt_nullable_nt;
8484

85-
#define my_ptr_nullable_nt_t int *__nullable __null_terminated
85+
#define my_ptr_nullable_nt_t int *_Nullable __null_terminated
8686
// CHECK: VarDecl {{.+}} def_nullable_nt_nt 'int *__single __terminated_by(0) _Nullable':'int *__single'
8787
my_ptr_nullable_nt_t __null_terminated def_nullable_nt_nt;
8888

8989
#define my_c_a_int_t const int __attribute__((aligned(64)))
90-
typedef my_c_a_int_t * __attribute__((align_value(64))) __nullable __null_terminated my_c_ptr_nullable_nt_t;
90+
typedef my_c_a_int_t * __attribute__((align_value(64))) _Nullable __null_terminated my_c_ptr_nullable_nt_t;
9191
// CHECK: TypedefDecl {{.*}} referenced my_c_ptr_nullable_nt_t 'const int * __terminated_by(0) _Nullable':'const int *'
9292
// CHECK-NEXT: |-AttributedType {{.*}} 'const int * __terminated_by(0) _Nullable' sugar
9393
// CHECK-NEXT: | `-ValueTerminatedType {{.*}} 'const int * __terminated_by(0)' sugar

clang/test/BoundsSafety/CodeGen/access-size-check-unsized-elt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: system-darwin
12
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
23
// RUN: %clang_cc1 -O0 -fbounds-safety -fbounds-safety-bringup-missing-checks=access_size -triple arm64-apple-iphoneos -emit-llvm %s -o - | FileCheck --check-prefix ACCESS-SIZE %s
34
// RUN: %clang_cc1 -O0 -fbounds-safety -fno-bounds-safety-bringup-missing-checks=access_size -triple arm64-apple-iphoneos -emit-llvm %s -o - | FileCheck --check-prefix ACCESS-SIZE %s

clang/test/BoundsSafety/CodeGen/alloc-sized-calloc/alloc-sized-calloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: system-darwin
12
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --replace-value-regex "!annotation ![0-9]+" "!tbaa ![0-9]+" "!tbaa\.struct ![0-9]+" "!nosanitize ![0-9]+" "!srcloc ![0-9]+" --prefix-filecheck-ir-name TMP_
23

34
// RUN: %clang_cc1 -emit-llvm -triple arm64e -fbounds-safety %s -o - | FileCheck %s

clang/test/BoundsSafety/CodeGen/arithmetic-ops-in-counted-by-assign.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: system-darwin
12
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --replace-value-regex "!annotation ![0-9]+" "!tbaa ![0-9]+" "!tbaa\.struct ![0-9]+" "!nosanitize ![0-9]+" "!srcloc ![0-9]+"
23
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64e-apple-iphoneos -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s
34
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64e-apple-iphoneos -Wno-bounds-safety-init-list -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s

clang/test/BoundsSafety/CodeGen/arithmetic-ops-in-counted-by-calls.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
// REQUIRES: system-darwin
12
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --replace-value-regex "!annotation ![0-9]+" "!tbaa ![0-9]+" "!tbaa\.struct ![0-9]+" "!nosanitize ![0-9]+" "!srcloc ![0-9]+" --prefix-filecheck-ir-name TMP_
2-
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64e-apple-iphoneos -emit-llvm %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64e-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64e-apple-ios -emit-llvm %s -o - | FileCheck %s
4+
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64e-apple-ios -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
45

56
#include <ptrcheck.h>
67
#include <stddef.h>

clang/test/BoundsSafety/CodeGen/auto-init/global-bidi-indexable-init-scalar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
// RUN: %clang_cc1 -S -fbounds-safety -O0 %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -O0 %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -S -fbounds-safety -triple arm64-apple-darwin -O0 %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -triple arm64-apple-darwin -O0 %s -o - | FileCheck %s
44

55
#include <ptrcheck.h>
66

clang/test/BoundsSafety/CodeGen/auto-init/global-bidi-indexable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
// RUN: %clang_cc1 -S -fbounds-safety -O0 %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -O0 %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -S -fbounds-safety -O0 -triple arm64-apple-darwin %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -O0 -triple arm64-apple-darwin %s -o - | FileCheck %s
44

55
#include <ptrcheck.h>
66

clang/test/BoundsSafety/CodeGen/auto-init/global-wide-ptr-init-out-of-range.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
// RUN: %clang_cc1 -S -fbounds-safety -O0 %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -O0 %s -o - | FileCheck %s
2+
// RUN: %clang_cc1 -S -fbounds-safety -O0 -triple arm64-apple-darwin %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -O0 -triple arm64-apple-darwin %s -o - | FileCheck %s
44

55
#include <ptrcheck.h>
66

0 commit comments

Comments
 (0)