diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-09 19:35:45 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-09 19:35:45 +0000 |
| commit | f0e87cf2c3dd9c45906fdc84eaae5e577dfb9829 (patch) | |
| tree | 92495b3496dde7398098d7cd3812e75bc051c04d /clang/test | |
| parent | 166eb3753720dbf5626a481a6d90ebcdd8296a81 (diff) | |
| download | bcm5719-llvm-f0e87cf2c3dd9c45906fdc84eaae5e577dfb9829.tar.gz bcm5719-llvm-f0e87cf2c3dd9c45906fdc84eaae5e577dfb9829.zip | |
Add tests for a couple more DRs.
llvm-svn: 289258
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CXX/drs/dr0xx.cpp | 2 | ||||
| -rw-r--r-- | clang/test/CXX/drs/dr118.cpp | 26 | ||||
| -rw-r--r-- | clang/test/CXX/drs/dr158.cpp | 27 | ||||
| -rw-r--r-- | clang/test/CXX/drs/dr1xx.cpp | 6 |
4 files changed, 57 insertions, 4 deletions
diff --git a/clang/test/CXX/drs/dr0xx.cpp b/clang/test/CXX/drs/dr0xx.cpp index 82f71afd25c..c988b6aba57 100644 --- a/clang/test/CXX/drs/dr0xx.cpp +++ b/clang/test/CXX/drs/dr0xx.cpp @@ -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}} diff --git a/clang/test/CXX/drs/dr118.cpp b/clang/test/CXX/drs/dr118.cpp new file mode 100644 index 00000000000..58aa3912c80 --- /dev/null +++ b/clang/test/CXX/drs/dr118.cpp @@ -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 +} + diff --git a/clang/test/CXX/drs/dr158.cpp b/clang/test/CXX/drs/dr158.cpp new file mode 100644 index 00000000000..37b2ca42e33 --- /dev/null +++ b/clang/test/CXX/drs/dr158.cpp @@ -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; +} + diff --git a/clang/test/CXX/drs/dr1xx.cpp b/clang/test/CXX/drs/dr1xx.cpp index dbd1599e215..9521f0a8b78 100644 --- a/clang/test/CXX/drs/dr1xx.cpp +++ b/clang/test/CXX/drs/dr1xx.cpp @@ -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 @@ -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 @@ -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(); } |

