gcc/testsuite/g++.target/i386/pr106627.C
raw| 1 | /* PR c++/103012 Exception handling with multiversioned functions */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-require-ifunc "" } */ |
| 4 | |
| 5 | extern "C" void abort (void); |
| 6 | |
| 7 | __attribute__((target("default"))) |
| 8 | void f() { |
| 9 | throw 1; |
| 10 | } |
| 11 | |
| 12 | __attribute__((target("sse4.2,bmi"))) |
| 13 | void f() { |
| 14 | throw 2; |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | try { |
| 20 | f(); |
| 21 | } |
| 22 | catch(...) |
| 23 | { |
| 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | abort (); |
| 28 | } |