26 lines · cpp
1// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -O2 -disable-llvm-passes -o - | FileCheck %s2// RUN: %clang_cc1 %s -triple %ms_abi_triple -emit-llvm -O2 -disable-llvm-passes -o - | FileCheck %s3 4enum class __attribute__((may_alias)) E {};5 6template<typename T> struct A {7 using B __attribute__((may_alias)) = enum {};8};9 10template<typename T> using Alias = typename A<T>::B;11 12// CHECK-LABEL: define {{.*}}foo13// CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS:[^ ,]*]]14auto foo(E &r) { return r; }15 16// CHECK-LABEL: define {{.*}}goo17// CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS]]18auto goo(A<int>::B &r) { return r; }19 20// CHECK-LABEL: define {{.*}}hoo21// CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS]]22auto hoo(Alias<int> &r) { return r; }23 24// CHECK: ![[CHAR:.*]] = !{!"omnipotent char", !{{.*}}, i64 0}25// CHECK: ![[MAY_ALIAS]] = !{![[CHAR]], ![[CHAR]], i64 0}26