Skip to content

Commit c7412d3

Browse files
Update the existing canWrite tests to take advantage of the ".." fix.
1 parent 64126f8 commit c7412d3

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

clang/test/3C/base_subdir/canwrite_constraints_function_and_variable.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,25 @@
44
// variable declarations and checked regions.
55
// (https://github.com/correctcomputation/checkedc-clang/issues/387)
66

7-
// TODO: When https://github.com/correctcomputation/checkedc-clang/issues/327 is
8-
// fixed, replace the absolute -I option with a .. in the #include directive.
9-
//
107
// TODO: Windows compatibility?
118

129
// "Lower" case: -base-dir should default to the working directory, so we should
1310
// not allow canwrite_constraints_function_and_variable.h to change, and the
1411
// internal types of q and the return should remain wild.
1512
//
16-
// RUN: cd %S && 3c -addcr -extra-arg=-I${PWD%/*} -output-dir=%t.checked/base_subdir -warn-all-root-cause -verify %s
13+
// RUN: cd %S && 3c -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause -verify %s
1714
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_LOWER --input-file %t.checked/base_subdir/canwrite_constraints_function_and_variable.c %s
1815
// RUN: test ! -f %t.checked/canwrite_constraints_function_and_variable.checked.h
1916

2017
// "Higher" case: When -base-dir is set to the parent directory, we can change
2118
// canwrite_constraints_function_and_variable.h, so both q and the return should
2219
// become checked.
2320
//
24-
// RUN: cd %S && 3c -addcr -extra-arg=-I${PWD%/*} -base-dir=${PWD%/*} -output-dir=%t.checked2 %s
21+
// RUN: cd %S && 3c -addcr -base-dir=.. -output-dir=%t.checked2 %s
2522
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/base_subdir/canwrite_constraints_function_and_variable.c %s
2623
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/canwrite_constraints_function_and_variable.h %S/../canwrite_constraints_function_and_variable.h
2724

28-
#include "canwrite_constraints_function_and_variable.h"
25+
#include "../canwrite_constraints_function_and_variable.h"
2926

3027
int *bar(int *q) {
3128
// CHECK_LOWER: int *bar(int *q : itype(_Ptr<int>)) : itype(_Ptr<int>) {

clang/test/3C/base_subdir/canwrite_constraints_typedef.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
// TODO: Ditto the TODO comments from
77
// canwrite_constraints_function_and_variable.c re the RUN commands.
8-
// RUN: cd %S && 3c -addcr -extra-arg=-I${PWD%/*} -verify %s | FileCheck -match-full-lines %s
8+
// RUN: cd %S && 3c -addcr -verify %s | FileCheck -match-full-lines %s
99

10-
// expected-error@unwritable_typedef.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}}
11-
// expected-note@unwritable_typedef.h:1 {{-dump-unwritable-changes}}
10+
// expected-error@../unwritable_typedef.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}}
11+
// expected-note@../unwritable_typedef.h:1 {{-dump-unwritable-changes}}
1212

13-
#include "unwritable_typedef.h"
13+
#include "../unwritable_typedef.h"
1414

1515
foo_typedef p = ((void *)0);
1616

0 commit comments

Comments
 (0)