Skip to content

Commit

Permalink
Add tests for a couple more DRs.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289258 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zygoloid committed Dec 9, 2016
1 parent e96b53b commit 9100cdf
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/CXX/drs/dr0xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ namespace dr27 { // dr27: yes
E &m = true ? n : n;
}

// dr28: na
// dr28: na lib

namespace dr29 { // dr29: 3.4
void dr29_f0(); // expected-note {{here}}
Expand Down
26 changes: 26 additions & 0 deletions test/CXX/drs/dr118.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call "

// dr118: yes

struct S {
virtual void f();
};
void (S::*pmf)();

// CHECK-LABEL: define {{.*}} @_Z1g
void g(S *sp) {
// CHECK: call void %
sp->f(); // 1: polymorphic
// CHECK: call void @
sp->S::f(); // 2: non-polymorphic
// CHECK: call void @
(sp->S::f)(); // 3: non-polymorphic
// CHECK: call void %
(sp->*pmf)(); // 4: polymorphic
// CHECK: call void %
(sp->*&S::f)(); // 5: polymorphic
}

27 changes: 27 additions & 0 deletions test/CXX/drs/dr158.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -O3 -disable-llvm-optzns -pedantic-errors -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -O3 -disable-llvm-optzns -pedantic-errors -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -O3 -disable-llvm-optzns -pedantic-errors -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -O3 -disable-llvm-optzns -pedantic-errors -emit-llvm -o - | FileCheck %s

// dr158: yes

// CHECK-LABEL: define {{.*}} @_Z1f
const int *f(const int * const *p, int **q) {
// CHECK: load i32**, {{.*}}, !tbaa ![[INTPTR_TBAA:[^,]*]]
const int *x = *p;
// CHECK: store i32* null, {{.*}}, !tbaa ![[INTPTR_TBAA]]
*q = 0;
return x;
}

struct A {};

// CHECK-LABEL: define {{.*}} @_Z1g
const int *(A::*const *g(const int *(A::* const **p)[3], int *(A::***q)[3]))[3] {
// CHECK: load i64**, {{.*}}, !tbaa ![[MEMPTR_TBAA:[^,]*]]
const int *(A::*const *x)[3] = *p;
// CHECK: store i64* null, {{.*}}, !tbaa ![[MEMPTR_TBAA]]
*q = 0;
return x;
}

6 changes: 3 additions & 3 deletions test/CXX/drs/dr1xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace dr102 { // dr102: yes
}

// dr103: na
// dr104 FIXME: add codegen test
// dr104: na lib
// dr105: na

namespace dr106 { // dr106: sup 540
Expand Down Expand Up @@ -202,7 +202,7 @@ namespace dr116 { // dr116: yes
}

// dr117: na
// dr118 FIXME: add codegen test
// dr118 is in its own file.
// dr119: na
// dr120: na

Expand Down Expand Up @@ -608,7 +608,7 @@ namespace dr155 { // dr155: dup 632
struct S { int n; } s = { { 1 } }; // expected-warning {{braces around scalar initializer}}
}

// dr158 FIXME write codegen test
// dr158 is in its own file.

namespace dr159 { // dr159: 3.5
namespace X { void f(); }
Expand Down
8 changes: 4 additions & 4 deletions www/cxx_dr_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#28">28</a></td>
<td>CD1</td>
<td>'exit', 'signal' and static object destruction</td>
<td class="na" align="center">N/A</td>
<td class="na" align="center">N/A (Library DR)</td>
</tr>
<tr id="29">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#29">29</a></td>
Expand Down Expand Up @@ -663,7 +663,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#104">104</a></td>
<td>NAD</td>
<td>Destroying the exception temp when no handler is found</td>
<td class="none" align="center">Unknown</td>
<td class="na" align="center">N/A (Library DR)</td>
</tr>
<tr id="105">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#105">105</a></td>
Expand Down Expand Up @@ -747,7 +747,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#118">118</a></td>
<td>CD1</td>
<td>Calls via pointers to virtual member functions</td>
<td class="none" align="center">Unknown</td>
<td class="full" align="center">Yes</td>
</tr>
<tr id="119">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#119">119</a></td>
Expand Down Expand Up @@ -987,7 +987,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#158">158</a></td>
<td>CD1</td>
<td>Aliasing and qualification conversions</td>
<td class="none" align="center">Unknown</td>
<td class="full" align="center">Yes</td>
</tr>
<tr id="159">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#159">159</a></td>
Expand Down
3 changes: 3 additions & 0 deletions www/make_cxx_dr_status
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def availability(issue):
elif status == 'na':
avail = 'N/A'
avail_style = ' class="na"'
elif status == 'na lib':
avail = 'N/A (Library DR)'
avail_style = ' class="na"'
elif status.startswith('sup '):
dup = status.split(' ', 1)[1]
avail = 'Superseded by <a href="#%s">%s</a>' % (dup, dup)
Expand Down

0 comments on commit 9100cdf

Please sign in to comment.