diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-11-03 02:23:33 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-11-03 02:23:33 +0000 |
commit | 35018958637384423c1f8a48628c8f3f8dea23c5 (patch) | |
tree | d7bb426a5653b3e26093680054b15c90442da7b8 /clang/test/CodeGenCXX/nullptr.cpp | |
parent | c39b97f2112e015cd463ddc434945ba04dba687d (diff) | |
download | bcm5719-llvm-35018958637384423c1f8a48628c8f3f8dea23c5.tar.gz bcm5719-llvm-35018958637384423c1f8a48628c8f3f8dea23c5.zip |
Revert r345562: "PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type"
This exposes a (known) CodeGen bug: it can't cope with emitting lvalue
expressions that denote non-odr-used but usable-in-constant-expression
variables. See PR39528 for a testcase.
Reverted for now until that issue can be fixed.
llvm-svn: 346065
Diffstat (limited to 'clang/test/CodeGenCXX/nullptr.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/nullptr.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/clang/test/CodeGenCXX/nullptr.cpp b/clang/test/CodeGenCXX/nullptr.cpp index 222e5e5803c..e93f7061bdd 100644 --- a/clang/test/CodeGenCXX/nullptr.cpp +++ b/clang/test/CodeGenCXX/nullptr.cpp @@ -22,44 +22,3 @@ void g() { const std::type_info& f2() { return typeid(nullptr_t); } - -union U { - int n; - nullptr_t b; -}; -// CHECK-LABEL: define {{.*}}pr23833_a -// CHECK: store -// CHECK: load -// CHECK-NOT: load -// CHECK: ret i1 false -bool pr23833_a(U &u) { return u.b; } - -// CHECK-LABEL: define {{.*}}pr23833_b -// CHECK: store -// CHECK: load -// CHECK-NOT: load -// CHECK: ret i8* null -nullptr_t pr23833_b(nullptr_t &n) { return n; } - -struct X1 { operator int*(); }; -struct X2 { operator const nullptr_t&(); }; - -// CHECK-LABEL: define {{.*}}pr23833_c -// CHECK: call {{.*}}X1 -// CHECK: call {{.*}}X2 -// CHECK-NOT: load -// CHECK: ret i32 -int pr23833_c() { - return X1() != X2(); -} - -// CHECK-LABEL: define {{.*}}pr23833_d -// CHECK: call {{.*}}X2 -// CHECK-NOT: load -// CHECK: store -// CHECK: load -// CHECK: ret i32* -int *pr23833_d() { - int *p = X2(); - return p; -} |