Fariborz Jahanian | acdfa7a | 2010-04-20 22:02:31 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s |
| 2 | // pr6644 |
| 3 | |
| 4 | extern "C" { |
| 5 | namespace N { |
| 6 | struct X { |
| 7 | virtual void f(); |
| 8 | }; |
| 9 | void X::f() { } |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | // CHECK: define void @_ZN1N1X1fEv |
Rafael Espindola | f418765 | 2013-02-14 01:18:37 +0000 | [diff] [blame] | 14 | |
| 15 | extern "C" { |
| 16 | static void test2_f() { |
| 17 | } |
Rafael Espindola | 46d2b6b | 2013-02-14 03:31:26 +0000 | [diff] [blame] | 18 | // This is not required by the standard, but users assume they know |
| 19 | // the mangling of static functions in extern "C" contexts. |
| 20 | // CHECK: define internal void @test2_f( |
Rafael Espindola | f418765 | 2013-02-14 01:18:37 +0000 | [diff] [blame] | 21 | void test2_use() { |
| 22 | test2_f(); |
Rafael Espindola | f418765 | 2013-02-14 01:18:37 +0000 | [diff] [blame] | 23 | } |
| 24 | } |
Rafael Espindola | 3e0e33d | 2013-02-14 15:38:59 +0000 | [diff] [blame^] | 25 | |
| 26 | extern "C" { |
| 27 | struct test3_s { |
| 28 | }; |
| 29 | bool operator==(const int& a, const test3_s& b) { |
| 30 | } |
| 31 | } |