mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 21:46:05 +00:00

This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
34 lines
962 B
C++
34 lines
962 B
C++
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// rdar://20636558
|
|
|
|
#pragma GCC diagnostic ignored "-Wincompatible-ms-struct"
|
|
#define ATTR __attribute__((__ms_struct__))
|
|
|
|
struct ATTR VBase {
|
|
virtual void foo() = 0;
|
|
};
|
|
|
|
struct ATTR Base : virtual VBase {
|
|
virtual void bar() = 0;
|
|
};
|
|
|
|
struct ATTR Derived : Base {
|
|
Derived();
|
|
void foo();
|
|
void bar();
|
|
int value;
|
|
};
|
|
|
|
// CHECK: [[DERIVED:%.*]] = type <{ [[BASE:%.*]], i32, [4 x i8] }>
|
|
// CHECK: [[BASE]] = type { [[VBASE:%.*]] }
|
|
// CHECK: [[VBASE]] = type { i32 (...)** }
|
|
|
|
// CHECK: define{{.*}} void @_ZN7DerivedC2Ev
|
|
// CHECK: [[SELF:%.*]] = load [[DERIVED]]*
|
|
// CHECK: [[T0:%.*]] = bitcast [[DERIVED]]* [[SELF]] to [[BASE]]*
|
|
// CHECK: call void @_ZN4BaseC2Ev([[BASE]]* {{[^,]*}} [[T0]], i8**
|
|
// CHECK: [[T0:%.*]] = getelementptr inbounds {{.*}} [[SELF]], i32 0, i32 1
|
|
// CHECK: store i32 20, i32* [[T0]],
|
|
Derived::Derived() : value(20) {}
|