Benjamin Kramer | f3fce80 | 2012-08-03 08:39:58 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -std=c++11 | FileCheck %s |
| 2 | // PR13424 |
| 3 | |
Benjamin Kramer | c23aca4 | 2012-08-03 15:43:22 +0000 | [diff] [blame^] | 4 | namespace Test1 { |
Benjamin Kramer | f3fce80 | 2012-08-03 08:39:58 +0000 | [diff] [blame] | 5 | struct X { |
Benjamin Kramer | c23aca4 | 2012-08-03 15:43:22 +0000 | [diff] [blame^] | 6 | virtual ~X(); // Key function. |
| 7 | virtual void f(); // Not a key function. |
| 8 | }; |
| 9 | |
| 10 | X::~X() = default; |
| 11 | |
| 12 | // Verify that the vtable is emitted. |
| 13 | // CHECK: @_ZTVN5Test11XE = unnamed_addr constant |
| 14 | } |
| 15 | |
| 16 | namespace Test2 { |
| 17 | struct X { |
| 18 | virtual ~X() = default; // Not a key function. |
| 19 | virtual void f(); // Key function. |
Benjamin Kramer | f3fce80 | 2012-08-03 08:39:58 +0000 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | void X::f() {} |
| 23 | |
Benjamin Kramer | c23aca4 | 2012-08-03 15:43:22 +0000 | [diff] [blame^] | 24 | // Verify that the vtable is emitted. |
| 25 | // CHECK: @_ZTVN5Test21XE = unnamed_addr constant |
| 26 | } |
| 27 | |
| 28 | namespace Test3 { |
| 29 | struct X { |
| 30 | virtual ~X() = delete; // Not a key function. |
| 31 | virtual void f(); // Key function. |
| 32 | }; |
| 33 | |
| 34 | void X::f() {} |
| 35 | |
| 36 | // Verify that the vtable is emitted. |
| 37 | // CHECK: @_ZTVN5Test31XE = unnamed_addr constant |
| 38 | } |