brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · e409b80 Raw
31 lines · cpp
1// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK2// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK3// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK4// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK5// RUN: %clang_cc1 -std=c++20 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK6// RUN: %clang_cc1 -std=c++23 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK7// RUN: %clang_cc1 -std=c++2c %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK8 9namespace cwg439 { // cwg439: 2.710 11void f() {12  int* p1 = new int;13  const int* p2 = static_cast<const int*>(static_cast<void *>(p1));14  bool b = p1 == p2; // b will have the value true.15}16 17} // namespace cwg43918 19// We're checking that p2 was copied from p1, and then was carried over20// to the comparison without change.21 22// CHECK-LABEL: define {{.*}} void @cwg439::f()()23// CHECK:         [[P1:%.+]] = alloca ptr, align 824// CHECK-NEXT:    [[P2:%.+]] = alloca ptr, align 825// CHECK:         [[TEMP0:%.+]] = load ptr, ptr [[P1]]26// CHECK-NEXT:    store ptr [[TEMP0:%.+]], ptr [[P2]]27// CHECK-NEXT:    [[TEMP1:%.+]] = load ptr, ptr [[P1]]28// CHECK-NEXT:    [[TEMP2:%.+]] = load ptr, ptr [[P2]]29// CHECK-NEXT:    {{.*}} = icmp eq ptr [[TEMP1]], [[TEMP2]]30// CHECK-LABEL: }31