1 // RUN: %clang_cc1 -std=c++1z -Werror -triple i386-unknown-unknown -emit-llvm -O1 -disable-llvm-passes -o - %s | FileCheck %s
3 // std::byte should be considered equivalent to char for aliasing.
6 enum byte
: unsigned char {};
9 // CHECK-LABEL: define{{.*}} void @test0(
10 extern "C" void test0(std::byte
*sb
, int *i
) {
11 // CHECK: store i8 0, ptr %{{.*}} !tbaa [[TAG_CHAR:!.*]]
14 // CHECK: store i32 1, ptr %{{.*}} !tbaa [[TAG_INT:!.*]]
18 enum byte
: unsigned char {};
20 enum byte
: unsigned char {};
22 enum byte
: unsigned char {};
26 // Make sure we don't get confused with other enums named 'byte'.
28 // CHECK-LABEL: define{{.*}} void @test1(
29 extern "C" void test1(::byte
*b
, ::my::byte
*mb
, ::my::std::byte
*msb
) {
32 *msb
= ::my::std::byte
{0};
33 // CHECK-NOT: store i8 0, ptr %{{.*}} !tbaa [[TAG_CHAR]]
36 // CHECK: !"any pointer", [[TYPE_CHAR:!.*]],
37 // CHECK: [[TYPE_CHAR]] = !{!"omnipotent char", [[TAG_CXX_TBAA:!.*]],
38 // CHECK: [[TAG_CXX_TBAA]] = !{!"Simple C++ TBAA"}
39 // CHECK: [[TAG_CHAR]] = !{[[TYPE_CHAR:!.*]], [[TYPE_CHAR]], i64 0}
40 // CHECK: [[TAG_INT]] = !{[[TYPE_INT:!.*]], [[TYPE_INT]], i64 0}
41 // CHECK: [[TYPE_INT]] = !{!"int", [[TYPE_CHAR]]